From 9fdfef02c6c6fd4a8f2c6f10c952c76762ab85a0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 24 Jul 2023 14:10:57 +0300 Subject: fixes #3592 (ICQ: offline transfer isn't marked as completed after file downloading) --- protocols/ICQ-WIM/src/proto.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index 91db22a652..27af8879f2 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -197,13 +197,17 @@ void CIcqProto::OnFileRecv(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq) return; } - int result = _write(fileId, pReply->pData, pReply->dataLength); + int cbWritten = _write(fileId, pReply->pData, pReply->dataLength); _close(fileId); - if (result != pReply->dataLength) { - debugLogW(L"Error writing data into [%s]", ofd->wszPath.c_str()); + if (cbWritten != pReply->dataLength) { + debugLogW(L"Error writing data into [%s]: %d instead of %d", ofd->wszPath.c_str(), cbWritten, pReply->dataLength); return; } + DBVARIANT dbv = { DBVT_DWORD }; + dbv.dVal = cbWritten; + db_event_setJson(ofd->hDbEvent, "ft", &dbv); + ofd->Finish(); delete ofd; } -- cgit v1.2.3