Skip to content

Commit bb0bf05

Browse files
committed
Fixing Boost.Asio based http_client to not use client_config timeout value for determining timeout on unused sockets.
1 parent bf8c5a0 commit bb0bf05

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Release/include/cpprest/http_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class http_client_config
8282
public:
8383
http_client_config() :
8484
m_guarantee_order(false),
85-
m_timeout(utility::seconds(30)),
85+
m_timeout(std::chrono::seconds(30)),
8686
m_chunksize(0)
8787
#if !defined(__cplusplus_winrt)
8888
, m_validate_certificates(true)

Release/src/http/client/http_client_asio.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,10 @@ class asio_client : public _http_client_communicator, public std::enable_shared_
305305
{
306306
public:
307307
asio_client(http::uri address, http_client_config client_config)
308-
: _http_client_communicator(std::move(address), client_config)
308+
: _http_client_communicator(std::move(address), std::move(client_config))
309309
, m_pool(crossplat::threadpool::shared_instance().service(),
310310
base_uri().scheme() == "https",
311-
client_config.timeout())
311+
std::chrono::seconds(30)) // Unused sockets are kept in pool for 30 seconds.
312312
, m_resolver(crossplat::threadpool::shared_instance().service())
313313
{}
314314

0 commit comments

Comments
 (0)