try to receive remanining message

This commit is contained in:
orignal 2015-03-27 14:58:26 -04:00
parent 8c174cd548
commit 3e59535a53

12
SAM.cpp
View File

@ -228,20 +228,22 @@ namespace client
}
else
{
LogPrint ("SAM unexpected message ", m_Buffer);
LogPrint (eLogError, "SAM unexpected message ", m_Buffer);
Terminate ();
}
}
else
{
LogPrint ("SAM malformed message ", m_Buffer);
LogPrint (eLogError, "SAM malformed message ", m_Buffer);
Terminate ();
}
}
else
{
LogPrint ("SAM malformed message ", m_Buffer);
Terminate ();
LogPrint (eLogWarning, "SAM incomplete message ", m_Buffer);
m_BufferOffset = bytes_transferred;
// try to receive remaining message
Receive ();
}
}
}
@ -422,7 +424,7 @@ namespace client
}
else
{
LogPrint (eLogWarning, "SAM sent datagram size ", size, " exceeds buffer");
LogPrint (eLogWarning, "SAM sent datagram size ", size, " exceeds buffer ", len - offset);
return 0; // try to receive more
}
return offset + size;