summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-09 17:15:35 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-09 17:15:35 +0300
commitb1d3f67c4d915cf20fc225c26525dd5686d9562f (patch)
tree4b602765ec8b4e7d447f9758ab0d80b62d253c67 /src/mir_app
parentbb9dce4b057d4533f2f8a0c8f5f899790685deff (diff)
implements #3946 for ICQ
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/netlib.h3
-rw-r--r--src/mir_app/src/netlib_http.cpp5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/mir_app/src/netlib.h b/src/mir_app/src/netlib.h
index 0a764c5f0f..5f8f35bf0c 100644
--- a/src/mir_app/src/netlib.h
+++ b/src/mir_app/src/netlib.h
@@ -92,7 +92,8 @@ public:
class MFileChunkStorage : public MChunkHandler
{
- int fileId, prevBlocks = 0;
+ int fileId;
+ size_t prevBlocks = 0;
pfnDownloadCallback pCallback;
void *pCallbackInfo;
diff --git a/src/mir_app/src/netlib_http.cpp b/src/mir_app/src/netlib_http.cpp
index 69946a0c8a..de0a5255cd 100644
--- a/src/mir_app/src/netlib_http.cpp
+++ b/src/mir_app/src/netlib_http.cpp
@@ -1157,10 +1157,11 @@ bool MFileChunkStorage::updateChunk(const void *pData, size_t cbLen)
}
if (pCallback) {
- int nBlocks = _filelength(fileId) / 65536;
+ size_t iProgress = _filelength(fileId);
+ size_t nBlocks = iProgress / 65536;
if (nBlocks != prevBlocks) {
prevBlocks = nBlocks;
- pCallback(pCallbackInfo);
+ pCallback(iProgress, pCallbackInfo);
}
}
return true;