LibVNC / libvncserver

LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
GNU General Public License v2.0
1.12k stars 489 forks source link

Use expamle‘s filetransfer can not transfer file by tightVNC viewer #467

Closed 229024527 closed 3 years ago

229024527 commented 3 years ago

If you'd like to put out an incentive for fixing this bug, you can do so at https://issuehunt.io/r/LibVNC/libvncserver

When i use expamle's directory filetransfer but can not transfer file,is this a bug?

  1. mkdir build
  2. cd build
  3. cmake ..
  4. cmake --build .
  5. cd example
  6. ./filetransfer
  7. use other pc in same network segment open TightVNC viewer to connecting host

when connection established but transfer file button is gray

bk138 commented 3 years ago

Hi, which viewer version on which OS are you using? (2.x uses another file transfer protocol...)

229024527 commented 3 years ago

Hi, which viewer version on which OS are you using? (2.x uses another file transfer protocol...)

Thank you for you reply,My TightVNC viewer is 2.8.27

229024527 commented 3 years ago

Hi, which viewer version on which OS are you using? (2.x uses another file transfer protocol...)

I try to use tightvnc-1.3.10,It works,which protocol use in 2.x

bk138 commented 3 years ago

You can read more in https://www.tightvnc.com/release-2.0.php

zzxyb commented 1 year ago

I register the TightVNCFileTransfer extension on the client and server, and then test in the client to let the server create a folder。HandleRFBServerMessage often returns false, and then the client disconnect。 The same is true for my test transfer file. I wrote the code in Arch Linux. libvncserver-LibVNCServer-0.9.14 library is used.The remote image and remote control are all normal, only the file transfer will have problems.

rfbRegisterTightVNCFileTransferExtension();

void FileTransfer::createRemoteDirectory(const QString &dir)
{
    rfbFileTransferMsg ft;
    ft.type = rfbFileTransfer;
    ft.contentType = rfbCommand;
    ft.contentParam = rfbCDirCreate;
    ft.size = 0;
    ft.length = Swap32IfLE(dir.length());

    WriteToRFBServer(m_client->getClient(), (char *)&ft, sz_rfbFileTransferMsg);
    WriteToRFBServer(m_client->getClient(), (char *)dir.toLocal8Bit().data(), dir.length());
}

may I ask if there is an example of using TightVNCFileTransfer in libvncserverclient?

bk138 commented 1 year ago

@zzxyb please see https://github.com/LibVNC/libvncserver/blob/master/examples/server/filetransfer.c and especially note the leading comment. No client example AFAIK.