]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/http.cpp
Rework the wxCusor ctor taking wx stock number to provide as many cursors as
[wxWidgets.git] / src / common / http.cpp
index af0512f967ac00ff9d6021a0a2f5d508d488648c..5a185bf899c0a7e8a1e53e8b943fcbfffb74595b 100644 (file)
@@ -75,7 +75,7 @@ wxHTTP::wxHeaderIterator wxHTTP::FindHeader(const wxString& header)
     wxHeaderIterator it = m_headers.begin();
     for ( wxHeaderIterator en = m_headers.end(); it != en; ++it )
     {
-        if ( wxStricmp(it->first, header) == 0 )
+        if ( header.CmpNoCase(it->first) == 0 )
             break;
     }
 
@@ -87,7 +87,7 @@ wxHTTP::wxHeaderConstIterator wxHTTP::FindHeader(const wxString& header) const
     wxHeaderConstIterator it = m_headers.begin();
     for ( wxHeaderConstIterator en = m_headers.end(); it != en; ++it )
     {
-        if ( wxStricmp(it->first, header) == 0 )
+        if ( header.CmpNoCase(it->first) == 0 )
             break;
     }
 
@@ -139,9 +139,9 @@ wxString wxHTTP::GenerateAuthString(const wxString& user, const wxString& pass)
         if (len == 1) {
             buf << wxString::Format(wxT("%c="), base64[(from[0] << 4) & 0x30]);
         } else {
-            buf << wxString::Format(wxT("%c%c"), base64[(from[0] << 4) & 0x30] + ((from[1] >> 4) & 0xf), base64[(from[1] << 2) & 0x3c]);
+            buf << wxString::Format(wxT("%c%c"), base64[((from[0] << 4) & 0x30) | ((from[1] >> 4) & 0xf)], base64[(from[1] << 2) & 0x3c]);
         }
-        buf << wxString::Format(wxT("="));
+        buf << wxT("=");
     }
 
     return buf;
@@ -274,8 +274,8 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
 
     wxString buf;
     buf.Printf(wxT("%s %s HTTP/1.0\r\n"), request, path.c_str());
-    const wxWX2MBbuf pathbuf = wxConvLocal.cWX2MB(buf);
-    Write(pathbuf, strlen(wxMBSTRINGCAST pathbuf));
+    const wxWX2MBbuf pathbuf = buf.mb_str();
+    Write(pathbuf, strlen(pathbuf));
     SendHeaders();
     Write("\r\n", 2);
 
@@ -309,7 +309,7 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
 
     m_http_response = wxAtoi(tmp_str2);
 
-    switch (tmp_str2[0u])
+    switch ( tmp_str2[0u].GetValue() )
     {
         case wxT('1'):
             /* INFORMATION / SUCCESS */
@@ -407,7 +407,7 @@ wxInputStream *wxHTTP::GetInputStream(const wxString& path)
     inp_stream = new wxHTTPStream(this);
 
     if (!GetHeader(wxT("Content-Length")).empty())
-        inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(wxT("Content-Length")));
+        inp_stream->m_httpsize = wxAtoi(GetHeader(wxT("Content-Length")));
     else
         inp_stream->m_httpsize = (size_t)-1;