Cuberite
A lightweight, fast and extensible game server for Minecraft
|
cSchemeHandler descendant that handles HTTP (and HTTPS) requests. More...
Public Member Functions | |
cHttpSchemeHandler (cUrlClientRequest &a_ParentRequest, bool a_IsTls) | |
virtual void | OnBodyData (const void *a_Data, size_t a_Size) override |
Called for each chunk of the incoming body data. More... | |
virtual void | OnBodyFinished (void) override |
Called when the entire body has been reported by OnBodyData(). More... | |
virtual void | OnConnected (cTCPLink &a_Link) override |
virtual void | OnError (const AString &a_ErrorDescription) override |
Called when an error has occured while parsing. More... | |
virtual void | OnFirstLine (const AString &a_FirstLine) override |
Called when the first line of the request or response is fully parsed. More... | |
virtual void | OnHeaderLine (const AString &a_Key, const AString &a_Value) override |
Called when a single header line is parsed. More... | |
virtual void | OnHeadersFinished (void) override |
Called when all the headers have been parsed. More... | |
virtual void | OnReceivedData (const char *a_Data, size_t a_Length) override |
virtual void | OnRemoteClosed (void) override |
virtual void | OnTlsHandshakeCompleted (void) override |
void | SendRequest () |
Sends the HTTP request over the link. More... | |
Protected Attributes | |
bool | m_IsRedirect |
Set to true if the first line contains a redirecting HTTP status code and the options specify to follow redirects. More... | |
bool | m_IsTls |
If true, the TLS should be started on the link before sending the request (used for https). More... | |
cTCPLink * | m_Link |
The network link. More... | |
cHTTPMessageParser | m_Parser |
Parser of the HTTP response message. More... | |
AString | m_RedirectLocation |
The Location where the request should be redirected. More... | |
Private Types | |
using | Super = cSchemeHandler |
Additional Inherited Members | |
Protected Member Functions inherited from cHTTPMessageParser::cCallbacks | |
virtual | ~cCallbacks () |
cSchemeHandler descendant that handles HTTP (and HTTPS) requests.
Definition at line 306 of file UrlClient.cpp.
|
private |
Definition at line 310 of file UrlClient.cpp.
|
inline |
Definition at line 314 of file UrlClient.cpp.
|
inlineoverridevirtual |
Called for each chunk of the incoming body data.
Implements cHTTPMessageParser::cCallbacks.
Definition at line 469 of file UrlClient.cpp.
|
inlineoverridevirtual |
Called when the entire body has been reported by OnBodyData().
Implements cHTTPMessageParser::cCallbacks.
Definition at line 479 of file UrlClient.cpp.
|
inlineoverridevirtual |
Definition at line 323 of file UrlClient.cpp.
|
inlineoverridevirtual |
Called when an error has occured while parsing.
Implements cHTTPMessageParser::cCallbacks.
Definition at line 395 of file UrlClient.cpp.
|
inlineoverridevirtual |
Called when the first line of the request or response is fully parsed.
Doesn't check the validity of the line, only extracts the first complete line.
Implements cHTTPMessageParser::cCallbacks.
Definition at line 402 of file UrlClient.cpp.
|
inlineoverridevirtual |
Called when a single header line is parsed.
Implements cHTTPMessageParser::cCallbacks.
Definition at line 442 of file UrlClient.cpp.
|
inlineoverridevirtual |
Called when all the headers have been parsed.
Implements cHTTPMessageParser::cCallbacks.
Definition at line 459 of file UrlClient.cpp.
|
inlineoverridevirtual |
Definition at line 371 of file UrlClient.cpp.
|
inlineoverridevirtual |
Definition at line 388 of file UrlClient.cpp.
|
inlineoverridevirtual |
Definition at line 382 of file UrlClient.cpp.
|
inline |
Sends the HTTP request over the link.
Common code for both HTTP and HTTPS.
Definition at line 339 of file UrlClient.cpp.
|
protected |
Set to true if the first line contains a redirecting HTTP status code and the options specify to follow redirects.
If true, and the parent request allows redirects, neither headers not the body contents are reported through the callbacks, and after the entire request is parsed, the redirect is attempted.
Definition at line 514 of file UrlClient.cpp.
|
protected |
If true, the TLS should be started on the link before sending the request (used for https).
Definition at line 509 of file UrlClient.cpp.
|
protected |
The network link.
Definition at line 503 of file UrlClient.cpp.
|
protected |
Parser of the HTTP response message.
Definition at line 506 of file UrlClient.cpp.
|
protected |
The Location where the request should be redirected.
Only used when m_IsRedirect is true.
Definition at line 518 of file UrlClient.cpp.