(http client) fix deadlock when following redirects

This commit is contained in:
Benjamin Sergeant 2020-06-19 00:11:06 -07:00
parent 9bb3643fc7
commit 10c014bf98
4 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,10 @@
# Changelog # Changelog
All changes to this project will be documented in this file. All changes to this project will be documented in this file.
## [9.7.9] - 2020-06-18
(http client) fix deadlock when following redirects
## [9.7.8] - 2020-06-18 ## [9.7.8] - 2020-06-18
(cobra metrics to statsd bot) send info about net requests (cobra metrics to statsd bot) send info about net requests

View File

@ -127,7 +127,7 @@ namespace ix
{ {
// We only have one socket connection, so we cannot // We only have one socket connection, so we cannot
// make multiple requests concurrently. // make multiple requests concurrently.
std::lock_guard<std::mutex> lock(_mutex); std::lock_guard<std::recursive_mutex> lock(_mutex);
uint64_t uploadSize = 0; uint64_t uploadSize = 0;
uint64_t downloadSize = 0; uint64_t downloadSize = 0;

View File

@ -103,7 +103,9 @@ namespace ix
std::thread _thread; std::thread _thread;
std::unique_ptr<Socket> _socket; std::unique_ptr<Socket> _socket;
std::mutex _mutex; // to protect accessing the _socket (only one socket per client) std::recursive_mutex _mutex; // to protect accessing the _socket (only one socket per client)
// the mutex needs to be recursive as this function might
// be called recursively to follow HTTP redirections
SocketTLSOptions _tlsOptions; SocketTLSOptions _tlsOptions;

View File

@ -6,4 +6,4 @@
#pragma once #pragma once
#define IX_WEBSOCKET_VERSION "9.7.8" #define IX_WEBSOCKET_VERSION "9.7.9"