X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/71414756b2cb4d64ee167e61f3fa4854c4f2a85b..d3d0974f0f4ea623b5255db0b70b5e8374bf9d3f:/src/common/http.cpp diff --git a/src/common/http.cpp b/src/common/http.cpp index 4a59548bf3..63e0fb4fb9 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "http.h" #endif @@ -44,6 +44,7 @@ wxHTTP::wxHTTP() m_read = FALSE; m_proxy_mode = FALSE; m_post_buf = wxEmptyString; + m_http_response = 0; SetNotify(wxSOCKET_LOST_FLAG); } @@ -103,7 +104,7 @@ wxString wxHTTP::GetHeader(const wxString& header) const { wxHeaderIterator it = FindHeader(header); - return it == m_headers.end() ? wxEmptyString : it->second; + return it == m_headers.end() ? wxGetEmptyString() : it->second; } void wxHTTP::SetPostBuffer(const wxString& post_buf) @@ -213,6 +214,8 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) return FALSE; } + m_http_response = 0; + // If there is no User-Agent defined, define it. if (GetHeader(wxT("User-Agent")).IsNull()) SetHeader(wxT("User-Agent"), wxT("wxWindows 2.x")); @@ -256,6 +259,8 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) token.NextToken(); tmp_str2 = token.NextToken(); + m_http_response = wxAtoi(tmp_str2); + switch (tmp_str2[0u]) { case wxT('1'): /* INFORMATION / SUCCESS */