Change wxWebRequest API to use STATE event

This commit is contained in:
Tobias Taschner
2018-10-23 22:27:14 +02:00
parent d756159f5d
commit 701f697fa4
4 changed files with 91 additions and 93 deletions

View File

@@ -180,7 +180,7 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus,
else
{
m_response->ReportDataComplete();
SetState(State_Ready);
SetState(State_Completed);
}
break;
case WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE:
@@ -195,7 +195,7 @@ void wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus,
}
}
void wxWebRequestWinHTTP::WriteData()
void wxWebRequestWinHTTP::WriteData()
{
int dataWriteSize = 8 * 1024;
if ( m_dataWritten + dataWriteSize > m_dataSize )
@@ -211,10 +211,10 @@ void wxWebRequestWinHTTP::WriteData()
m_dataWritten += dataWriteSize;
}
else
CreateResponse();
}
void wxWebRequestWinHTTP::CreateResponse()
CreateResponse();
}
void wxWebRequestWinHTTP::CreateResponse()
{
if (::WinHttpReceiveResponse(m_request, NULL))
{
@@ -228,8 +228,8 @@ void wxWebRequestWinHTTP::CreateResponse()
}
else
SetFailedWithLastError();
}
}
void wxWebRequestWinHTTP::SetFailedWithLastError()
{
wxString failMessage = wxWinHTTPErrorToString(::GetLastError());
@@ -319,7 +319,7 @@ void wxWebRequestWinHTTP::Start()
void wxWebRequestWinHTTP::Cancel()
{
// TODO: implement
wxFAIL_MSG("not implemented");
}
wxWebResponse* wxWebRequestWinHTTP::GetResponse()