]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/http.cpp
WX_DECLARE_HASH() macro for type safe hashes
[wxWidgets.git] / src / common / http.cpp
index bd5f2cad8f109b0026d09fdd3c22214a5b806b9b..6997cf0f364588c82d52167edc268f233ec283d3 100644 (file)
 #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
 
@@ -61,6 +59,11 @@ wxHTTP::~wxHTTP()
     delete string;
     node = node->Next();
   }
+
+  if (m_addr) {
+      delete m_addr;
+      m_addr = NULL;
+  }
 }
 
 wxString wxHTTP::GetContentType()
@@ -144,13 +147,8 @@ bool wxHTTP::ParseHeaders()
     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);