From 110fdc1157d94f5d787a21c60163681767fdd6c4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 9 Jan 2024 13:13:23 +0300 Subject: more strict constructor of MHttpRequest to avoid quirks --- protocols/JabberG/src/jabber_file.cpp | 9 +++------ protocols/JabberG/src/jabber_ft.cpp | 3 +-- protocols/JabberG/src/jabber_util.cpp | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index f58d6a3a46..616a629c59 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -49,8 +49,7 @@ void __cdecl CJabberProto::OfflineFileThread(OFDTHREAD *ofd) } // initialize the netlib request - MHttpRequest nlhr; - nlhr.requestType = REQUEST_GET; + MHttpRequest nlhr(REQUEST_GET); nlhr.flags = NLHRF_HTTP11 | NLHRF_DUMPASTEXT | NLHRF_REDIRECT; nlhr.m_szUrl = url; @@ -127,8 +126,7 @@ void CJabberProto::OnReceiveOfflineFile(DB::FILE_BLOB &blob, void *pHandle) void __cdecl CJabberProto::FileReceiveHttpThread(filetransfer *ft) { - MHttpRequest req; - req.requestType = REQUEST_GET; + MHttpRequest req(REQUEST_GET); req.m_szUrl = ft->httpPath; NLHR_PTR pResp(Netlib_HttpTransaction(m_hNetlibUser, &req)); @@ -154,8 +152,7 @@ void CJabberProto::FileProcessHttpDownload(MCONTACT hContact, const char *jid, c szName.AppendChar(*b++); auto *pszName = szName.c_str(); - MHttpRequest req; - req.requestType = REQUEST_HEAD; + MHttpRequest req(REQUEST_HEAD); req.m_szUrl = pszUrl; filetransfer *ft = new filetransfer(this, 0); diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index 752ab550a9..f4f088daa6 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -691,8 +691,7 @@ LBL_Fail: if (!szUrl) goto LBL_Fail; - MHttpRequest nlhr; - nlhr.requestType = REQUEST_PUT; + MHttpRequest nlhr(REQUEST_PUT); nlhr.flags = NLHRF_NODUMPSEND | NLHRF_SSL | NLHRF_REDIRECT; nlhr.m_szUrl = szUrl; diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 2f0ba8fa34..1f750bc08c 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -881,8 +881,7 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param) OBJLIST &avs = *(OBJLIST*)param; HNETLIBCONN hHttpCon = nullptr; for (auto &it : avs) { - MHttpRequest nlhr; - nlhr.requestType = REQUEST_GET; + MHttpRequest nlhr(REQUEST_GET); nlhr.flags = NLHRF_HTTP11 | NLHRF_REDIRECT | NLHRF_PERSISTENT; nlhr.m_szUrl = it->Url; nlhr.nlc = hHttpCon; -- cgit v1.2.3