mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
read reamaining data from closed stream
This commit is contained in:
parent
bbe403fb40
commit
64df22def8
2 changed files with 9 additions and 7 deletions
|
@ -100,7 +100,8 @@ namespace stream
|
|||
|
||||
template<typename Buffer, typename ReceiveHandler>
|
||||
void AsyncReceive (const Buffer& buffer, ReceiveHandler handler, int timeout = 0);
|
||||
|
||||
size_t ReadSome (uint8_t * buf, size_t len) { return ConcatenatePackets (buf, len); };
|
||||
|
||||
void Close ();
|
||||
void Cancel () { m_ReceiveTimer.cancel (); };
|
||||
|
||||
|
@ -225,7 +226,7 @@ namespace stream
|
|||
else
|
||||
// socket closed
|
||||
handler (m_IsReset ? boost::asio::error::make_error_code (boost::asio::error::connection_reset) :
|
||||
boost::asio::error::make_error_code (boost::asio::error::operation_aborted), 0);
|
||||
boost::asio::error::make_error_code (boost::asio::error::operation_aborted), received);
|
||||
}
|
||||
else
|
||||
// timeout expired
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue