Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | List of all members
cUrlClient::cCallbacks Class Reference

Callbacks that are used for progress and result reporting. More...

#include <UrlClient.h>

Inheritance diagram for cUrlClient::cCallbacks:
Inheritance graph
[legend]

Public Member Functions

virtual void OnBodyData (const void *a_Data, size_t a_Size)
 Called when the next fragment of the response body is received, unless the response is an allowed redirect. More...
 
virtual void OnBodyFinished ()
 Called after the response body has been fully reported by OnBody() calls, unless the response is an allowed redirect. More...
 
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 OnError (const AString &a_ErrorMsg)
 Called when an asynchronous error is encountered. More...
 
virtual void OnHeader (const AString &a_Key, const AString &a_Value)
 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 ()
 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 ()
 

Detailed Description

Callbacks that are used for progress and result reporting.

Definition at line 38 of file UrlClient.h.

Constructor & Destructor Documentation

◆ ~cCallbacks()

virtual cUrlClient::cCallbacks::~cCallbacks ( )
inlinevirtual

Definition at line 42 of file UrlClient.h.

Member Function Documentation

◆ OnBodyData()

virtual void cUrlClient::cCallbacks::OnBodyData ( const void *  a_Data,
size_t  a_Size 
)
inlinevirtual

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 in cSimpleUrlClientCallbacks, and cFullUrlClientCallbacks.

Definition at line 73 of file UrlClient.h.

◆ OnBodyFinished()

virtual void cUrlClient::cCallbacks::OnBodyFinished ( void  )
inlinevirtual

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 in cSimpleUrlClientCallbacks, and cFullUrlClientCallbacks.

Definition at line 77 of file UrlClient.h.

◆ OnCertificateReceived()

virtual bool cUrlClient::cCallbacks::OnCertificateReceived ( )
inlinevirtual

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 in cFullUrlClientCallbacks.

Definition at line 51 of file UrlClient.h.

◆ OnConnected()

virtual void cUrlClient::cCallbacks::OnConnected ( cTCPLink a_Link)
inlinevirtual

Called when the TCP connection is established.

Reimplemented in cFullUrlClientCallbacks.

Definition at line 45 of file UrlClient.h.

◆ OnError()

virtual void cUrlClient::cCallbacks::OnError ( const AString a_ErrorMsg)
inlinevirtual

Called when an asynchronous error is encountered.

Reimplemented in cSimpleUrlClientCallbacks, and cFullUrlClientCallbacks.

Definition at line 80 of file UrlClient.h.

◆ OnHeader()

virtual void cUrlClient::cCallbacks::OnHeader ( const AString a_Key,
const AString a_Value 
)
inlinevirtual

Called when a single HTTP header is received and parsed, unless the response is an allowed redirect Called once for each incoming header.

Reimplemented in cSimpleUrlClientCallbacks, and cFullUrlClientCallbacks.

Definition at line 65 of file UrlClient.h.

◆ OnHeadersFinished()

virtual void cUrlClient::cCallbacks::OnHeadersFinished ( void  )
inlinevirtual

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

There will be no more OnHeader() calls.

Reimplemented in cFullUrlClientCallbacks.

Definition at line 69 of file UrlClient.h.

◆ OnRedirecting()

virtual void cUrlClient::cCallbacks::OnRedirecting ( const AString a_NewLocation)
inlinevirtual

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 in cFullUrlClientCallbacks.

Definition at line 88 of file UrlClient.h.

◆ OnRequestSent()

virtual void cUrlClient::cCallbacks::OnRequestSent ( )
inlinevirtual

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

Reimplemented in cFullUrlClientCallbacks.

Definition at line 58 of file UrlClient.h.

◆ OnStatusLine()

virtual void cUrlClient::cCallbacks::OnStatusLine ( const AString a_HttpVersion,
int  a_StatusCode,
const AString a_Rest 
)
inlinevirtual

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

Reimplemented in cFullUrlClientCallbacks.

Definition at line 61 of file UrlClient.h.

◆ OnTlsHandshakeCompleted()

virtual void cUrlClient::cCallbacks::OnTlsHandshakeCompleted ( void  )
inlinevirtual

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 in cFullUrlClientCallbacks.

Definition at line 55 of file UrlClient.h.


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