diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-17 16:26:35 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-17 16:26:35 +0300 |
commit | bec09dbab4b07281f3da8478618deb9c10aa0a29 (patch) | |
tree | bc73ac00fbc2e4c04665163efd1bcf7d0ef722b8 /protocols/FacebookRM/src/communication.cpp | |
parent | 3e05d92dcb5f6c2017bc462554901ba27816bdb4 (diff) |
Facebook: unstable server connection makes persistent connections crazy
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index c8f0f4572a..ee1049079f 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -54,50 +54,11 @@ http::response facebook_client::sendRequest(HttpRequest *request) if (request->requestType == REQUEST_POST) request->Headers << CHAR_PARAM("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); - mir_cslockfull s(fcb_conn_lock_); s.unlock(); - - // Set persistent connection (or not) - switch (request->Persistent) { - case HttpRequest::PersistentType::NONE: - request->nlc = nullptr; - request->flags &= ~NLHRF_PERSISTENT; - break; - case HttpRequest::PersistentType::CHANNEL: - request->nlc = hChannelCon; - request->flags |= NLHRF_PERSISTENT; - break; - case HttpRequest::PersistentType::MESSAGES: - request->nlc = hMessagesCon; - request->flags |= NLHRF_PERSISTENT; - break; - case HttpRequest::PersistentType::DEFAULT: - s.lock(); - request->nlc = hFcbCon; - request->flags |= NLHRF_PERSISTENT; - break; - } - parent->debugLogA("@@@ Sending request to '%s'", request->szUrl); // Send the request NETLIBHTTPREQUEST *pnlhr = request->Send(handle_); - // Remember the persistent connection handle (or not) - switch (request->Persistent) { - case HttpRequest::PersistentType::NONE: - break; - case HttpRequest::PersistentType::CHANNEL: - hChannelCon = pnlhr ? pnlhr->nlc : nullptr; - break; - case HttpRequest::PersistentType::MESSAGES: - hMessagesCon = pnlhr ? pnlhr->nlc : nullptr; - break; - case HttpRequest::PersistentType::DEFAULT: - s.unlock(); - hFcbCon = pnlhr ? pnlhr->nlc : nullptr; - break; - } - // Check and copy response data if (pnlhr != nullptr) { parent->debugLogA("@@@ Got response with code %d", pnlhr->resultCode); @@ -1138,7 +1099,7 @@ bool facebook_client::save_url(const std::string &url, const std::wstring &filen NETLIBHTTPREQUEST req = { sizeof(req) }; req.requestType = REQUEST_GET; req.szUrl = const_cast<char*>(url.c_str()); - req.flags = NLHRF_HTTP11 | NLHRF_REDIRECT | NLHRF_PERSISTENT | NLHRF_NODUMP; + req.flags = NLHRF_HTTP11 | NLHRF_REDIRECT | NLHRF_NODUMP; req.nlc = nlc; bool ret = false; |