Commit f7d48515 authored by runge's avatar runge

Add logging output to know when inside tightvnc-filetransfer functions.

parent 3110c0e3
......@@ -71,6 +71,8 @@ InitFileTransfer()
if(fileTransferInitted)
return;
rfbLog("tightvnc-filetransfer/InitFileTransfer\n");
memset(ftproot, 0, sizeof(ftproot));
userHome = GetHomeDir(uid);
......@@ -98,6 +100,8 @@ SetFtpRoot(char* path)
struct stat stat_buf;
DIR* dir = NULL;
rfbLog("tightvnc-filetransfer/SetFtpRoot\n");
if((path == NULL) || (strlen(path) == 0) || (strlen(path) > (PATH_MAX - 1))) {
rfbLog("File [%s]: Method [%s]: parameter passed is improper, ftproot"
" not changed\n", __FILE__, __FUNCTION__);
......
......@@ -59,6 +59,7 @@ static void
rfbVncAuthSendChallenge(rfbClientPtr cl)
{
rfbLog("tightvnc-filetransfer/rfbVncAuthSendChallenge\n");
/* 4 byte header is alreay sent. Which is rfbSecTypeVncAuth (same as rfbVncAuth). Just send the challenge. */
rfbRandomBytes(cl->authChallenge);
if (rfbWriteExact(cl, (char *)cl->authChallenge, CHALLENGESIZE) < 0) {
......@@ -84,6 +85,8 @@ rfbProcessClientAuthType(rfbClientPtr cl)
int n, i;
rfbTightClientPtr rtcp = rfbGetTightClientData(cl);
rfbLog("tightvnc-filetransfer/rfbProcessClientAuthType\n");
if(rtcp == NULL)
return;
......@@ -155,6 +158,8 @@ rfbSendAuthCaps(rfbClientPtr cl)
int count = 0;
rfbTightClientPtr rtcp = rfbGetTightClientData(cl);
rfbLog("tightvnc-filetransfer/rfbSendAuthCaps\n");
if(rtcp == NULL)
return;
......@@ -199,6 +204,8 @@ rfbSendTunnelingCaps(rfbClientPtr cl)
rfbTunnelingCapsMsg caps;
uint32_t nTypes = 0; /* we don't support tunneling yet */
rfbLog("tightvnc-filetransfer/rfbSendTunnelingCaps\n");
caps.nTunnelTypes = Swap32IfLE(nTypes);
if (rfbWriteExact(cl, (char *)&caps, sz_rfbTunnelingCapsMsg) < 0) {
rfbLogPerror("rfbSendTunnelingCaps: write");
......@@ -245,6 +252,8 @@ rfbSendInteractionCaps(rfbClientPtr cl)
intr_caps.nEncodingTypes = Swap16IfLE(N_ENC_CAPS);
intr_caps.pad = 0;
rfbLog("tightvnc-filetransfer/rfbSendInteractionCaps\n");
/* Supported server->client message types. */
/* For file transfer support: */
i = 0;
......@@ -337,7 +346,7 @@ handleMessage(rfbClientPtr cl,
{
rfbTightClientPtr data;
rfbLog("%s message received\n", messageName);
rfbLog("tightvnc-filetransfer: %s message received\n", messageName);
if((IsFileTransferEnabled() == FALSE) || ( cl->viewOnly == TRUE)) {
rfbCloseClient(cl);
......@@ -425,6 +434,8 @@ rfbTightUsage(void) {
int
rfbTightProcessArg(int argc, char *argv[]) {
rfbLog("tightvnc-filetransfer/rfbTightProcessArg\n");
InitFileTransfer();
if(argc<1)
......@@ -453,6 +464,8 @@ rfbTightProcessArg(int argc, char *argv[]) {
void
rfbHandleSecTypeTight(rfbClientPtr cl) {
rfbLog("tightvnc-filetransfer/rfbHandleSecTypeTight\n");
rfbTightClientPtr rtcp = (rfbTightClientPtr) malloc(sizeof(rfbTightClientRec));
if(rtcp == NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment