X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f92f546c44e5d59a69c0d5a716ee3100d34e3192..a949e8fac2666418b2a6eb15e94959563cf8aad6:/src/common/url.cpp diff --git a/src/common/url.cpp b/src/common/url.cpp index eae17c35ca..16e2689e9a 100644 --- a/src/common/url.cpp +++ b/src/common/url.cpp @@ -20,8 +20,7 @@ #pragma hdrstop #endif -#include -#include +#if wxUSE_URL #include "wx/string.h" #include "wx/list.h" @@ -29,6 +28,9 @@ #include "wx/module.h" #include "wx/url.h" +#include +#include + IMPLEMENT_CLASS(wxProtoInfo, wxObject) IMPLEMENT_CLASS(wxURL, wxObject) @@ -36,11 +38,12 @@ IMPLEMENT_CLASS(wxURL, wxObject) wxProtoInfo *wxURL::ms_protocols = NULL; // Enforce linking of protocol classes: -USE_PROTOCOL(wxHTTP) -USE_PROTOCOL(wxFTP) USE_PROTOCOL(wxFileProto) #if wxUSE_SOCKETS +USE_PROTOCOL(wxHTTP) +USE_PROTOCOL(wxFTP) + wxHTTP *wxURL::ms_proxyDefault = NULL; bool wxURL::ms_useDefaultProxy = FALSE; #endif @@ -62,7 +65,7 @@ wxURL::wxURL(const wxString& url) #if wxUSE_SOCKETS if ( ms_useDefaultProxy && !ms_proxyDefault ) { - SetDefaultProxy(getenv("HTTP_PROXY")); + SetDefaultProxy( wxGetenv(wxT("HTTP_PROXY")) ); if ( !ms_proxyDefault ) { @@ -384,7 +387,7 @@ void wxURL::SetProxy(const wxString& url_proxy) return; hostname = tmp_str(0, pos); - port = tmp_str(pos, tmp_str.Length()-pos); + port = tmp_str(pos+1, tmp_str.Length()-pos); addr.Hostname(hostname); addr.Service(port); @@ -520,3 +523,6 @@ void wxURLModule::OnExit() } #endif // wxUSE_SOCKETS + +#endif // wxUSE_URL +