From a0378c28b877a68d8ef9991ce4b1433b2560d928 Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Garcia Date: Sun, 12 Sep 1999 11:19:35 +0000 Subject: [PATCH] fixed (didn't work at all) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3619 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/sckstrm.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/common/sckstrm.cpp b/src/common/sckstrm.cpp index df93922870..ebb6441a11 100644 --- a/src/common/sckstrm.cpp +++ b/src/common/sckstrm.cpp @@ -47,14 +47,12 @@ size_t wxSocketOutputStream::OnSysWrite(const void *buffer, size_t size) size_t ret; ret = m_o_socket->Write((const char *)buffer, size).LastCount(); - switch (m_o_socket->LastError()) { - case GSOCK_NOERROR: + + if (ret > 0) m_lasterror = wxStream_NOERROR; - break; - default: + else m_lasterror = wxStream_READ_ERR; - break; - } + return ret; } @@ -77,14 +75,12 @@ size_t wxSocketInputStream::OnSysRead(void *buffer, size_t size) size_t ret; ret = m_i_socket->Read((char *)buffer, size).LastCount(); - switch (m_i_socket->LastError()) { - case GSOCK_NOERROR: + + if (ret > 0) m_lasterror = wxStream_NOERROR; - break; - default: - m_lasterror = wxStream_WRITE_ERR; - break; - } + else + m_lasterror = wxStream_READ_ERR; + return ret; }