]> git.saurik.com Git - wxWidgets.git/commitdiff
fix a bug in EventWorker::DoRead(): if both signature and the size of the incoming...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 1 Jan 2009 23:56:52 +0000 (23:56 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 1 Jan 2009 23:56:52 +0000 (23:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/sockets/baseserver.cpp

index 047327d03c5e93c9c44750a0e52edc2ce90167f5..c74ef2866620fac2a720c81d86a3f2d172cb2e0d 100644 (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();