diff options
Diffstat (limited to 'protocols/JabberG/src/jabber_file.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_file.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index f39cbbdf32..8bedca6f28 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -27,6 +27,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define JABBER_NETWORK_BUFFER_SIZE 2048
+void __cdecl CJabberProto::FileReceiveHttpThread(filetransfer *ft)
+{
+ NETLIBHTTPREQUEST req = {};
+ req.cbSize = sizeof(req);
+ req.requestType = REQUEST_GET;
+ req.szUrl = ft->httpPath;
+
+ NLHR_PTR pResp(Netlib_HttpTransaction(m_hNetlibUser, &req));
+ if (pResp && pResp->resultCode == 200) {
+ ft->std.currentFileSize = pResp->cbSize;
+ ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft);
+
+ FtReceive(ft, pResp->pData, pResp->cbSize);
+
+ ft->complete();
+ }
+ else ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft);
+
+ delete ft;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
void __cdecl CJabberProto::FileReceiveThread(filetransfer *ft)
{
ThreadData info(this, nullptr);
|