diff --git a/docs/changes.txt b/docs/changes.txt index 6d6f5ee13f..2a653fe2b8 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -185,7 +185,8 @@ All: - always NUL-terminate the log messages - wxRegEx::Compile() now calculates the number of groups correctly -- wxHTTP::GetHeader() didn't find headers which not all in upper case +- wxHTTP::GetHeader() didn't find headers which were not all in upper case +- wxHTTP input stream didn't detect EOF correctly - wxString::find_last_of() ignored "start" parameter (Robert Vazan) - a bug in wxArrayString::Shrink() fixed (Gunnar Roth) diff --git a/src/common/http.cpp b/src/common/http.cpp index 116315075e..ca8a57af2c 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -291,15 +291,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)