#include "wx/protocol/http.h"
#include "wx/sckstrm.h"
-#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxHTTP, wxProtocol)
IMPLEMENT_PROTOCOL(wxHTTP, wxT("http"), wxT("80"), TRUE)
-#endif
#define HTTP_BSIZE 2048
delete string;
node = node->Next();
}
+
+ if (m_addr) {
+ delete m_addr;
+ m_addr = NULL;
+ }
}
wxString wxHTTP::GetContentType()
wxString upper_header;
upper_header = header.Upper();
-
+
node = m_headers.Find(upper_header);
if (!node)
return wxEmptyString;
m_headers.Clear();
m_read = TRUE;
- while (1) {
+#if defined(__VISAGECPP__)
+// VA just can't stand while(1)
+ bool bOs2var = TRUE;
+ while(bOs2var) {
+#else
+ while (1) {
+#endif
m_perr = GetLine(this, line);
if (m_perr != wxPROTO_NOERR)
return FALSE;
if (line.Length() == 0)
break;
- tokenzr.SetString(line, " :\t\n\r");
- if (!tokenzr.HasMoreTokens())
- return FALSE;
-
- wxString left_str = tokenzr.GetNextToken();
- wxString *str = new wxString(tokenzr.GetNextToken());
-
+ wxString left_str = line.BeforeFirst(':');
+ wxString *str = new wxString(line.AfterFirst(':').Strip(wxString::both));
left_str.MakeUpper();
m_headers.Append(left_str, (wxObject *) str);
// If there is no User-Agent defined, define it.
if (GetHeader(wxT("User-Agent")).IsNull())
- SetHeader(wxT("User-Agent"), wxT("wxWindows 2.x"));
+ SetHeader(wxT("User-Agent"), wxT("wxWindows 2.x"));
switch (req) {
case wxHTTP_GET: