backported wxHTTPStream EOF fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-09-10 16:38:50 +00:00
parent 9d7fde109c
commit 259da6c52a
2 changed files with 10 additions and 8 deletions

View File

@@ -185,7 +185,8 @@ All:
- always NUL-terminate the log messages - always NUL-terminate the log messages
- wxRegEx::Compile() now calculates the number of groups correctly - 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) - wxString::find_last_of() ignored "start" parameter (Robert Vazan)
- a bug in wxArrayString::Shrink() fixed (Gunnar Roth) - a bug in wxArrayString::Shrink() fixed (Gunnar Roth)

View File

@@ -291,15 +291,16 @@ protected:
size_t wxHTTPStream::OnSysRead(void *buffer, size_t bufsize) 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) size_t ret = wxSocketInputStream::OnSysRead(buffer, bufsize);
return 0; m_read_bytes += ret;
ret = wxSocketInputStream::OnSysRead(buffer, bufsize); return ret;
m_read_bytes += ret;
return ret;
} }
bool wxHTTP::Abort(void) bool wxHTTP::Abort(void)