rfbFileTransferProtocol

Developers may discuss here.

rfbFileTransferProtocol

Postby pyromanci » 2014-09-01 18:08

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.
pyromanci
 
Posts: 4
Joined: 2013-12-05 18:29

Re: rfbFileTransferProtocol

Postby Rudi De Vos » 2014-09-01 19:17

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;
        }
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5488
Joined: 2004-04-23 10:21


Return to Developer discussions (mainly user-mode)

Who is online

Users browsing this forum: No registered users and 4 guests