]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/http.cpp
Fixed problem where corner label was displayed when either row or col label size...
[wxWidgets.git] / src / common / http.cpp
index 9f7e3adabc05cb849a57007b13576f5a373d491a..7d24b92f3ef1c9afbea47f2f7ea17d5b3265b145 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
 
@@ -96,7 +94,7 @@ wxString wxHTTP::GetHeader(const wxString& header)
   wxString upper_header;
 
   upper_header = header.Upper();
-  
+
   node = m_headers.Find(upper_header);
   if (!node)
     return wxEmptyString;
@@ -130,7 +128,13 @@ bool wxHTTP::ParseHeaders()
   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;
@@ -138,13 +142,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);
@@ -197,7 +196,7 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
 
   // 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: