git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31238
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
protected:
static wxProtoInfo *ms_protocols;
protected:
static wxProtoInfo *ms_protocols;
static wxHTTP *ms_proxyDefault;
static bool ms_useDefaultProxy;
wxHTTP *m_proxy;
static wxHTTP *ms_proxyDefault;
static bool ms_useDefaultProxy;
wxHTTP *m_proxy;
+#endif // wxUSE_PROTOCOL_HTTP
#if wxUSE_URL_NATIVE
friend class wxURLNativeImp;
#if wxUSE_URL_NATIVE
friend class wxURLNativeImp;
// Enforce linking of protocol classes:
USE_PROTOCOL(wxFileProto)
// Enforce linking of protocol classes:
USE_PROTOCOL(wxFileProto)
wxHTTP *wxURL::ms_proxyDefault = NULL;
bool wxURL::ms_useDefaultProxy = false;
#endif
wxHTTP *wxURL::ms_proxyDefault = NULL;
bool wxURL::ms_useDefaultProxy = false;
#endif
+#if wxUSE_PROTOCOL_FTP
+USE_PROTOCOL(wxFTP)
+#endif
+
// --------------------------------------------------------------
//
// wxURL
// --------------------------------------------------------------
//
// wxURL
m_nativeImp = CreateNativeImpObject();
#endif
m_nativeImp = CreateNativeImpObject();
#endif
if ( ms_useDefaultProxy && !ms_proxyDefault )
{
SetDefaultProxy( wxGetenv(wxT("HTTP_PROXY")) );
if ( ms_useDefaultProxy && !ms_proxyDefault )
{
SetDefaultProxy( wxGetenv(wxT("HTTP_PROXY")) );
m_useProxy = ms_proxyDefault != NULL;
m_proxy = ms_proxyDefault;
m_useProxy = ms_proxyDefault != NULL;
m_proxy = ms_proxyDefault;
+#endif // wxUSE_PROTOCOL_HTTP
if (m_useProxy)
{
// destroy the previously created protocol as we'll be using m_proxy
if (m_useProxy)
{
// destroy the previously created protocol as we'll be using m_proxy
// We initialize specific variables.
m_protocol = m_proxy; // FIXME: we should clone the protocol
}
// We initialize specific variables.
m_protocol = m_proxy; // FIXME: we should clone the protocol
}
+#endif // wxUSE_PROTOCOL_HTTP
m_error = wxURL_NOERR;
return true;
m_error = wxURL_NOERR;
return true;
void wxURL::CleanData()
{
void wxURL::CleanData()
{
+#endif // wxUSE_PROTOCOL_HTTP
delete m_protocol;
}
wxURL::~wxURL()
{
CleanData();
delete m_protocol;
}
wxURL::~wxURL()
{
CleanData();
if (m_proxy && m_proxy != ms_proxyDefault)
delete m_proxy;
if (m_proxy && m_proxy != ms_proxyDefault)
delete m_proxy;
+#endif // wxUSE_PROTOCOL_HTTP
#if wxUSE_URL_NATIVE
delete m_nativeImp;
#endif
#if wxUSE_URL_NATIVE
delete m_nativeImp;
#endif
void wxURL::SetDefaultProxy(const wxString& url_proxy)
{
if ( !url_proxy )
void wxURL::SetDefaultProxy(const wxString& url_proxy)
{
if ( !url_proxy )
+#endif // wxUSE_PROTOCOL_HTTP
// ----------------------------------------------------------------------
// wxURLModule
// ----------------------------------------------------------------------
// wxURLModule
bool wxURLModule::OnInit()
{
bool wxURLModule::OnInit()
{
// env var HTTP_PROXY contains the address of the default proxy to use if
// set, but don't try to create this proxy right now because it will slow
// down the program startup (especially if there is no DNS server
// env var HTTP_PROXY contains the address of the default proxy to use if
// set, but don't try to create this proxy right now because it will slow
// down the program startup (especially if there is no DNS server
{
wxURL::ms_useDefaultProxy = true;
}
{
wxURL::ms_useDefaultProxy = true;
}
+#endif // wxUSE_PROTOCOL_HTTP
return true;
}
void wxURLModule::OnExit()
{
return true;
}
void wxURLModule::OnExit()
{
delete wxURL::ms_proxyDefault;
wxURL::ms_proxyDefault = NULL;
delete wxURL::ms_proxyDefault;
wxURL::ms_proxyDefault = NULL;
+#endif // wxUSE_PROTOCOL_HTTP
}
#endif // wxUSE_SOCKETS
}
#endif // wxUSE_SOCKETS