- wxPrintf(_T("Len = %s\n"), WXSTRINGCAST GetHeader(_T("Content-Length")));
- if (!GetHeader(_T("Content-Length")).IsEmpty())
- inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(_T("Content-Length")));
+ inp_stream = new wxHTTPStream(this);
+
+ if (!GetHeader(wxT("Content-Length")).IsEmpty())
+ inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(wxT("Content-Length")));
+ else
+ inp_stream->m_httpsize = (size_t)-1;
+
+ inp_stream->m_read_bytes = 0;
+
+ Notify(FALSE);
+ SetFlags(wxSOCKET_BLOCK | wxSOCKET_WAITALL);