![]() |
DDNet documentation
|
#include <http.h>
Classes | |
| class | IProgressCallback |
Public Member Functions | |
| IHttpRequest (const char *pUrl) | |
| virtual | ~IHttpRequest () |
| void | Timeout (CTimeout Timeout) |
| void | MaxResponseSize (int64_t MaxResponseSize) |
| void | LogProgress (HTTPLOG LogProgress) |
| void | SkipByFileTime (bool SkipByFileTime) |
| void | IpResolve (IPRESOLVE IpResolve) |
| void | FailOnErrorStatus (bool FailOnErrorStatus) |
| void | WriteToMemory () |
| void | WriteToFileAndMemory (IStorage *pStorage, const char *pDest, int StorageType) |
| void | WriteToFile (IStorage *pStorage, const char *pDest, int StorageType) |
| void | ValidateBeforeOverwrite (bool ValidateBeforeOverwrite) |
| void | ExpectSha256 (const SHA256_DIGEST &Sha256) |
| void | Head () |
| void | Post (const unsigned char *pData, size_t DataLength) |
| void | PostJson (const char *pJson) |
| virtual void | Header (const char *pNameColonValue)=0 |
| void | HeaderString (const char *pName, const char *pValue) |
| void | HeaderInt (const char *pName, int Value) |
| const char * | Dest () const |
| double | Current () const |
| double | Size () const |
| int | Progress () const |
| EHttpState | State () const |
| bool | Done () const |
| virtual void | Abort () |
| bool | IsAbortRequested () const |
| void | Wait () |
| void | SetProgressCallback (IProgressCallback *pCallback) |
| void | OnValidation (bool Success) |
| void | Result (unsigned char **ppResult, size_t *pResultLength) const |
| json_value * | ResultJson () const |
| const SHA256_DIGEST & | ResultSha256 () const |
| int | StatusCode () const |
| std::optional< int64_t > | ResultAgeSeconds () const |
| std::optional< int64_t > | ResultLastModified () const |
Protected Types | |
| enum class | REQUEST { GET , HEAD , POST , POST_JSON } |
Protected Member Functions | |
| bool | ShouldSkipRequest () |
| bool | BeforeInit () |
| size_t | OnData (const char *pData, size_t DataSize) |
| void | OnCompletionInternal (EHttpState State) |
Static Protected Member Functions | |
| static const char * | GetRequestType (REQUEST Type) |
Protected Attributes | |
| char | m_aUrl [256] = "" |
| REQUEST | m_Type = REQUEST::GET |
| unsigned char * | m_pBody = nullptr |
| size_t | m_BodyLength = 0 |
| CTimeout | m_Timeout = CTimeout{0, 0, 0, 0} |
| int64_t | m_MaxResponseSize = -1 |
| HTTPLOG | m_LogProgress = HTTPLOG::ALL |
| bool | m_SkipByFileTime = true |
| IPRESOLVE | m_IpResolve = IPRESOLVE::WHATEVER |
| bool | m_FailOnErrorStatus = true |
| bool | m_ValidateBeforeOverwrite = false |
| std::optional< SHA256_DIGEST > | m_ExpectedSha256 = std::nullopt |
| int64_t | m_IfModifiedSince = -1 |
| std::optional< SHA256_DIGEST > | m_ActualSha256 = std::nullopt |
| SHA256_CTX | m_ActualSha256Ctx |
| uint64_t | m_ResponseLength = 0 |
| int | m_StatusCode = 0 |
| std::optional< int64_t > | m_ResultDate = std::nullopt |
| std::optional< int64_t > | m_ResultLastModified = std::nullopt |
| bool | m_WriteToMemory = true |
| bool | m_WriteToFile = false |
| size_t | m_BufferSize = 0 |
| unsigned char * | m_pBuffer = nullptr |
| IOHANDLE | m_File = nullptr |
| char | m_aDestAbsoluteTmp [IO_MAX_PATH_LENGTH] = "" |
| char | m_aDestAbsolute [IO_MAX_PATH_LENGTH] = "" |
| char | m_aDest [IO_MAX_PATH_LENGTH] = "" |
| std::atomic< double > | m_Size = 0.0 |
| std::atomic< double > | m_Current = 0.0 |
| std::atomic< int > | m_Progress = 0 |
| std::atomic< EHttpState > | m_State = EHttpState::QUEUED |
| std::atomic< bool > | m_Abort = false |
| IProgressCallback * | m_pProgressCallback = nullptr |
| std::mutex | m_WaitMutex |
| std::condition_variable | m_WaitCondition |
Static Protected Attributes | |
| static const char *const | USER_AGENT_STRING = GAME_NAME " " GAME_RELEASE_VERSION " (" CONF_PLATFORM_STRING "; " CONF_ARCH_STRING ")" |
Friends | |
| class | IHttp |
|
strongprotected |
| IHttpRequest::IHttpRequest | ( | const char * | pUrl | ) |
|
virtual |
|
inlinevirtual |
|
protected |
|
inline |
| const char * IHttpRequest::Dest | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
staticprotected |
| void IHttpRequest::Head | ( | ) |
|
pure virtual |
Implemented in CHttpRequestCurl.
| void IHttpRequest::HeaderInt | ( | const char * | pName, |
| int | Value ) |
| void IHttpRequest::HeaderString | ( | const char * | pName, |
| const char * | pValue ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
nodiscardprotected |
| void IHttpRequest::OnValidation | ( | bool | Success | ) |
| void IHttpRequest::Post | ( | const unsigned char * | pData, |
| size_t | DataLength ) |
| void IHttpRequest::PostJson | ( | const char * | pJson | ) |
|
inline |
| void IHttpRequest::Result | ( | unsigned char ** | ppResult, |
| size_t * | pResultLength ) const |
| std::optional< int64_t > IHttpRequest::ResultAgeSeconds | ( | ) | const |
| json_value * IHttpRequest::ResultJson | ( | ) | const |
| std::optional< int64_t > IHttpRequest::ResultLastModified | ( | ) | const |
| const SHA256_DIGEST & IHttpRequest::ResultSha256 | ( | ) | const |
|
inline |
|
protected |
|
inline |
|
inline |
|
inline |
| int IHttpRequest::StatusCode | ( | ) | const |
|
inline |
|
inline |
| void IHttpRequest::Wait | ( | ) |
| void IHttpRequest::WriteToFile | ( | IStorage * | pStorage, |
| const char * | pDest, | ||
| int | StorageType ) |
| void IHttpRequest::WriteToFileAndMemory | ( | IStorage * | pStorage, |
| const char * | pDest, | ||
| int | StorageType ) |
| void IHttpRequest::WriteToMemory | ( | ) |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |