diff options
Diffstat (limited to 'plugins/Dropbox/src/dropbox_transfers.cpp')
-rw-r--r-- | plugins/Dropbox/src/dropbox_transfers.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/Dropbox/src/dropbox_transfers.cpp b/plugins/Dropbox/src/dropbox_transfers.cpp index b658731249..e1fe957b05 100644 --- a/plugins/Dropbox/src/dropbox_transfers.cpp +++ b/plugins/Dropbox/src/dropbox_transfers.cpp @@ -144,31 +144,31 @@ UINT CDropbox::SendFilesAsync(void *owner, void *arg) char *data = (char*)mir_alloc(chunkSize);
while (!feof(hFile) && fileSize != offset)
{
- if (ferror(hFile))
- throw TransferException("Error while file sending");
+ try
+ {
+ if (ferror(hFile))
+ throw TransferException("Error while file sending");
- if (ftp->isTerminated)
- throw TransferException("Transfer was terminated");
+ if (ftp->isTerminated)
+ throw TransferException("Transfer was terminated");
- size_t size = fread(data, sizeof(char), chunkSize, hFile);
+ size_t size = fread(data, sizeof(char), chunkSize, hFile);
- try
- {
if (offset == 0)
instance->SendFileChunkedFirst(data, size, uploadId, offset);
else
instance->SendFileChunkedNext(data, size, uploadId, offset);
+
+ ftp->pfts.currentFileProgress += size;
+ ftp->pfts.totalProgress += size;
}
- catch (TransferException)
+ catch (TransferException&)
{
mir_free(data);
fclose(hFile);
throw;
}
- ftp->pfts.currentFileProgress += size;
- ftp->pfts.totalProgress += size;
-
ProtoBroadcastAck(MODULE, ftp->pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ftp->hProcess, (LPARAM)&ftp->pfts);
}
mir_free(data);
|