Make wxWebResponse::Init() and Finalize() non-public
The former can be called from the derived class ctors while the latter only needs to be called from wxWebRequest itself, so just make it a friend: this is not ideal, but still better than leaving this public and simpler than any alternatives.
This commit is contained in:
@@ -220,8 +220,11 @@ void wxWebRequestWinHTTP::CreateResponse()
|
||||
if ( ::WinHttpReceiveResponse(m_request, NULL) )
|
||||
{
|
||||
m_response.reset(new wxWebResponseWinHTTP(*this));
|
||||
if ( !m_response->Init() )
|
||||
// wxWebResponseWinHTTP ctor could have changed the state if its
|
||||
// initialization failed, so check for this.
|
||||
if ( GetState() == State_Failed )
|
||||
return;
|
||||
|
||||
int status = m_response->GetStatus();
|
||||
if ( status == 401 || status == 407)
|
||||
{
|
||||
@@ -364,6 +367,8 @@ wxWebResponseWinHTTP::wxWebResponseWinHTTP(wxWebRequestWinHTTP& request):
|
||||
if ( contentLengthStr.empty() ||
|
||||
!contentLengthStr.ToLongLong(&m_contentLength) )
|
||||
m_contentLength = -1;
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
wxString wxWebResponseWinHTTP::GetURL() const
|
||||
|
Reference in New Issue
Block a user