diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-11 23:54:53 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-11 23:54:53 +0300 |
commit | 3945a304e5162f3bf39347615254a746feb2eb0f (patch) | |
tree | 9c9d5edef2ce690a0a7d5fcf6db322e3215f4bda /utilities.cpp | |
parent | f0bca208f1d668f0ad3d51afdafbb9d30ec8555b (diff) |
now it must be secure, but only one encrypted filetransfer will work at same time, other will wait for it's done.
Diffstat (limited to 'utilities.cpp')
-rw-r--r-- | utilities.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/utilities.cpp b/utilities.cpp index 0d51010..6d7fb58 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -278,6 +278,8 @@ struct file_in_transfer list <file_in_transfer*> transfers; +boost::mutex filetransfer_mutex; //currently safe to use only one encrypted fletransfers at same time + int onProtoAck(WPARAM w, LPARAM l) { ACKDATA *ack=(ACKDATA*)l;
@@ -309,6 +311,7 @@ int onProtoAck(WPARAM w, LPARAM l) // if((*i)->thread == ccs)
DeleteFile((*i)->file.c_str());
transfers.clear();
+ filetransfer_mutex.unlock();
}
// if(_tcsstr(f->tszCurrentFile, _T(".gpg"))) //ok, succesfuly sent, delete temporary file
// DeleteFile(f->tszCurrentFile);
@@ -365,6 +368,7 @@ int onSendFile(WPARAM w, LPARAM l) CCSDATA *ccs=(CCSDATA*)l; if(isContactSecured(ccs->hContact)) { + filetransfer_mutex.lock(); TCHAR **file=(TCHAR **)ccs->lParam; int i; for(i = 0; file[i]; i++) @@ -428,15 +432,6 @@ int onSendFile(WPARAM w, LPARAM l) return CallService(PSS_FILE, w, l); } -void temp_cleaner_thread() -{ - while(true) - { - list<list<file_in_transfer*>::iterator> elements_to_del; - Sleep(10000); - } -} - void storeOutput(HANDLE ahandle, string *output) { BOOL success; |