wxURL implementation using WinInet functions under Win32 (patch 839305)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-02-07 15:28:06 +00:00
parent ba1e9d6ced
commit 25959b956d
6 changed files with 287 additions and 3 deletions

View File

@@ -61,6 +61,9 @@ wxURL::wxURL(const wxString& url)
m_protocol = NULL;
m_error = wxURL_NOERR;
m_url = url;
#if wxUSE_URL_NATIVE
m_nativeImp = CreateNativeImpObject();
#endif
#if wxUSE_SOCKETS
if ( ms_useDefaultProxy && !ms_proxyDefault )
@@ -157,10 +160,13 @@ void wxURL::CleanData()
wxURL::~wxURL()
{
CleanData();
CleanData();
#if wxUSE_SOCKETS
if (m_proxy && m_proxy != ms_proxyDefault)
delete m_proxy;
if (m_proxy && m_proxy != ms_proxyDefault)
delete m_proxy;
#endif
#if wxUSE_URL_NATIVE
delete m_nativeImp;
#endif
}
@@ -285,6 +291,19 @@ wxInputStream *wxURL::GetInputStream()
m_protocol->SetPassword(m_password);
}
#if wxUSE_URL_NATIVE
// give the native implementation to return a better stream
// such as the native WinINet functionality under MS-Windows
if (m_nativeImp)
{
wxInputStream *rc;
rc = m_nativeImp->GetInputStream(this);
if (rc != 0)
return rc;
}
// else use the standard behaviour
#endif // wxUSE_URL_NATIVE
#if wxUSE_SOCKETS
wxIPV4address addr;