Move GetBytesExpectedToReceive() impl to base class
This commit is contained in:
@@ -81,8 +81,6 @@ public:
|
||||
|
||||
wxFileOffset GetBytesReceived() const wxOVERRIDE { return m_bytesReceived; }
|
||||
|
||||
wxFileOffset GetBytesExpectedToReceive() const wxOVERRIDE { return m_bytesExpectedToReceive; }
|
||||
|
||||
void HandleCallback(DWORD dwInternetStatus, LPVOID lpvStatusInformation,
|
||||
DWORD dwStatusInformationLength);
|
||||
|
||||
@@ -96,7 +94,6 @@ private:
|
||||
wxScopedPtr<wxWebAuthChallengeWinHTTP> m_authChallenge;
|
||||
wxMemoryBuffer m_dataWriteBuffer;
|
||||
wxFileOffset m_dataWritten;
|
||||
wxFileOffset m_bytesExpectedToReceive;
|
||||
wxFileOffset m_bytesReceived;
|
||||
|
||||
void SendRequest();
|
||||
|
@@ -85,7 +85,7 @@ public:
|
||||
|
||||
virtual wxFileOffset GetBytesReceived() const = 0;
|
||||
|
||||
virtual wxFileOffset GetBytesExpectedToReceive() const = 0;
|
||||
virtual wxFileOffset GetBytesExpectedToReceive() const;
|
||||
|
||||
void SetState(State state, const wxString& failMsg = "");
|
||||
|
||||
|
@@ -102,6 +102,14 @@ void wxWebRequest::SetData(wxSharedPtr<wxInputStream> dataStream, const wxString
|
||||
SetHeader("Content-Type", contentType);
|
||||
}
|
||||
|
||||
wxFileOffset wxWebRequest::GetBytesExpectedToReceive() const
|
||||
{
|
||||
if ( GetResponse() )
|
||||
return GetResponse()->GetContentLength();
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
void wxWebRequest::SetState(State state, const wxString & failMsg)
|
||||
{
|
||||
// Add a reference while the request is active
|
||||
|
@@ -148,7 +148,6 @@ wxWebRequestWinHTTP::wxWebRequestWinHTTP(int id, wxWebSessionWinHTTP& session, c
|
||||
m_connect(NULL),
|
||||
m_request(NULL),
|
||||
m_dataWritten(0),
|
||||
m_bytesExpectedToReceive(0),
|
||||
m_bytesReceived(0)
|
||||
{
|
||||
m_headers = session.GetHeaders();
|
||||
@@ -221,7 +220,6 @@ void wxWebRequestWinHTTP::CreateResponse()
|
||||
m_response.reset(new wxWebResponseWinHTTP(*this));
|
||||
if ( !m_response->Init() )
|
||||
return;
|
||||
m_bytesExpectedToReceive = m_response->GetContentLength();
|
||||
int status = m_response->GetStatus();
|
||||
if ( status == 401 || status == 407)
|
||||
{
|
||||
|
Reference in New Issue
Block a user