Skip to content

Commit 169ddaf

Browse files
author
Valtteri Heikkila
committed
A variable rename in http_linux.cpp
1 parent 37ebc2e commit 169ddaf

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

Release/src/http/client/http_linux.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ namespace web { namespace http
196196
}
197197
}
198198

199-
std::shared_ptr<linux_connection> m_conn;
199+
std::shared_ptr<linux_connection> m_connection;
200200
std::unique_ptr<boost::asio::ssl::stream<tcp::socket &> > m_ssl_stream;
201201
size_t m_known_size;
202202
size_t m_current_size;
@@ -215,7 +215,7 @@ namespace web { namespace http
215215
m_timedout = true;
216216

217217
boost::system::error_code error;
218-
m_conn->m_socket.cancel(error);
218+
m_connection->m_socket.cancel(error);
219219
if (error)
220220
{
221221
report_error("Failed to cancel the socket", error);
@@ -256,7 +256,7 @@ namespace web { namespace http
256256
{
257257
boost::asio::ssl::context context(boost::asio::ssl::context::sslv23);
258258
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));
260260
}
261261

262262
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
333333

334334
ctx->set_timer(static_cast<int>(client_config().timeout().count()));
335335

336-
if (ctx->m_conn->m_socket.is_open())
336+
if (ctx->m_connection->m_socket.is_open())
337337
{
338338
begin_send(ctx);
339339
}
@@ -388,7 +388,7 @@ namespace web { namespace http
388388
ctx->m_ssl_stream->set_verify_mode(boost::asio::ssl::context::verify_none);
389389
}
390390
}
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));
392392
}
393393
}
394394

@@ -400,7 +400,7 @@ namespace web { namespace http
400400
}
401401
else
402402
{
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));
404404
}
405405
}
406406

@@ -419,16 +419,16 @@ namespace web { namespace http
419419
ctx->m_timeout_timer.cancel();
420420

421421
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();
425425

426426
auto endpoint = *endpoints;
427427
if (ctx->m_ssl_stream)
428428
{
429429
boost::asio::ssl::context context(boost::asio::ssl::context::sslv23);
430430
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));
432432

433433
// Check to turn off server certificate verification.
434434
if(client_config().validate_certificates())
@@ -442,7 +442,7 @@ namespace web { namespace http
442442
}
443443
}
444444

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));
446446
}
447447
}
448448

@@ -507,7 +507,7 @@ namespace web { namespace http
507507
}
508508
else
509509
{
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,
511511
boost::bind(readSize != 0 ? &linux_client::handle_write_chunked_body : &linux_client::handle_write_body,
512512
shared_from_this(), boost::asio::placeholders::error, ctx));
513513
}
@@ -562,7 +562,7 @@ namespace web { namespace http
562562
}
563563
else
564564
{
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,
566566
boost::bind(&linux_client::handle_write_large_body, shared_from_this(), boost::asio::placeholders::error, ctx));
567567
}
568568
});
@@ -615,7 +615,7 @@ namespace web { namespace http
615615
}
616616
else
617617
{
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,
619619
boost::bind(&linux_client::handle_status_line, shared_from_this(), boost::asio::placeholders::error, ctx));
620620
}
621621
}
@@ -657,13 +657,13 @@ namespace web { namespace http
657657
const bool socket_was_closed((boost::asio::error::eof == ec)
658658
|| (boost::asio::error::connection_reset == ec)
659659
|| (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())
661661
{
662662
// Connection was closed by the server for some reason during the connection was
663663
// being pooled. We re-send the request to get a new connection.
664664
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);
667667
ctx->m_close_socket_in_destructor = true;
668668

669669
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
756756
}
757757
else
758758
{
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,
760760
boost::bind(&linux_client::handle_chunk_header, shared_from_this(), boost::asio::placeholders::error, ctx));
761761
}
762762
}
@@ -778,7 +778,7 @@ namespace web { namespace http
778778
}
779779
else
780780
{
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);
782782
}
783783
}
784784

@@ -873,7 +873,7 @@ namespace web { namespace http
873873
}
874874
else
875875
{
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,
877877
boost::bind(&linux_client::handle_chunk_header, shared_from_this(), boost::asio::placeholders::error, ctx));
878878
}
879879
});
@@ -987,7 +987,7 @@ namespace web { namespace http
987987
, m_timedout(false)
988988
, m_current_size(0)
989989
, m_timeout_timer(crossplat::threadpool::shared_instance().service())
990-
, m_conn(connection)
990+
, m_connection(connection)
991991
, m_close_socket_in_destructor(false)
992992
{}
993993

@@ -1007,13 +1007,13 @@ namespace web { namespace http
10071007

10081008
if (m_close_socket_in_destructor)
10091009
{
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);
10121012
}
10131013
else
10141014
{
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);
10171017
}
10181018
}
10191019

0 commit comments

Comments
 (0)