summaryrefslogtreecommitdiffstats
path: root/src/HTTPServer/HTTPServer.h
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
commit6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch)
tree7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/HTTPServer/HTTPServer.h
parentMerge pull request #2958 from LogicParrot/fence (diff)
parentBulk clearing of whitespace (diff)
downloadcuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip
Diffstat (limited to 'src/HTTPServer/HTTPServer.h')
-rw-r--r--src/HTTPServer/HTTPServer.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/HTTPServer/HTTPServer.h b/src/HTTPServer/HTTPServer.h
index d626fb475..2a094b413 100644
--- a/src/HTTPServer/HTTPServer.h
+++ b/src/HTTPServer/HTTPServer.h
@@ -39,48 +39,48 @@ public:
{
public:
virtual ~cCallbacks() {}
-
+
/** Called when a new request arrives over a connection and all its headers have been parsed.
The request body needn't have arrived yet. */
virtual void OnRequestBegun(cHTTPConnection & a_Connection, cHTTPRequest & a_Request) = 0;
-
+
/** Called when another part of request body has arrived.
May be called multiple times for a single request. */
virtual void OnRequestBody(cHTTPConnection & a_Connection, cHTTPRequest & a_Request, const char * a_Data, size_t a_Size) = 0;
-
+
/** Called when the request body has been fully received in previous calls to OnRequestBody() */
virtual void OnRequestFinished(cHTTPConnection & a_Connection, cHTTPRequest & a_Request) = 0;
} ;
-
+
cHTTPServer(void);
virtual ~cHTTPServer();
-
+
/** Initializes the server - reads the cert files etc. */
bool Initialize(void);
-
+
/** Starts the server and assigns the callbacks to use for incoming requests */
bool Start(cCallbacks & a_Callbacks, const AStringVector & a_Ports);
-
+
/** Stops the server, drops all current connections */
void Stop(void);
-
+
protected:
friend class cHTTPConnection;
friend class cSslHTTPConnection;
friend class cHTTPServerListenCallbacks;
-
+
/** The cNetwork API handle for the listening socket. */
cServerHandlePtrs m_ServerHandles;
-
+
/** The callbacks to call for various events */
cCallbacks * m_Callbacks;
-
+
/** The server certificate to use for the SSL connections */
cX509CertPtr m_Cert;
-
+
/** The private key for m_Cert. */
cCryptoKeyPtr m_CertPrivKey;
-
+
/** Called by cHTTPServerListenCallbacks when there's a new incoming connection.
Returns the connection instance to be used as the cTCPLink callbacks. */
@@ -88,11 +88,11 @@ protected:
/** Called by cHTTPConnection when it finishes parsing the request header */
void NewRequest(cHTTPConnection & a_Connection, cHTTPRequest & a_Request);
-
+
/** Called by cHTTPConenction when it receives more data for the request body.
May be called multiple times for a single request. */
void RequestBody(cHTTPConnection & a_Connection, cHTTPRequest & a_Request, const char * a_Data, size_t a_Size);
-
+
/** Called by cHTTPConnection when it detects that the request has finished (all of its body has been received) */
void RequestFinished(cHTTPConnection & a_Connection, cHTTPRequest & a_Request);
} ;