Skip to content
Snippets Groups Projects
Commit 40522079 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

http: check for cb in async_read_until

parent 3e407e65
Branches
Tags
No related merge requests found
...@@ -604,7 +604,7 @@ Connection::async_read_until(const char* delim, BytesHandlerCb cb) ...@@ -604,7 +604,7 @@ Connection::async_read_until(const char* delim, BytesHandlerCb cb)
{ {
std::lock_guard<std::mutex> lock(mutex_); std::lock_guard<std::mutex> lock(mutex_);
if (!is_open()) { if (!is_open()) {
asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); }); if (cb) asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
return; return;
} }
if (ssl_socket_) asio::async_read_until(*ssl_socket_, read_buf_, delim, wrapCallback(std::move(cb))); if (ssl_socket_) asio::async_read_until(*ssl_socket_, read_buf_, delim, wrapCallback(std::move(cb)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment