From 3cb3883908e3168e5f955be3143771721614307a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 12 Jan 2017 21:27:03 +0300 Subject: Netlib_FreeHttpRequest() instead of MS_NETLIB_FREEHTTPREQUESTSTRUCT --- protocols/Twitter/src/utility.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'protocols/Twitter/src/utility.cpp') diff --git a/protocols/Twitter/src/utility.cpp b/protocols/Twitter/src/utility.cpp index f22e71de5b..6ac208279d 100644 --- a/protocols/Twitter/src/utility.cpp +++ b/protocols/Twitter/src/utility.cpp @@ -111,8 +111,7 @@ http::response mir_twitter::slurp(const std::string &url, http::method meth, OAu req.nlc = httpPOST_; http::response resp_data; ppro_->debugLogA("**SLURP - just before calling HTTPTRANSACTION"); - NETLIBHTTPREQUEST *resp = reinterpret_cast(CallService(MS_NETLIB_HTTPTRANSACTION, - reinterpret_cast(handle_), reinterpret_cast(&req))); + NETLIBHTTPREQUEST *resp = Netlib_HttpTransaction(handle_, &req); ppro_->debugLogA("**SLURP - HTTPTRANSACTION complete."); if (resp) { ppro_->debugLogA("**SLURP - the server has responded!"); @@ -120,7 +119,7 @@ http::response mir_twitter::slurp(const std::string &url, http::method meth, OAu resp_data.code = resp->resultCode; resp_data.data = resp->pData ? resp->pData : ""; - CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp); + Netlib_FreeHttpRequest(resp); } else { httpPOST_ = NULL; @@ -130,16 +129,14 @@ http::response mir_twitter::slurp(const std::string &url, http::method meth, OAu return resp_data; } -bool save_url(HANDLE hNetlib, const std::string &url, const std::wstring &filename) +bool save_url(HNETLIBUSER hNetlib, const std::string &url, const std::wstring &filename) { NETLIBHTTPREQUEST req = { sizeof(req) }; req.requestType = REQUEST_GET; req.flags = NLHRF_HTTP11 | NLHRF_REDIRECT; req.szUrl = const_cast(url.c_str()); - NETLIBHTTPREQUEST *resp = reinterpret_cast(CallService(MS_NETLIB_HTTPTRANSACTION, - reinterpret_cast(hNetlib), reinterpret_cast(&req))); - + NETLIBHTTPREQUEST *resp = Netlib_HttpTransaction(hNetlib, &req); if (resp) { bool success = (resp->resultCode == 200); if (success) { @@ -154,7 +151,7 @@ bool save_url(HANDLE hNetlib, const std::string &url, const std::wstring &filena fclose(f); } - CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp); + Netlib_FreeHttpRequest(resp); return success; } -- cgit v1.2.3