Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Attributes | List of all members
cFullUrlClientCallbacks Class Reference

Used when the cUrlClient Lua request wants all the callbacks. More...

Inheritance diagram for cFullUrlClientCallbacks:
Inheritance graph
[legend]
Collaboration diagram for cFullUrlClientCallbacks:
Collaboration graph
[legend]

Public Member Functions

 cFullUrlClientCallbacks (cLuaState::cTableRefPtr &&a_Callbacks)
 Creates a new instance bound to the specified table of callbacks. 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 bool OnCertificateReceived () override
 Called for TLS connections, when the server certificate is received. More...
 
virtual void OnConnected (cTCPLink &a_Link) override
 Called when the TCP connection is established. 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...
 
virtual void OnHeadersFinished () override
 Called when the HTTP headers have been fully parsed, unless the response is an allowed redirect. More...
 
virtual void OnRedirecting (const AString &a_NewLocation) override
 Called when a redirect is to be followed. More...
 
virtual void OnRequestSent () override
 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) override
 Called after the first line of the response is parsed, unless the response is an allowed redirect. More...
 
virtual void OnTlsHandshakeCompleted () override
 Called for TLS connections, when the TLS handshake has been completed. More...
 
- Public Member Functions inherited from cUrlClient::cCallbacks
virtual ~cCallbacks ()
 

Protected Attributes

cLuaState::cTableRefPtr m_Callbacks
 The Lua table containing the callbacks. More...
 
AStringMap m_Headers
 Accumulator for all the headers to be reported in the OnHeadersFinished() callback. More...
 

Detailed Description

Used when the cUrlClient Lua request wants all the callbacks.

Maps each callback onto a Lua function callback in the callback table.

Definition at line 796 of file ManualBindings_Network.cpp.

Constructor & Destructor Documentation

◆ cFullUrlClientCallbacks()

cFullUrlClientCallbacks::cFullUrlClientCallbacks ( cLuaState::cTableRefPtr &&  a_Callbacks)
inline

Creates a new instance bound to the specified table of callbacks.

Definition at line 801 of file ManualBindings_Network.cpp.

Member Function Documentation

◆ OnBodyData()

virtual void cFullUrlClientCallbacks::OnBodyData ( const void *  a_Data,
size_t  a_Size 
)
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 855 of file ManualBindings_Network.cpp.

◆ OnBodyFinished()

virtual void cFullUrlClientCallbacks::OnBodyFinished ( )
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 861 of file ManualBindings_Network.cpp.

◆ OnCertificateReceived()

virtual bool cFullUrlClientCallbacks::OnCertificateReceived ( )
inlineoverridevirtual

Called for TLS connections, when the server certificate is received.

Return true to continue with the request, false to abort. The default implementation does nothing and continues with the request. TODO: The certificate parameter needs a representation!

Reimplemented from cUrlClient::cCallbacks.

Definition at line 815 of file ManualBindings_Network.cpp.

◆ OnConnected()

virtual void cFullUrlClientCallbacks::OnConnected ( cTCPLink a_Link)
inlineoverridevirtual

Called when the TCP connection is established.

Reimplemented from cUrlClient::cCallbacks.

Definition at line 808 of file ManualBindings_Network.cpp.

◆ OnError()

virtual void cFullUrlClientCallbacks::OnError ( const AString a_ErrorMsg)
inlineoverridevirtual

Called when an asynchronous error is encountered.

Reimplemented from cUrlClient::cCallbacks.

Definition at line 867 of file ManualBindings_Network.cpp.

◆ OnHeader()

virtual void cFullUrlClientCallbacks::OnHeader ( const AString a_Key,
const AString a_Value 
)
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 842 of file ManualBindings_Network.cpp.

◆ OnHeadersFinished()

virtual void cFullUrlClientCallbacks::OnHeadersFinished ( )
inlineoverridevirtual

Called when the HTTP headers have been fully parsed, unless the response is an allowed redirect.

There will be no more OnHeader() calls.

Reimplemented from cUrlClient::cCallbacks.

Definition at line 849 of file ManualBindings_Network.cpp.

◆ OnRedirecting()

virtual void cFullUrlClientCallbacks::OnRedirecting ( const AString a_NewLocation)
inlineoverridevirtual

Called when a redirect is to be followed.

This is called even if the redirecting is prohibited by the options; in such an event, this call will be followed by OnError(). If a response indicates a redirect (and the request allows redirecting), the regular callbacks OnStatusLine(), OnHeader(), OnHeadersFinished(), OnBodyData() and OnBodyFinished() are not called for such a response; instead, the redirect is silently attempted.

Reimplemented from cUrlClient::cCallbacks.

Definition at line 873 of file ManualBindings_Network.cpp.

◆ OnRequestSent()

virtual void cFullUrlClientCallbacks::OnRequestSent ( )
inlineoverridevirtual

Called after the entire request has been sent to the remote peer.

Reimplemented from cUrlClient::cCallbacks.

Definition at line 830 of file ManualBindings_Network.cpp.

◆ OnStatusLine()

virtual void cFullUrlClientCallbacks::OnStatusLine ( const AString a_HttpVersion,
int  a_StatusCode,
const AString a_Rest 
)
inlineoverridevirtual

Called after the first line of the response is parsed, unless the response is an allowed redirect.

Reimplemented from cUrlClient::cCallbacks.

Definition at line 836 of file ManualBindings_Network.cpp.

◆ OnTlsHandshakeCompleted()

virtual void cFullUrlClientCallbacks::OnTlsHandshakeCompleted ( )
inlineoverridevirtual

Called for TLS connections, when the TLS handshake has been completed.

An empty default implementation is provided so that clients don't need to reimplement it unless they are interested in the event.

Reimplemented from cUrlClient::cCallbacks.

Definition at line 824 of file ManualBindings_Network.cpp.

Member Data Documentation

◆ m_Callbacks

cLuaState::cTableRefPtr cFullUrlClientCallbacks::m_Callbacks
protected

The Lua table containing the callbacks.

Definition at line 881 of file ManualBindings_Network.cpp.

◆ m_Headers

AStringMap cFullUrlClientCallbacks::m_Headers
protected

Accumulator for all the headers to be reported in the OnHeadersFinished() callback.

Definition at line 884 of file ManualBindings_Network.cpp.


The documentation for this class was generated from the following file: