OverSim
|
A class to handle XML RPC requests from a particular client. More...
#include <XmlRpcServerConnection.h>
Public Member Functions | |
XmlRpcServerConnection (int fd, XmlRpcServer *server, bool deleteOnClose=false) | |
Constructor. | |
virtual | ~XmlRpcServerConnection () |
Destructor. | |
virtual unsigned | handleEvent (unsigned eventType) |
Handle IO on the client connection socket. | |
Public Member Functions inherited from XmlRpc::XmlRpcSource | |
XmlRpcSource (int fd=-1, bool deleteOnClose=false) | |
Constructor. | |
virtual | ~XmlRpcSource () |
Destructor. | |
int | getfd () const |
Return the file descriptor being monitored. | |
void | setfd (int fd) |
Specify the file descriptor to monitor. | |
bool | getKeepOpen () const |
Return whether the file descriptor should be kept open if it is no longer monitored. | |
void | setKeepOpen (bool b=true) |
Specify whether the file descriptor should be kept open if it is no longer monitored. | |
virtual void | close () |
Close the owned fd. If deleteOnClose was specified at construction, the object is deleted. |
Protected Types | |
enum | ServerConnectionState { READ_HEADER, READ_REQUEST, WRITE_RESPONSE } |
Possible IO states for the connection. More... |
Protected Member Functions | |
bool | readHeader () |
Reads the http header. | |
bool | readRequest () |
Reads the request (based on the content-length header value) | |
bool | writeResponse () |
Executes the request and writes the resulting response. | |
virtual void | executeRequest () |
Helper method to execute the client request. |
Protected Attributes | |
XmlRpcServer * | _server |
The XmlRpc server that accepted this connection. | |
ServerConnectionState | _connectionState |
Current IO state for the connection. | |
std::string | _header |
Request headers. | |
int | _contentLength |
Number of bytes expected in the request body (parsed from header) | |
std::string | _request |
Request body. | |
std::string | _response |
Response. | |
int | _bytesWritten |
Number of bytes of the response written so far. | |
bool | _keepAlive |
Whether to keep the current client connection open for further requests. |
Additional Inherited Members | |
Public Attributes inherited from XmlRpc::XmlRpcSource | |
bool | _ssl |
SSL_CTX * | _ssl_ctx |
SSL * | _ssl_ssl |
SSL_METHOD * | _ssl_meth |
A class to handle XML RPC requests from a particular client.
Definition at line 31 of file XmlRpcServerConnection.h.
|
protected |
Possible IO states for the connection.
Definition at line 64 of file XmlRpcServerConnection.h.
XmlRpcServerConnection::XmlRpcServerConnection | ( | int | fd, |
XmlRpcServer * | server, | ||
bool | deleteOnClose = false |
||
) |
Constructor.
Definition at line 26 of file XmlRpcServerConnection.cc.
|
virtual |
Destructor.
Definition at line 38 of file XmlRpcServerConnection.cc.
|
protectedvirtual |
Helper method to execute the client request.
Definition at line 208 of file XmlRpcServerConnection.cc.
Referenced by writeResponse().
|
virtual |
Handle IO on the client connection socket.
eventType | Type of IO event that occurred. |
Implements XmlRpc::XmlRpcSource.
Definition at line 49 of file XmlRpcServerConnection.cc.
|
protected |
Reads the http header.
Definition at line 66 of file XmlRpcServerConnection.cc.
Referenced by handleEvent().
|
protected |
Reads the request (based on the content-length header value)
Definition at line 145 of file XmlRpcServerConnection.cc.
Referenced by handleEvent().
|
protected |
Executes the request and writes the resulting response.
Definition at line 177 of file XmlRpcServerConnection.cc.
Referenced by handleEvent().
|
protected |
Number of bytes of the response written so far.
Definition at line 81 of file XmlRpcServerConnection.h.
Referenced by writeResponse().
|
protected |
Current IO state for the connection.
Definition at line 66 of file XmlRpcServerConnection.h.
Referenced by handleEvent(), readHeader(), readRequest(), writeResponse(), and XmlRpcServerConnection().
|
protected |
Number of bytes expected in the request body (parsed from header)
Definition at line 72 of file XmlRpcServerConnection.h.
Referenced by readHeader(), and readRequest().
|
protected |
Request headers.
Definition at line 69 of file XmlRpcServerConnection.h.
Referenced by readHeader(), and writeResponse().
|
protected |
Whether to keep the current client connection open for further requests.
Definition at line 84 of file XmlRpcServerConnection.h.
Referenced by readHeader(), writeResponse(), and XmlRpcServerConnection().
|
protected |
Request body.
Definition at line 75 of file XmlRpcServerConnection.h.
Referenced by executeRequest(), readHeader(), readRequest(), and writeResponse().
|
protected |
Response.
Definition at line 78 of file XmlRpcServerConnection.h.
Referenced by executeRequest(), and writeResponse().
|
protected |
The XmlRpc server that accepted this connection.
Definition at line 61 of file XmlRpcServerConnection.h.
Referenced by executeRequest(), XmlRpcServerConnection(), and ~XmlRpcServerConnection().