tightvnc-filetransfer: wait for download thread end in CloseUndoneFileDownload()

...and use it when deregistering the file transfer extension.

Closes #242
pull/3/head
Christian Beier 6 years ago
parent f8912fee5a
commit 73cb96fec0
No known key found for this signature in database
GPG Key ID: 421BB3B45C6067F8

@ -770,6 +770,8 @@ CloseUndoneFileDownload(rfbClientPtr cl, rfbTightClientPtr rtcp)
if(rtcp->rcft.rcfd.downloadInProgress == TRUE) {
rtcp->rcft.rcfd.downloadInProgress = FALSE;
/* the thread will return if downloadInProgress is FALSE */
pthread_join(rtcp->rcft.rcfd.downloadThread, NULL);
if(rtcp->rcft.rcfd.downloadFD != -1) {
close(rtcp->rcft.rcfd.downloadFD);

@ -26,6 +26,7 @@
#include <rfb/rfb.h>
#include "rfbtightproto.h"
#include "handlefiletransferrequest.h"
#include "filetransfermsg.h"
/*
* Get my data!
@ -448,9 +449,11 @@ rfbTightExtensionMsgHandler(struct _rfbClientRec* cl, void* data,
void
rfbTightExtensionClientClose(rfbClientPtr cl, void* data) {
if(data != NULL)
if(data != NULL) {
CloseUndoneFileUpload(cl, data);
CloseUndoneFileDownload(cl, data);
free(data);
}
}
void

Loading…
Cancel
Save