From bec09dbab4b07281f3da8478618deb9c10aa0a29 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 17 Apr 2018 16:26:35 +0300 Subject: Facebook: unstable server connection makes persistent connections crazy --- protocols/FacebookRM/src/communication.cpp | 41 +----------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'protocols/FacebookRM/src/communication.cpp') 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(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; -- cgit v1.2.3