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/NewsAggregator/Src | |
parent | 74c01c7fb7862ec01ad27c4b225b08b7aa0f3b0a (diff) |
more strict constructor of MHttpRequest to avoid quirks
Diffstat (limited to 'protocols/NewsAggregator/Src')
-rw-r--r-- | protocols/NewsAggregator/Src/Utils.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/protocols/NewsAggregator/Src/Utils.cpp b/protocols/NewsAggregator/Src/Utils.cpp index c5f1df5b95..60aec00266 100644 --- a/protocols/NewsAggregator/Src/Utils.cpp +++ b/protocols/NewsAggregator/Src/Utils.cpp @@ -47,10 +47,9 @@ void NetlibUnInit() void GetNewsData(wchar_t *tszUrl, char **szData, MCONTACT hContact, CFeedEditor *pEditDlg) { Netlib_LogfW(hNetlibUser, L"Getting feed data %s.", tszUrl); - MHttpRequest nlhr; // initialize the netlib request - nlhr.requestType = REQUEST_GET; + MHttpRequest nlhr(REQUEST_GET); nlhr.flags = NLHRF_DUMPASTEXT | NLHRF_HTTP11 | NLHRF_REDIRECT; if (wcsstr(tszUrl, L"https://") != nullptr) nlhr.flags |= NLHRF_SSL; @@ -205,8 +204,7 @@ time_t DateToUnixTime(const char *stamp, bool FeedType) bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) { - MHttpRequest nlhr; - nlhr.requestType = REQUEST_GET; + MHttpRequest nlhr(REQUEST_GET); nlhr.flags = NLHRF_DUMPASTEXT | NLHRF_HTTP11; nlhr.m_szUrl = _T2A(tszURL); nlhr.AddHeader("User-Agent", NETLIB_USER_AGENT); |