X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f4ada568223b79c8a5769cc351c36a8e2ccd7841..7482b22003c03f7aa3335aec271b5fcb48e2693d:/src/common/http.cpp diff --git a/src/common/http.cpp b/src/common/http.cpp index 4f90e220e9..80c8bf09e8 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -13,6 +13,16 @@ #pragma implementation "http.h" #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#endif + #include #include #include "wx/string.h" @@ -22,10 +32,6 @@ #include "wx/protocol/http.h" #include "wx/sckstrm.h" -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxHTTP, wxProtocol) IMPLEMENT_PROTOCOL(wxHTTP, "http", "80", TRUE) @@ -46,7 +52,7 @@ wxHTTP::wxHTTP() wxHTTP::~wxHTTP() { // wxString isn't a wxObject - wxNode *node = m_headers.First(); + wxNode *node = m_headers.First(); wxString *string; while (node) { @@ -82,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()); } @@ -91,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->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(); } @@ -158,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;