Fixes to Overlay:

* Make ~Peer virtual
* Call close in ConnectAttempt::stop
* Handle nullptr return in new_outbound_slot
* Check gracefulClose_ in read loop
This commit is contained in:
Vinnie Falco
2015-01-20 14:34:52 -08:00
parent a470dda4e6
commit 40e138627b
5 changed files with 23 additions and 14 deletions

View File

@@ -636,12 +636,12 @@ PeerImp::onReadMessage (error_code ec, std::size_t bytes_transferred)
return fail("onReadMessage", ec);
if (! stream_.next_layer().is_open())
return;
if(gracefulClose_)
return;
if (bytes_consumed == 0)
break;
read_buffer_.consume (bytes_consumed);
}
if(gracefulClose_)
return;
// Timeout on writes only
stream_.async_read_some (read_buffer_.prepare (Tuning::readBufferBytes),
strand_.wrap (std::bind (&PeerImp::onReadMessage,