diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-04 21:35:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-04 21:35:36 +0300 |
commit | b6d0a372771d1fac2a2276841f6d2bbac22e8552 (patch) | |
tree | 1ffaae12b62cc5f52e668092d464aa061aa8d58e /protocols/FacebookRM/src/communication.cpp | |
parent | 1b89cbba1f3bc00ea24a8414b2e670c582ac5fc4 (diff) |
one more mir_cs
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 8b987063d9..d2ea31ddd1 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -54,6 +54,8 @@ 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 ChannelRequest::NONE: @@ -69,7 +71,7 @@ http::response facebook_client::sendRequest(HttpRequest *request) request->flags |= NLHRF_PERSISTENT; break; case ChannelRequest::DEFAULT: - WaitForSingleObject(fcb_conn_lock_, INFINITE); + s.lock(); request->nlc = hFcbCon; request->flags |= NLHRF_PERSISTENT; break; @@ -91,7 +93,7 @@ http::response facebook_client::sendRequest(HttpRequest *request) hMessagesCon = pnlhr ? pnlhr->nlc : nullptr; break; case ChannelRequest::DEFAULT: - ReleaseMutex(fcb_conn_lock_); + s.unlock(); hFcbCon = pnlhr ? pnlhr->nlc : nullptr; break; } |