Skip to content

Commit 9145c24

Browse files
committed
Fix the incorrect reference type on the lambda expression
1 parent 9a8d5d8 commit 9145c24

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Release/include/cpprest/http_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ class http_client_config
327327
/// Sets a callback to enable custom setting of the ssl context, at construction time.
328328
/// </summary>
329329
/// <param name="callback">A user callback allowing for customization of the ssl context at construction time.</param>
330-
void set_ssl_context_callback(std::function<void(boost::asio::ssl::context&)> callback)
330+
void set_ssl_context_callback(const std::function<void(boost::asio::ssl::context&)>& callback)
331331
{
332332
m_ssl_context_callback = callback;
333333
}

Release/include/cpprest/http_listener.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class http_listener_config
146146
/// Set the callback of ssl context
147147
/// </summary>
148148
/// <param name="ssl_context_callback">The function to configure a ssl context which will setup https connections.</param>
149-
void set_ssl_context_callback(std::function<void(boost::asio::ssl::context&)> ssl_context_callback)
149+
void set_ssl_context_callback(const std::function<void(boost::asio::ssl::context&)> &ssl_context_callback)
150150
{
151151
m_ssl_context_callback = ssl_context_callback;
152152
}

Release/src/http/listener/http_server_asio.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,14 +480,14 @@ void connection::async_write(ClassFuncPtr &&connection_func_ptr, const http_resp
480480
{
481481
if (m_ssl_stream)
482482
{
483-
boost::asio::async_write(*m_ssl_stream, m_response_buf, [this, &connection_func_ptr, &response] (const boost::system::error_code& ec, std::size_t)
483+
boost::asio::async_write(*m_ssl_stream, m_response_buf, [=] (const boost::system::error_code& ec, std::size_t)
484484
{
485485
(this->*connection_func_ptr)(response, ec);
486486
});
487487
}
488488
else
489489
{
490-
boost::asio::async_write(*m_socket, m_response_buf, [this, &connection_func_ptr, &response] (const boost::system::error_code& ec, std::size_t)
490+
boost::asio::async_write(*m_socket, m_response_buf, [=] (const boost::system::error_code& ec, std::size_t)
491491
{
492492
(this->*connection_func_ptr)(response, ec);
493493
});

0 commit comments

Comments
 (0)