mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-24 01:46:36 +02:00
don't throw exception
This commit is contained in:
parent
97ec65cccd
commit
10b733d215
2 changed files with 4 additions and 3 deletions
|
@ -519,12 +519,12 @@ namespace transport
|
||||||
// try to read more
|
// try to read more
|
||||||
if (numReloads < 5)
|
if (numReloads < 5)
|
||||||
{
|
{
|
||||||
size_t moreBytes = m_Socket.available();
|
boost::system::error_code ec;
|
||||||
|
size_t moreBytes = m_Socket.available(ec);
|
||||||
if (moreBytes)
|
if (moreBytes)
|
||||||
{
|
{
|
||||||
if (moreBytes > NTCP_BUFFER_SIZE - m_ReceiveBufferOffset)
|
if (moreBytes > NTCP_BUFFER_SIZE - m_ReceiveBufferOffset)
|
||||||
moreBytes = NTCP_BUFFER_SIZE - m_ReceiveBufferOffset;
|
moreBytes = NTCP_BUFFER_SIZE - m_ReceiveBufferOffset;
|
||||||
boost::system::error_code ec;
|
|
||||||
moreBytes = m_Socket.read_some (boost::asio::buffer (m_ReceiveBuffer + m_ReceiveBufferOffset, moreBytes));
|
moreBytes = m_Socket.read_some (boost::asio::buffer (m_ReceiveBuffer + m_ReceiveBufferOffset, moreBytes));
|
||||||
if (ec)
|
if (ec)
|
||||||
{
|
{
|
||||||
|
|
3
SSU.cpp
3
SSU.cpp
|
@ -163,7 +163,8 @@ namespace transport
|
||||||
std::vector<SSUPacket *> packets;
|
std::vector<SSUPacket *> packets;
|
||||||
packets.push_back (packet);
|
packets.push_back (packet);
|
||||||
|
|
||||||
size_t moreBytes = m_Socket.available();
|
boost::system::error_code ec;
|
||||||
|
size_t moreBytes = m_Socket.available(ec);
|
||||||
while (moreBytes && packets.size () < 25)
|
while (moreBytes && packets.size () < 25)
|
||||||
{
|
{
|
||||||
packet = new SSUPacket ();
|
packet = new SSUPacket ();
|
||||||
|
|
Loading…
Add table
Reference in a new issue