]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/http.cpp
Unicode compilation fix
[wxWidgets.git] / src / common / http.cpp
index db4eeb851f7fada7e3dabcdcdd6106fd4b48f4d0..52f6e362c748fde47da55555d1aad5eee0f14425 100644 (file)
@@ -299,7 +299,8 @@ bool wxHTTP::Abort(void)
 
 wxInputStream *wxHTTP::GetInputStream(const wxString& path)
 {
 
 wxInputStream *wxHTTP::GetInputStream(const wxString& path)
 {
-  wxHTTPStream *inp_stream = new wxHTTPStream(this);
+  wxHTTPStream *inp_stream;
+
   wxString new_path;
 
   m_perr = wxPROTO_CONNERR;
   wxString new_path;
 
   m_perr = wxPROTO_CONNERR;
@@ -307,12 +308,22 @@ wxInputStream *wxHTTP::GetInputStream(const wxString& path)
     return NULL;
 
   // We set m_connected back to FALSE so wxSocketBase will know what to do.
     return NULL;
 
   // We set m_connected back to FALSE so wxSocketBase will know what to do.
+#ifdef __WXMAC__
+        wxSocketClient::Connect(*m_addr , FALSE );
+        wxSocketClient::WaitOnConnect(10);
+
+    if (!wxSocketClient::IsConnected())
+        return NULL;
+#else
   if (!wxProtocol::Connect(*m_addr))
     return NULL;
   if (!wxProtocol::Connect(*m_addr))
     return NULL;
+#endif
 
   if (!BuildRequest(path, wxHTTP_GET))
     return NULL;
 
 
   if (!BuildRequest(path, wxHTTP_GET))
     return NULL;
 
+  inp_stream = new wxHTTPStream(this);
+
   if (!GetHeader(wxT("Content-Length")).IsEmpty())
     inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(wxT("Content-Length")));
   else
   if (!GetHeader(wxT("Content-Length")).IsEmpty())
     inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(wxT("Content-Length")));
   else