Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Used when the cUrlClient Lua request has just a single callback. More...
Public Member Functions | |
cSimpleUrlClientCallbacks (cLuaState::cCallbackPtr &&a_Callback) | |
Creates a new instance that uses the specified callback to report when request finishes. More... | |
virtual void | OnBodyData (const void *a_Data, size_t a_Size) override |
Called when the next fragment of the response body is received, unless the response is an allowed redirect. More... | |
virtual void | OnBodyFinished () override |
Called after the response body has been fully reported by OnBody() calls, unless the response is an allowed redirect. More... | |
virtual void | OnError (const AString &a_ErrorMsg) override |
Called when an asynchronous error is encountered. More... | |
virtual void | OnHeader (const AString &a_Key, const AString &a_Value) override |
Called when a single HTTP header is received and parsed, unless the response is an allowed redirect Called once for each incoming header. More... | |
Public Member Functions inherited from cUrlClient::cCallbacks | |
virtual bool | OnCertificateReceived () |
Called for TLS connections, when the server certificate is received. More... | |
virtual void | OnConnected (cTCPLink &a_Link) |
Called when the TCP connection is established. More... | |
virtual void | OnHeadersFinished () |
Called when the HTTP headers have been fully parsed, unless the response is an allowed redirect. More... | |
virtual void | OnRedirecting (const AString &a_NewLocation) |
Called when a redirect is to be followed. More... | |
virtual void | OnRequestSent () |
Called after the entire request has been sent to the remote peer. More... | |
virtual void | OnStatusLine (const AString &a_HttpVersion, int a_StatusCode, const AString &a_Rest) |
Called after the first line of the response is parsed, unless the response is an allowed redirect. More... | |
virtual void | OnTlsHandshakeCompleted () |
Called for TLS connections, when the TLS handshake has been completed. More... | |
virtual | ~cCallbacks () |
Protected Attributes | |
cLuaState::cCallbackPtr | m_Callback |
The callback to call when the request finishes. More... | |
AStringMap | m_Headers |
Accumulator for all the headers to be reported in the combined callback. More... | |
AString | m_ResponseBody |
The accumulator for the partial body data, so that OnBodyFinished() can send the entire thing at once. More... | |
Used when the cUrlClient Lua request has just a single callback.
The callback is used to report the entire body at once, together with the HTTP headers, or to report an error: callback("BodyContents", {headers}) callback(nil, "ErrorMessage") Accumulates the body contents into a single string until the body is finished. Accumulates all HTTP headers into an AStringMap.
Definition at line 897 of file ManualBindings_Network.cpp.
|
inline |
Creates a new instance that uses the specified callback to report when request finishes.
Definition at line 902 of file ManualBindings_Network.cpp.
|
inlineoverridevirtual |
Called when the next fragment of the response body is received, unless the response is an allowed redirect.
This can be called multiple times, as data arrives over the network.
Reimplemented from cUrlClient::cCallbacks.
Definition at line 914 of file ManualBindings_Network.cpp.
|
inlineoverridevirtual |
Called after the response body has been fully reported by OnBody() calls, unless the response is an allowed redirect.
There will be no more OnBody() calls.
Reimplemented from cUrlClient::cCallbacks.
Definition at line 920 of file ManualBindings_Network.cpp.
|
inlineoverridevirtual |
Called when an asynchronous error is encountered.
Reimplemented from cUrlClient::cCallbacks.
Definition at line 926 of file ManualBindings_Network.cpp.
|
inlineoverridevirtual |
Called when a single HTTP header is received and parsed, unless the response is an allowed redirect Called once for each incoming header.
Reimplemented from cUrlClient::cCallbacks.
Definition at line 908 of file ManualBindings_Network.cpp.
|
protected |
The callback to call when the request finishes.
Definition at line 935 of file ManualBindings_Network.cpp.
|
protected |
Accumulator for all the headers to be reported in the combined callback.
Definition at line 941 of file ManualBindings_Network.cpp.
|
protected |
The accumulator for the partial body data, so that OnBodyFinished() can send the entire thing at once.
Definition at line 938 of file ManualBindings_Network.cpp.