@@ -196,7 +196,7 @@ namespace web { namespace http
196
196
}
197
197
}
198
198
199
- std::shared_ptr<linux_connection> m_conn ;
199
+ std::shared_ptr<linux_connection> m_connection ;
200
200
std::unique_ptr<boost::asio::ssl::stream<tcp::socket &> > m_ssl_stream;
201
201
size_t m_known_size;
202
202
size_t m_current_size;
@@ -215,7 +215,7 @@ namespace web { namespace http
215
215
m_timedout = true ;
216
216
217
217
boost::system::error_code error;
218
- m_conn ->m_socket .cancel (error);
218
+ m_connection ->m_socket .cancel (error);
219
219
if (error)
220
220
{
221
221
report_error (" Failed to cancel the socket" , error);
@@ -256,7 +256,7 @@ namespace web { namespace http
256
256
{
257
257
boost::asio::ssl::context context (boost::asio::ssl::context::sslv23);
258
258
context.set_default_verify_paths ();
259
- ctx->m_ssl_stream .reset (new boost::asio::ssl::stream<boost::asio::ip::tcp::socket &>(ctx->m_conn ->m_socket , context));
259
+ ctx->m_ssl_stream .reset (new boost::asio::ssl::stream<boost::asio::ip::tcp::socket &>(ctx->m_connection ->m_socket , context));
260
260
}
261
261
262
262
auto encoded_resource = uri_builder (m_uri).append (ctx->m_request .relative_uri ()).to_uri ().resource ().to_string ();
@@ -333,7 +333,7 @@ namespace web { namespace http
333
333
334
334
ctx->set_timer (static_cast <int >(client_config ().timeout ().count ()));
335
335
336
- if (ctx->m_conn ->m_socket .is_open ())
336
+ if (ctx->m_connection ->m_socket .is_open ())
337
337
{
338
338
begin_send (ctx);
339
339
}
@@ -388,7 +388,7 @@ namespace web { namespace http
388
388
ctx->m_ssl_stream ->set_verify_mode (boost::asio::ssl::context::verify_none);
389
389
}
390
390
}
391
- ctx->m_conn ->m_socket .async_connect (endpoint, boost::bind (&linux_client::handle_connect, shared_from_this (), boost::asio::placeholders::error, ++endpoints, ctx));
391
+ ctx->m_connection ->m_socket .async_connect (endpoint, boost::bind (&linux_client::handle_connect, shared_from_this (), boost::asio::placeholders::error, ++endpoints, ctx));
392
392
}
393
393
}
394
394
@@ -400,7 +400,7 @@ namespace web { namespace http
400
400
}
401
401
else
402
402
{
403
- boost::asio::async_write (ctx->m_conn ->m_socket , ctx->m_body_buf , boost::bind (&linux_client::handle_write_request, shared_from_this (), boost::asio::placeholders::error, ctx));
403
+ boost::asio::async_write (ctx->m_connection ->m_socket , ctx->m_body_buf , boost::bind (&linux_client::handle_write_request, shared_from_this (), boost::asio::placeholders::error, ctx));
404
404
}
405
405
}
406
406
@@ -419,16 +419,16 @@ namespace web { namespace http
419
419
ctx->m_timeout_timer .cancel ();
420
420
421
421
boost::system::error_code error;
422
- ctx->m_conn ->m_socket .shutdown (tcp::socket::shutdown_both, error);
423
- ctx->m_conn ->m_socket .close (error);
424
- ctx->m_conn = m_pool->get ();
422
+ ctx->m_connection ->m_socket .shutdown (tcp::socket::shutdown_both, error);
423
+ ctx->m_connection ->m_socket .close (error);
424
+ ctx->m_connection = m_pool->get ();
425
425
426
426
auto endpoint = *endpoints;
427
427
if (ctx->m_ssl_stream )
428
428
{
429
429
boost::asio::ssl::context context (boost::asio::ssl::context::sslv23);
430
430
context.set_default_verify_paths ();
431
- ctx->m_ssl_stream .reset (new boost::asio::ssl::stream<boost::asio::ip::tcp::socket &>(ctx->m_conn ->m_socket , context));
431
+ ctx->m_ssl_stream .reset (new boost::asio::ssl::stream<boost::asio::ip::tcp::socket &>(ctx->m_connection ->m_socket , context));
432
432
433
433
// Check to turn off server certificate verification.
434
434
if (client_config ().validate_certificates ())
@@ -442,7 +442,7 @@ namespace web { namespace http
442
442
}
443
443
}
444
444
445
- ctx->m_conn ->m_socket .async_connect (endpoint, boost::bind (&linux_client::handle_connect, shared_from_this (), boost::asio::placeholders::error, ++endpoints, ctx));
445
+ ctx->m_connection ->m_socket .async_connect (endpoint, boost::bind (&linux_client::handle_connect, shared_from_this (), boost::asio::placeholders::error, ++endpoints, ctx));
446
446
}
447
447
}
448
448
@@ -507,7 +507,7 @@ namespace web { namespace http
507
507
}
508
508
else
509
509
{
510
- boost::asio::async_write (ctx->m_conn ->m_socket , ctx->m_body_buf ,
510
+ boost::asio::async_write (ctx->m_connection ->m_socket , ctx->m_body_buf ,
511
511
boost::bind (readSize != 0 ? &linux_client::handle_write_chunked_body : &linux_client::handle_write_body,
512
512
shared_from_this (), boost::asio::placeholders::error, ctx));
513
513
}
@@ -562,7 +562,7 @@ namespace web { namespace http
562
562
}
563
563
else
564
564
{
565
- boost::asio::async_write (ctx->m_conn ->m_socket , ctx->m_body_buf ,
565
+ boost::asio::async_write (ctx->m_connection ->m_socket , ctx->m_body_buf ,
566
566
boost::bind (&linux_client::handle_write_large_body, shared_from_this (), boost::asio::placeholders::error, ctx));
567
567
}
568
568
});
@@ -615,7 +615,7 @@ namespace web { namespace http
615
615
}
616
616
else
617
617
{
618
- boost::asio::async_read_until (ctx->m_conn ->m_socket , ctx->m_body_buf , CRLF+CRLF,
618
+ boost::asio::async_read_until (ctx->m_connection ->m_socket , ctx->m_body_buf , CRLF+CRLF,
619
619
boost::bind (&linux_client::handle_status_line, shared_from_this (), boost::asio::placeholders::error, ctx));
620
620
}
621
621
}
@@ -657,13 +657,13 @@ namespace web { namespace http
657
657
const bool socket_was_closed ((boost::asio::error::eof == ec)
658
658
|| (boost::asio::error::connection_reset == ec)
659
659
|| (boost::asio::error::connection_aborted == ec));
660
- if (socket_was_closed && ctx->m_conn ->m_is_reused && ctx->m_conn ->m_socket .is_open ())
660
+ if (socket_was_closed && ctx->m_connection ->m_is_reused && ctx->m_connection ->m_socket .is_open ())
661
661
{
662
662
// Connection was closed by the server for some reason during the connection was
663
663
// being pooled. We re-send the request to get a new connection.
664
664
boost::system::error_code error;
665
- ctx->m_conn ->m_socket .shutdown (tcp::socket::shutdown_both, error);
666
- ctx->m_conn ->m_socket .close (error);
665
+ ctx->m_connection ->m_socket .shutdown (tcp::socket::shutdown_both, error);
666
+ ctx->m_connection ->m_socket .close (error);
667
667
ctx->m_close_socket_in_destructor = true ;
668
668
669
669
auto new_ctx = details::linux_client_request_context::create_request_context (ctx->m_http_client , ctx->m_request );
@@ -756,7 +756,7 @@ namespace web { namespace http
756
756
}
757
757
else
758
758
{
759
- boost::asio::async_read_until (ctx->m_conn ->m_socket , ctx->m_body_buf , CRLF,
759
+ boost::asio::async_read_until (ctx->m_connection ->m_socket , ctx->m_body_buf , CRLF,
760
760
boost::bind (&linux_client::handle_chunk_header, shared_from_this (), boost::asio::placeholders::error, ctx));
761
761
}
762
762
}
@@ -778,7 +778,7 @@ namespace web { namespace http
778
778
}
779
779
else
780
780
{
781
- boost::asio::async_read (ctx->m_conn ->m_socket , ctx->m_body_buf , boost::asio::transfer_at_least (size_to_read), handler);
781
+ boost::asio::async_read (ctx->m_connection ->m_socket , ctx->m_body_buf , boost::asio::transfer_at_least (size_to_read), handler);
782
782
}
783
783
}
784
784
@@ -873,7 +873,7 @@ namespace web { namespace http
873
873
}
874
874
else
875
875
{
876
- boost::asio::async_read_until (ctx->m_conn ->m_socket , ctx->m_body_buf , CRLF,
876
+ boost::asio::async_read_until (ctx->m_connection ->m_socket , ctx->m_body_buf , CRLF,
877
877
boost::bind (&linux_client::handle_chunk_header, shared_from_this (), boost::asio::placeholders::error, ctx));
878
878
}
879
879
});
@@ -987,7 +987,7 @@ namespace web { namespace http
987
987
, m_timedout(false )
988
988
, m_current_size(0 )
989
989
, m_timeout_timer(crossplat::threadpool::shared_instance().service())
990
- , m_conn (connection)
990
+ , m_connection (connection)
991
991
, m_close_socket_in_destructor(false )
992
992
{}
993
993
@@ -1007,13 +1007,13 @@ namespace web { namespace http
1007
1007
1008
1008
if (m_close_socket_in_destructor)
1009
1009
{
1010
- m_conn ->m_socket .shutdown (tcp::socket::shutdown_both, error);
1011
- m_conn ->m_socket .close (error);
1010
+ m_connection ->m_socket .shutdown (tcp::socket::shutdown_both, error);
1011
+ m_connection ->m_socket .close (error);
1012
1012
}
1013
1013
else
1014
1014
{
1015
- m_conn ->m_socket .cancel (error);
1016
- std::static_pointer_cast<linux_client>(m_http_client)->m_pool ->put (m_conn );
1015
+ m_connection ->m_socket .cancel (error);
1016
+ std::static_pointer_cast<linux_client>(m_http_client)->m_pool ->put (m_connection );
1017
1017
}
1018
1018
}
1019
1019
0 commit comments