X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1d4dd7add411ebff1ce4a8d1d992e0e43ee26b1..a6ab05be988523913fb6bdcb33238c83129f80ee:/src/common/http.cpp diff --git a/src/common/http.cpp b/src/common/http.cpp index 81318deed8..07076be381 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -6,7 +6,7 @@ // Created: August 1997 // RCS-ID: $Id$ // Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -293,15 +293,16 @@ protected: size_t wxHTTPStream::OnSysRead(void *buffer, size_t bufsize) { - size_t ret; + if (m_httpsize > 0 && m_read_bytes >= m_httpsize) + { + m_lasterror = wxSTREAM_EOF; + return 0; + } - if (m_httpsize > 0 && m_read_bytes >= m_httpsize) - return 0; + size_t ret = wxSocketInputStream::OnSysRead(buffer, bufsize); + m_read_bytes += ret; - ret = wxSocketInputStream::OnSysRead(buffer, bufsize); - m_read_bytes += ret; - - return ret; + return ret; } bool wxHTTP::Abort(void)