mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
http: check for cb in async_read_until
This commit is contained in:
1 parent
3e407e65fa
commit
405220795b
1 file changed
+1
-1
+1
-1
@@ -604,7 +604,7 @@ Connection::async_read_until(const char* delim, BytesHandlerCb cb)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
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;
|
||||
}
|
||||
if (ssl_socket_) asio::async_read_until(*ssl_socket_, read_buf_, delim, wrapCallback(std::move(cb)));
|
||||
|
||||
Reference in new issue
Block a user