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:
@@ -598,7 +598,7 @@ EventWorker::DoRead()
|
|||||||
//read message header
|
//read message header
|
||||||
do
|
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->Error())
|
||||||
{
|
{
|
||||||
if (m_socket->LastError() != wxSOCKET_WOULDBLOCK)
|
if (m_socket->LastError() != wxSOCKET_WOULDBLOCK)
|
||||||
@@ -630,7 +630,8 @@ EventWorker::DoRead()
|
|||||||
m_written = 0;
|
m_written = 0;
|
||||||
LogWorker(wxString::Format("Message signature: len: %d, type: %s, size: %d (bytes)",chunks,type == 0xBE ? "b" : "kB",m_size));
|
LogWorker(wxString::Format("Message signature: len: %d, type: %s, size: %d (bytes)",chunks,type == 0xBE ? "b" : "kB",m_size));
|
||||||
break;
|
break;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
LogWorker(wxString::Format("Unknown test type %x",type));
|
LogWorker(wxString::Format("Unknown test type %x",type));
|
||||||
m_socket->Close();
|
m_socket->Close();
|
||||||
|
Reference in New Issue
Block a user