diff options
author | George Hazan <george.hazan@gmail.com> | 2024-01-05 15:54:03 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-01-05 15:54:03 +0300 |
commit | 14c4e44a0a91e1ad701d4ae3c58185d25118e64e (patch) | |
tree | 50f36035466f355c74373e757bc00b6610ce6267 /protocols/WebView/src | |
parent | 94667140aeb3886d22e4c1301423fe99aaf3fba4 (diff) |
Netlib:
- NETLIBHTTPHEADER & NETLIBHTTPREQUEST obsoleted;
- NETLIBHTTPREQUEST divided into MHttpRequest & MHttpResponse;
- MHttpHeaders now manager headers both for MHttpRequest & MHttpResponse;
Diffstat (limited to 'protocols/WebView/src')
-rw-r--r-- | protocols/WebView/src/webview_getdata.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/protocols/WebView/src/webview_getdata.cpp b/protocols/WebView/src/webview_getdata.cpp index ae29e134ef..babfe3cca8 100644 --- a/protocols/WebView/src/webview_getdata.cpp +++ b/protocols/WebView/src/webview_getdata.cpp @@ -104,20 +104,12 @@ void GetData(void *param) if (mir_strlen(url) < 3) WErrorPopup(hContact, TranslateT("URL not supplied")); - NETLIBHTTPREQUEST nlhr = { sizeof(nlhr) }; + MHttpRequest nlhr; nlhr.requestType = REQUEST_GET; nlhr.flags = NLHRF_DUMPASTEXT; - nlhr.szUrl = url; - nlhr.headersCount = 2; - - NETLIBHTTPHEADER headers[2]; - headers[0].szName = "User-Agent"; - headers[0].szValue = NETLIB_USER_AGENT; - - headers[1].szName = "Content-Length"; - headers[1].szValue = nullptr; - - nlhr.headers = headers; + nlhr.m_szUrl = url; + nlhr.AddHeader("User-Agent", NETLIB_USER_AGENT); + nlhr.AddHeader("Content-Length", nullptr); if ( g_plugin.getByte(NO_PROTECT_KEY, 0)) // disable AlreadyDownloading = 0; @@ -144,10 +136,10 @@ void GetData(void *param) WErrorPopup(hContact, statusText); db_set_ws(hContact, "CList", "StatusMsg", statusText); } - if (nlhrReply->dataLength) { + if (nlhrReply->body.GetLength()) { trunccount = 0; - downloadsize = (ULONG)mir_strlen(nlhrReply->pData); - strncpy_s(truncated2, nlhrReply->pData, _TRUNCATE); + downloadsize = nlhrReply->body.GetLength(); + strncpy_s(truncated2, nlhrReply->body, _TRUNCATE); AlreadyDownloading = 1; } // END DATELENGTH } // END REPLY |