Browse Source

allocated bigger buffer for remaining data

pull/766/head
orignal 8 years ago
parent
commit
1aae921ce7
  1. 7
      NTCPSession.cpp

7
NTCPSession.cpp

@ -538,6 +538,13 @@ namespace transport @@ -538,6 +538,13 @@ namespace transport
moreBuf = buf;
}
moreBytes = m_Socket.read_some (boost::asio::buffer (moreBuf + m_ReceiveBufferOffset, moreBytes), ec);
if (ec)
{
LogPrint (eLogInfo, "NTCP: Read more bytes error: ", ec.message ());
delete[] buf;
Terminate ();
return;
}
m_ReceiveBufferOffset += moreBytes;
m_NumReceivedBytes += moreBytes;
i2p::transport::transports.UpdateReceivedBytes (moreBytes);

Loading…
Cancel
Save