#include <C4HTTP.h>
Public Types | |
enum | ResponseType { NoPreference , XML } |
Public Member Functions | |
C4HTTPClient () | |
~C4HTTPClient () override | |
bool | Init () |
bool | Query (const StdBuf &Data, bool fBinary) |
bool | Query (const char *szData, bool fBinary) |
bool | isBusy () const |
bool | isConnected () const |
bool | isSuccess () const |
size_t | getTotalSize () const |
size_t | getDownloadedSize () const |
const StdBuf & | getResultBin () const |
const char * | getResultString () const |
const char * | getURL () const |
const char * | getServerName () const |
const C4NetIO::addr_t & | getServerAddress () const |
virtual const char * | GetError () const |
void | ResetError () |
void | Cancel (const char *szReason) |
void | Clear () |
bool | SetServer (const char *szServerAddress) |
void | SetExpectedResponseType (ResponseType type) |
void | SetNotify (class C4InteractiveThread *pnNotify) |
bool | Execute (int iMaxTime=-1, pollfd *readyfds=nullptr) override |
C4TimeMilliseconds | GetNextTick (C4TimeMilliseconds tNow) override |
void | GetFDs (std::vector< struct pollfd > &) override |
bool | ExecuteUntil (int iTimeout=-1) |
bool | IsSignaled () |
virtual bool | IsLowPriority () |
virtual bool | IsNotify () |
virtual uint32_t | TimerInterval () |
Protected Member Functions | |
void | SetError (const char *strnError) |
void | Changed () |
Protected Attributes | |
StdCopyBuf | ResultBin |
StdCopyStrBuf | ResultString |
StdCopyStrBuf | Error |
C4HTTPClient::C4HTTPClient | ( | ) |
Definition at line 27 of file C4HTTP.cpp.
|
override |
Definition at line 31 of file C4HTTP.cpp.
References Cancel().
void C4HTTPClient::Cancel | ( | const char * | szReason | ) |
Definition at line 277 of file C4HTTP.cpp.
References Error.
Referenced by Clear(), C4StartupNetListEntry::Execute(), Query(), C4DownloadDlg::UserClose(), and ~C4HTTPClient().
|
protectedinherited |
Definition at line 108 of file StdScheduler.cpp.
References s.
Referenced by C4NetIOTCP::Accept(), C4NetIOTCP::AddConnectWait(), C4NetIOUDP::AddPeer(), C4NetIOTCP::Listen(), and CStdTimerProc::SetDelay().
void C4HTTPClient::Clear | ( | ) |
Definition at line 290 of file C4HTTP.cpp.
References Cancel(), StdBuf::Clear(), StdStrBuf::Clear(), C4NetIO::EndpointAddress::Clear(), ResultBin, and ResultString.
Referenced by C4Network2::StreamOut().
|
overridevirtual |
Implements StdSchedulerProc.
Definition at line 59 of file C4HTTP.cpp.
References StdStrBuf::Copy(), Error, Ev_HTTP_Response, StdStrBuf::getData(), C4InteractiveThread::PushEvent(), C4NetIO::HostAddress::SetHost(), and SOCKET_ERROR.
Referenced by C4DownloadDlg::OnIdle().
|
inherited |
Definition at line 33 of file StdScheduler.cpp.
References StdSchedulerProc::Execute(), and C4TimeMilliseconds::Now().
Referenced by main().
|
inline |
Definition at line 90 of file C4HTTP.h.
Referenced by C4DownloadDlg::OnIdle().
|
inlinevirtual |
Definition at line 96 of file C4HTTP.h.
References Error, and StdStrBuf::getData().
Referenced by C4DownloadDlg::GetError(), C4Network2::InitLeague(), C4Game::InitNetworkFromAddress(), C4Network2::LeagueEnd(), C4Network2::LeaguePlrAuthCheck(), C4Network2::LeagueStart(), C4Network2::LeagueUpdate(), C4Network2::LeagueUpdateProcessReply(), C4StartupNetListEntry::OnReference(), and C4StartupNetListEntry::SetRefQuery().
|
overridevirtual |
|
overridevirtual |
Reimplemented from StdSchedulerProc.
Definition at line 125 of file C4HTTP.cpp.
|
inline |
Definition at line 91 of file C4HTTP.h.
References ResultBin.
Referenced by C4DownloadDlg::ShowModal().
|
inline |
Definition at line 92 of file C4HTTP.h.
References StdStrBuf::getData(), and ResultString.
|
inline |
Definition at line 95 of file C4HTTP.h.
Referenced by C4Network2RefClient::GetReferences().
|
inline |
Definition at line 94 of file C4HTTP.h.
References StdStrBuf::getData().
Referenced by C4StartupNetListEntry::GetJoinAddress(), C4Network2::LeagueEnd(), C4Network2::LeaguePlrAuth(), C4Network2::LeagueStart(), and C4StartupNetListEntry::SetRefQuery().
|
inline |
Definition at line 89 of file C4HTTP.h.
Referenced by C4DownloadDlg::OnIdle().
|
inline |
Definition at line 93 of file C4HTTP.h.
References StdStrBuf::getData().
Referenced by C4DownloadDlg::OnIdle().
bool C4HTTPClient::Init | ( | ) |
Definition at line 42 of file C4HTTP.cpp.
References SetError().
Referenced by C4StartupNetDlg::CheckVersionUpdate(), C4Network2::InitLeague(), C4Game::InitNetworkFromAddress(), C4StartupNetListEntry::SetRefQuery(), C4DownloadDlg::ShowModal(), and C4Network2::StartStreaming().
|
inline |
Definition at line 86 of file C4HTTP.h.
Referenced by C4StartupNetListEntry::Execute(), C4Network2::Execute(), C4Network2RefClient::GetReferences(), C4Network2UpdateClient::GetUpdateURL(), C4Network2UpdateClient::GetVersion(), C4Game::InitNetworkFromAddress(), C4Network2::LeagueEnd(), C4Network2::LeaguePlrAuth(), C4Network2::LeaguePlrAuthCheck(), C4Network2::LeagueStart(), C4Network2::LeagueUpdate(), C4Network2::LeagueUpdateProcessReply(), C4Network2::LeagueWaitNotBusy(), C4DownloadDlg::OnIdle(), C4StartupNetListEntry::OnReference(), and C4Network2::StreamOut().
|
inline |
Definition at line 87 of file C4HTTP.h.
Referenced by C4DownloadDlg::OnIdle().
|
inlinevirtualinherited |
Definition at line 82 of file StdScheduler.h.
|
inlinevirtualinherited |
Reimplemented in CStdNotifyProc, and C4NetIO.
Definition at line 83 of file StdScheduler.h.
|
inherited |
|
inline |
Definition at line 88 of file C4HTTP.h.
Referenced by C4Network2RefClient::GetReferences(), C4LeagueClient::GetStartReply(), C4Network2UpdateClient::GetUpdateURL(), C4Network2UpdateClient::GetVersion(), C4Game::InitNetworkFromAddress(), C4Network2::LeagueEnd(), C4Network2::LeaguePlrAuthCheck(), C4Network2::LeagueStart(), C4Network2::LeagueUpdateProcessReply(), C4DownloadDlg::OnIdle(), C4StartupNetListEntry::OnReference(), and C4Network2::StreamOut().
|
inline |
bool C4HTTPClient::Query | ( | const StdBuf & | Data, |
bool | fBinary | ||
) |
Definition at line 158 of file C4HTTP.cpp.
References C4HTTPQueryTimeout, Cancel(), StdStrBuf::Clear(), Config, Error, FormatString(), C4Config::General, StdBuf::getData(), StdStrBuf::getData(), StdStrBuf::getMData(), StdBuf::getSize(), StdStrBuf::isNull(), C4ConfigGeneral::LanguageEx, ResultString, and StdStrBuf::SetLength().
Referenced by C4LeagueClient::Auth(), C4LeagueClient::AuthCheck(), C4LeagueClient::End(), C4Network2RefClient::QueryReferences(), C4Network2UpdateClient::QueryUpdateURL(), C4LeagueClient::ReportDisconnect(), C4DownloadDlg::ShowModal(), C4LeagueClient::Start(), C4Network2::StreamOut(), and C4LeagueClient::Update().
|
inline |
Definition at line 97 of file C4HTTP.h.
References StdStrBuf::Clear(), and Error.
Referenced by C4Network2RefClient::GetReferences().
|
inlineprotected |
Definition at line 80 of file C4HTTP.h.
References Error.
Referenced by C4Network2RefClient::GetReferences(), C4Network2UpdateClient::GetUpdateURL(), C4Network2UpdateClient::GetVersion(), Init(), and SetServer().
void C4HTTPClient::SetExpectedResponseType | ( | C4HTTPClient::ResponseType | type | ) |
Definition at line 315 of file C4HTTP.cpp.
|
inline |
Definition at line 106 of file C4HTTP.h.
Referenced by C4StartupNetDlg::CheckVersionUpdate(), and C4StartupNetListEntry::SetRefQuery().
bool C4HTTPClient::SetServer | ( | const char * | szServerAddress | ) |
Definition at line 298 of file C4HTTP.cpp.
References StdStrBuf::Copy(), and SetError().
Referenced by C4StartupNetDlg::CheckVersionUpdate(), C4Network2::InitLeague(), C4Game::InitNetworkFromAddress(), C4StartupNetListEntry::SetRefQuery(), C4DownloadDlg::ShowModal(), and C4Network2::StreamOut().
|
inlinevirtualinherited |
|
protected |
Definition at line 79 of file C4HTTP.h.
Referenced by Cancel(), Execute(), GetError(), Query(), ResetError(), and SetError().
|
protected |
Definition at line 77 of file C4HTTP.h.
Referenced by Clear(), and getResultBin().
|
protected |
Definition at line 78 of file C4HTTP.h.
Referenced by Clear(), C4LeagueClient::GetAuthCheckReply(), C4LeagueClient::GetAuthReply(), C4LeagueClient::GetEndReply(), C4Network2RefClient::GetReferences(), C4LeagueClient::GetReportDisconnectReply(), getResultString(), C4LeagueClient::GetStartReply(), C4LeagueClient::GetUpdateReply(), C4Network2UpdateClient::GetUpdateURL(), C4Network2UpdateClient::GetVersion(), and Query().