summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2018-10-21 23:38:40 +0200
committerChristian Beier <dontmind@freeshell.org>2018-10-21 23:38:40 +0200
commit89419fb1a0cef42b63528e6930f4e545cfef4c95 (patch)
tree12d2e3289040bc77bd97d8216e7d8c7137e35de9
parentca2a5ac02fbbadd0a21fabba779c1ea69173d10b (diff)
downloadlibtdevnc-89419fb1a0cef42b63528e6930f4e545cfef4c95.tar.gz
libtdevnc-89419fb1a0cef42b63528e6930f4e545cfef4c95.zip
tightvnc-filetransfer: tie the download thread to the control structure
re #242
-rw-r--r--libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c3
-rw-r--r--libvncserver/tightvnc-filetransfer/rfbtightproto.h1
2 files changed, 2 insertions, 2 deletions
diff --git a/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c b/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c
index 0473783..8e38f88 100644
--- a/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c
+++ b/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c
@@ -508,7 +508,6 @@ RunFileDownloadThread(void* client)
void
HandleFileDownload(rfbClientPtr cl, rfbTightClientPtr rtcp)
{
- pthread_t fileDownloadThread;
FileTransferMsg fileDownloadMsg;
memset(&fileDownloadMsg, 0, sizeof(FileTransferMsg));
@@ -521,7 +520,7 @@ HandleFileDownload(rfbClientPtr cl, rfbTightClientPtr rtcp)
rtcp->rcft.rcfd.downloadInProgress = FALSE;
rtcp->rcft.rcfd.downloadFD = -1;
- if(pthread_create(&fileDownloadThread, NULL, RunFileDownloadThread, (void*)
+ if(pthread_create(&rtcp->rcft.rcfd.downloadThread, NULL, RunFileDownloadThread, (void*)
cl) != 0) {
FileTransferMsg ftm = GetFileDownLoadErrMsg();
diff --git a/libvncserver/tightvnc-filetransfer/rfbtightproto.h b/libvncserver/tightvnc-filetransfer/rfbtightproto.h
index d0fe642..30fc5f5 100644
--- a/libvncserver/tightvnc-filetransfer/rfbtightproto.h
+++ b/libvncserver/tightvnc-filetransfer/rfbtightproto.h
@@ -148,6 +148,7 @@ typedef struct _rfbClientFileDownload {
int downloadInProgress;
unsigned long mTime;
int downloadFD;
+ pthread_t downloadThread;
} rfbClientFileDownload ;
typedef struct _rfbClientFileUpload {