fix a bug in EventWorker::DoRead(): if both signature and the size of the incoming data were not received during the same read, the signature byte was lost and overwritten by size during the next read

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2009-01-01 23:56:52 +00:00
parent c3bcb48f26
commit 0f359e5ccf

View File

@ -598,7 +598,7 @@ EventWorker::DoRead()
//read message header
do
{
m_socket->Read(m_signature,2 - m_infill);
m_socket->Read(m_signature + m_infill, 2 - m_infill);
if (m_socket->Error())
{
if (m_socket->LastError() != wxSOCKET_WOULDBLOCK)
@ -630,7 +630,8 @@ EventWorker::DoRead()
m_written = 0;
LogWorker(wxString::Format("Message signature: len: %d, type: %s, size: %d (bytes)",chunks,type == 0xBE ? "b" : "kB",m_size));
break;
} else
}
else
{
LogWorker(wxString::Format("Unknown test type %x",type));
m_socket->Close();