Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Bluesky/AT Protocol: https://bsky.app/profile/ultravnc.bsky.social
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

rfbFileTransferProtocol

Developers may discuss here
Post Reply
pyromanci
Posts: 4
Joined: 2013-12-05 18:29

rfbFileTransferProtocol

Post by pyromanci »

Ok,

I've been working on a android vnc server (for my personal use/experimenting). I've taken some existing projects and have been able to port them over just fine. One feature I would like to play with implementing is the file transfer feature.

While shifting through the code and a few clients code. I have been having a hard time coming up with how the client/server tells the other "hey I support the FTProtocol".

I see bit like:

Code: Select all

SendFTProtocolMsg()
{
    rfbFileTransferMsg ft;
    memset(&ft, 0, sizeof ft);
    ft.type = rfbFileTransfer;
    ft.contentType = rfbFileTransferProtocolVersion;
    ft.contentParam = FT_PROTO_VERSION_3;
    m_socket->SendExact((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
}
When the server is reading the SetEncoding message I do see

Code: Select all

if (Swap32IfLE(encoding) == rfbEncodingFTProtocolVersion) 
Problem is when I look at the client's code. I cannot see this encoding being set and sent in the initial hand shake.

So I'm a little confused at the moment and any insight in how/when the server/client should be telling the other that it supports file transfer would be great.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6867
Joined: 2004-04-23 10:21
Contact:

Re: rfbFileTransferProtocol

Post by Rudi De Vos »

Its handle as a pseudo encoder.
The viewer and server exchange the supported encoders ( like hextile, tight,zrle..), rfbEncodingFTProtocolVersion
Viewer

Code: Select all

encs[se->nEncodings++] = Swap32IfLE(rfbEncodingServerState);
    encs[se->nEncodings++] = Swap32IfLE(rfbEncodingEnableKeepAlive);
    encs[se->nEncodings++] = Swap32IfLE(rfbEncodingFTProtocolVersion);
server

Code: Select all

if (Swap32IfLE(encoding) == rfbEncodingFTProtocolVersion) {
                        need_ft_version_msg = true;
						vnclog.Print(LL_INTINFO, VNCLOG("FTProtocolVersion protocol extension enabled\n"));
                        continue;
					}
server

Code: Select all

if (need_ft_version_msg)
        {
            // send a ft protocol message to client.
            m_client->SendFTProtocolMsg();
            need_ft_version_msg = false;
        }
Post Reply