X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f01991fade3cea8a2caeea87df2afe654592616..7f42cff13eaba35dda3527b2ca658dd00b9e7a46:/src/common/http.cpp?ds=sidebyside diff --git a/src/common/http.cpp b/src/common/http.cpp index c23a400894..80c8bf09e8 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -88,7 +88,7 @@ wxString wxHTTP::GetHeader(const wxString& header) { wxNode *node = m_headers.Find(header); if (!node) - return (char *)NULL; + return wxEmptyString; return *((wxString *)node->Data()); } @@ -97,12 +97,14 @@ void wxHTTP::SendHeaders() { wxNode *head = m_headers.First(); - while (head) { + while (head) + { wxString *str = (wxString *)head->Data(); - char buf[100]; - sprintf(buf, "%s: %s\n\r", head->GetKeyString()/*key.string*/, str->GetData()); - Write(buf, strlen(buf)); + wxString buf; + buf.Printf("%s: %s\n\r", head->GetKeyString(), str->GetData()); + + Write(buf, buf.Len()); head = head->Next(); } @@ -164,7 +166,7 @@ bool wxHTTP::Connect(const wxString& host) return TRUE; } -bool wxHTTP::Connect(wxSockAddress& addr) +bool wxHTTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait)) { struct sockaddr *raw_addr; size_t len;