![]() |
DDNet documentation
|
#include <http_curl.h>
Public Member Functions | |
| CHttpRequestCurl (const char *pUrl) | |
| ~CHttpRequestCurl () override | |
| void | Header (const char *pNameColonValue) override |
| Public Member Functions inherited from IHttpRequest | |
| 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) |
| 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 |
Private Member Functions | |
| bool | ConfigureHandle (CURL *pHandle) |
| size_t | OnHeader (char *pHeader, size_t HeaderSize) |
| void | OnCompletionInternal (CURL *pHandle, CURLcode Code) |
Static Private Member Functions | |
| static int | ProgressCallback (void *pUser, double DlTotal, double DlCurr, double UlTotal, double UlCurr) |
| static size_t | HeaderCallback (char *pData, size_t Size, size_t Number, void *pUser) |
| static size_t | WriteCallback (char *pData, size_t Size, size_t Number, void *pUser) |
Private Attributes | |
| curl_slist * | m_pRequestHeaders = nullptr |
| char | m_aErr [CURL_ERROR_SIZE] |
| bool | m_ResponseHeadersEnded = false |
Friends | |
| class | CHttpCurl |
Additional Inherited Members | |
| Protected Types inherited from IHttpRequest | |
| enum class | REQUEST { GET , HEAD , POST , POST_JSON } |
| Protected Member Functions inherited from IHttpRequest | |
| bool | ShouldSkipRequest () |
| bool | BeforeInit () |
| size_t | OnData (const char *pData, size_t DataSize) |
| void | OnCompletionInternal (EHttpState State) |
| Static Protected Member Functions inherited from IHttpRequest | |
| static const char * | GetRequestType (REQUEST Type) |
| Protected Attributes inherited from IHttpRequest | |
| 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 inherited from IHttpRequest | |
| static const char *const | USER_AGENT_STRING = GAME_NAME " " GAME_RELEASE_VERSION " (" CONF_PLATFORM_STRING "; " CONF_ARCH_STRING ")" |
| CHttpRequestCurl::CHttpRequestCurl | ( | const char * | pUrl | ) |
|
override |
|
private |
|
overridevirtual |
Implements IHttpRequest.
|
staticprivate |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
friend |
|
private |
|
private |
|
private |