summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-09 13:13:23 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-09 13:13:23 +0300
commit110fdc1157d94f5d787a21c60163681767fdd6c4 (patch)
tree3a401fa5b6d10e397784f4a7aa1cda38beee9fb9 /src/mir_app
parent74c01c7fb7862ec01ad27c4b225b08b7aa0f3b0a (diff)
more strict constructor of MHttpRequest to avoid quirks
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/MHttpRequest.cpp7
-rw-r--r--src/mir_app/src/mir_app.def2
-rw-r--r--src/mir_app/src/mir_app64.def2
-rw-r--r--src/mir_app/src/netlib_autoproxy.cpp2
-rw-r--r--src/mir_app/src/netlib_openconn.cpp3
-rw-r--r--src/mir_app/src/netlib_websocket.cpp2
6 files changed, 11 insertions, 7 deletions
diff --git a/src/mir_app/src/MHttpRequest.cpp b/src/mir_app/src/MHttpRequest.cpp
index e5dca2f850..d2ba1f0879 100644
--- a/src/mir_app/src/MHttpRequest.cpp
+++ b/src/mir_app/src/MHttpRequest.cpp
@@ -23,7 +23,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-MHttpRequest::MHttpRequest()
+MHttpRequest::MHttpRequest(int _1) :
+ requestType(_1),
+ flags(0),
+ pUserInfo(nullptr),
+ nlc(0),
+ timeout(30000)
{
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index f7ca388bde..81b4f9d53a 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -582,7 +582,7 @@ g_hevSettingChanged @696 NONAME
?MetaRemoveSubHistory@MDatabaseReadonly@@UAGHPAUDBCachedContact@@@Z @704 NONAME
Chat_GetGroup @705
Chat_SetGroup @706
-??0MHttpRequest@@QAE@XZ @708 NONAME
+??0MHttpRequest@@QAE@H@Z @708 NONAME
??1MHttpRequest@@QAE@XZ @709 NONAME
??6@YGPAUMHttpRequest@@PAU0@ABUCHAR_PARAM@@@Z @711 NONAME
??6@YGPAUMHttpRequest@@PAU0@ABUINT_PARAM@@@Z @712 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 6714b366cb..86f013224d 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -582,7 +582,7 @@ g_hevSettingChanged @696 NONAME
?MetaRemoveSubHistory@MDatabaseReadonly@@UEAAHPEAUDBCachedContact@@@Z @704 NONAME
Chat_GetGroup @705
Chat_SetGroup @706
-??0MHttpRequest@@QEAA@XZ @708 NONAME
+??0MHttpRequest@@QEAA@H@Z @708 NONAME
??1MHttpRequest@@QEAA@XZ @709 NONAME
??6@YAPEAUMHttpRequest@@PEAU0@AEBUCHAR_PARAM@@@Z @711 NONAME
??6@YAPEAUMHttpRequest@@PEAU0@AEBUINT_PARAM@@@Z @712 NONAME
diff --git a/src/mir_app/src/netlib_autoproxy.cpp b/src/mir_app/src/netlib_autoproxy.cpp
index afee108825..f030b76f2f 100644
--- a/src/mir_app/src/netlib_autoproxy.cpp
+++ b/src/mir_app/src/netlib_autoproxy.cpp
@@ -52,7 +52,7 @@ static void GetFile(char *szUrl, AUTO_PROXY_SCRIPT_BUFFER &buf)
nlu.toLog = 1;
// initialize the netlib request
- MHttpRequest nlhr;
+ MHttpRequest nlhr(0);
nlhr.flags = NLHRF_HTTP11 | NLHRF_DUMPASTEXT | NLHRF_REDIRECT;
nlhr.m_szUrl = szUrl;
diff --git a/src/mir_app/src/netlib_openconn.cpp b/src/mir_app/src/netlib_openconn.cpp
index 5d2bf20c24..58443d090e 100644
--- a/src/mir_app/src/netlib_openconn.cpp
+++ b/src/mir_app/src/netlib_openconn.cpp
@@ -309,8 +309,7 @@ static bool NetlibInitHttpsConnection(NetlibConnection *nlc)
}
MMemoryChunkStorage storage;
- MHttpRequest nlhrSend;
- nlhrSend.requestType = REQUEST_CONNECT;
+ MHttpRequest nlhrSend(REQUEST_CONNECT);
nlhrSend.flags = NLHRF_DUMPPROXY | NLHRF_HTTP11 | NLHRF_NOPROXY | NLHRF_REDIRECT;
nlhrSend.m_szUrl = szUrl;
diff --git a/src/mir_app/src/netlib_websocket.cpp b/src/mir_app/src/netlib_websocket.cpp
index da2fee6c28..1bd8f2e4cd 100644
--- a/src/mir_app/src/netlib_websocket.cpp
+++ b/src/mir_app/src/netlib_websocket.cpp
@@ -35,7 +35,7 @@ MIR_APP_DLL(MHttpResponse*) WebSocket_Connect(HNETLIBUSER nlu, const char *szHos
if (!mir_strncmp(tmpHost, "wss://", 6))
tmpHost.Delete(0, 6);
- auto *nlr = new MHttpRequest;
+ auto *nlr = new MHttpRequest(0);
nlr->flags = NLHRF_PERSISTENT | NLHRF_HTTP11 | NLHRF_SSL;
nlr->m_szUrl = tmpHost.GetBuffer();
nlr->AddHeader("Accept", "*/*");