diff options
author | George Hazan <george.hazan@gmail.com> | 2024-01-09 13:13:23 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-01-09 13:13:23 +0300 |
commit | 110fdc1157d94f5d787a21c60163681767fdd6c4 (patch) | |
tree | 3a401fa5b6d10e397784f4a7aa1cda38beee9fb9 /protocols/JabberG/src | |
parent | 74c01c7fb7862ec01ad27c4b225b08b7aa0f3b0a (diff) |
more strict constructor of MHttpRequest to avoid quirks
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r-- | protocols/JabberG/src/jabber_file.cpp | 9 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_ft.cpp | 3 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_util.cpp | 3 |
3 files changed, 5 insertions, 10 deletions
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<JABBER_HTTP_AVATARS> &avs = *(OBJLIST<JABBER_HTTP_AVATARS>*)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;
|