X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f3d0213e5b79d503f73c67ef9b918a5a89ec45e9..6270539bcf24f2ec32150a09f8aad383f5de0671:/src/common/http.cpp?ds=sidebyside diff --git a/src/common/http.cpp b/src/common/http.cpp index cc6ea854b9..600cef4d47 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -9,10 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "http.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -146,13 +142,7 @@ bool wxHTTP::ParseHeaders() ClearHeaders(); m_read = true; -#if defined(__VISAGECPP__) -// VA just can't stand while(1) - bool bOs2var = true; - while(bOs2var) -#else - while (1) -#endif + for ( ;; ) { m_perr = ReadLine(this, line); if (m_perr != wxPROTO_NOERR) @@ -335,6 +325,15 @@ size_t wxHTTPStream::OnSysRead(void *buffer, size_t bufsize) size_t ret = wxSocketInputStream::OnSysRead(buffer, bufsize); m_read_bytes += ret; + if (m_httpsize==(size_t)-1 && m_lasterror == wxSTREAM_READ_ERROR ) + { + // if m_httpsize is (size_t) -1 this means read until connection closed + // which is equivalent to getting a READ_ERROR, for clients however this + // must be translated into EOF, as it is the expected way of signalling + // end end of the content + m_lasterror = wxSTREAM_EOF ; + } + return ret; }