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

#include <SslHTTPServerConnection.h>

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

Public Member Functions

 cSslHTTPServerConnection (cHTTPServer &a_HTTPServer, const std::shared_ptr< const cSslConfig > &a_Config)
 Creates a new connection on the specified server. More...
 
virtual ~cSslHTTPServerConnection () override
 
- Public Member Functions inherited from cHTTPServerConnection
 cHTTPServerConnection (cHTTPServer &a_HTTPServer)
 Creates a new instance, connected to the specified HTTP server instance. More...
 
void FinishResponse (void)
 Indicates that the current response is finished, gets ready for receiving another request (HTTP 1.1 keepalive). More...
 
void Send (const AString &a_Data)
 Sends the data as the response (may be called multiple times) More...
 
void Send (const cHTTPOutgoingResponse &a_Response)
 Sends the headers contained in a_Response. More...
 
void Send (const void *a_Data, size_t a_Size)
 Sends the data as the response (may be called multiple times) More...
 
void SendNeedAuth (const AString &a_Realm)
 Sends the "401 unauthorized" reply together with instructions on authorizing, using the specified realm. More...
 
void SendStatusAndReason (int a_StatusCode, const AString &a_Reason)
 Sends HTTP status code together with a_Reason (used for HTTP errors). More...
 
void Terminate (void)
 Terminates the connection; finishes any request being currently processed. More...
 
virtual ~cHTTPServerConnection () override
 
- Public Member Functions inherited from cTCPLink::cCallbacks
virtual void OnTlsHandshakeCompleted (void)
 Called when the TLS handshake has been completed and communication can continue regularly. More...
 
virtual ~cCallbacks ()
 
- Public Member Functions inherited from cHTTPMessageParser::cCallbacks
virtual ~cCallbacks ()
 

Protected Member Functions

virtual void OnReceivedData (const char *a_Data, size_t a_Size) override
 Data is received from the client. More...
 
virtual void SendData (const void *a_Data, size_t a_Size) override
 Called to send raw data over the link. More...
 
- Protected Member Functions inherited from cHTTPServerConnection
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 OnError (const AString &a_ErrorDescription) override
 Called when an error has occured while parsing. More...
 
virtual void OnError (int a_ErrorCode, const AString &a_ErrorMsg) override
 An error has occurred on the socket. 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 OnLinkCreated (cTCPLinkPtr a_Link) override
 The link instance has been created, remember it. More...
 
virtual void OnRemoteClosed (void) override
 The socket has been closed for any reason. More...
 
void SendData (const AString &a_Data)
 Sends the raw data over the link. More...
 

Protected Attributes

cBufferedSslContext m_Ssl
 
- Protected Attributes inherited from cHTTPServerConnection
std::unique_ptr< cHTTPIncomingRequestm_CurrentRequest
 The request being currently received Valid only between having parsed the headers and finishing receiving the body. More...
 
cHTTPServerm_HTTPServer
 The parent webserver that is to be notified of events on this connection. More...
 
cTCPLinkPtr m_Link
 The network link attached to this connection. More...
 
cHTTPMessageParser m_Parser
 The parser responsible for reading the requests. More...
 

Private Types

using Super = cHTTPServerConnection
 

Additional Inherited Members

- Protected Types inherited from cHTTPServerConnection
typedef std::map< AString, AStringcNameValueMap
 

Detailed Description

Definition at line 19 of file SslHTTPServerConnection.h.

Member Typedef Documentation

◆ Super

Definition at line 22 of file SslHTTPServerConnection.h.

Constructor & Destructor Documentation

◆ cSslHTTPServerConnection()

cSslHTTPServerConnection::cSslHTTPServerConnection ( cHTTPServer a_HTTPServer,
const std::shared_ptr< const cSslConfig > &  a_Config 
)

Creates a new connection on the specified server.

Sends the specified cert as the server certificate, uses the private key for decryption.

Definition at line 14 of file SslHTTPServerConnection.cpp.

◆ ~cSslHTTPServerConnection()

cSslHTTPServerConnection::~cSslHTTPServerConnection ( )
overridevirtual

Definition at line 34 of file SslHTTPServerConnection.cpp.

Member Function Documentation

◆ OnReceivedData()

void cSslHTTPServerConnection::OnReceivedData ( const char *  a_Data,
size_t  a_Size 
)
overrideprotectedvirtual

Data is received from the client.

Reimplemented from cHTTPServerConnection.

Definition at line 43 of file SslHTTPServerConnection.cpp.

◆ SendData()

void cSslHTTPServerConnection::SendData ( const void *  a_Data,
size_t  a_Size 
)
overrideprotectedvirtual

Called to send raw data over the link.

Descendants may provide data transformations (SSL etc.)

Reimplemented from cHTTPServerConnection.

Definition at line 86 of file SslHTTPServerConnection.cpp.

Member Data Documentation

◆ m_Ssl

cBufferedSslContext cSslHTTPServerConnection::m_Ssl
protected

Definition at line 33 of file SslHTTPServerConnection.h.


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