Public Types | |
|
typedef std::shared_ptr < HTTPConnection > | shared |
Public Member Functions | |
| HTTPConnection (const HTTP &http, sella::net::TCPSocket::shared &socket, timeval tv=ReceiveTimeoutDefault) throw () | |
| const HTTPRequest & | getRequest (void) throw (ServerException) |
| bool | isUsable (void) throw () |
| void | response (const std::string &body, const std::string &contentType=ContentTypeDefault, bool close=true) throw (ServerException) |
| void | response (const std::vector< char > &content, const std::string &contentType, bool close=true) throw (ServerException) |
| void | error (int code, const std::string &detail=std::string()) throw (ServerException) |
| void | error (int code, const std::vector< char > &content, const std::string &contentType) throw (ServerException) |
| void | methodOptions (void) throw (ServerException) |
| void | methodGet (void) throw (ServerException) |
| void | methodHead (void) throw (ServerException) |
| void | methodPost (void) throw (ServerException) |
| void | methodPut (void) throw (ServerException) |
| void | methodDelete (void) throw (ServerException) |
| void | methodTrace (void) throw (ServerException) |
| void | methodConnect (void) throw (ServerException) |
| void | methodPatch (void) throw (ServerException) |
| sella::net::IPAddressPort | getLocalIPAddressPort (void) const throw (ServerException) |
| sella::net::IPAddressPort | getRemoteIPAddressPort (void) const throw (ServerException) |
| void | clear (void) throw () |
Static Public Member Functions | |
| static const HTTPConnection::shared | shared_ptr (const HTTP &http, sella::net::TCPSocket::shared &socket, timeval tv=ReceiveTimeoutDefault) throw () |
Static Public Attributes | |
| static const timeval | ReceiveTimeoutDefault = { 30, 0 } |
| static const std::string | MIMEFallback = "text/plain; charset=us-ascii" |
| static const std::string | ContentTypeDefault = "text/html; charset=iso-8859-1" |
Protected Member Functions | |
| void | response (int code, const std::string &body, const std::string &contentType=ContentTypeDefault, bool close=true) throw (ServerException) |
| void | response (int code, const std::vector< char > &content, const std::string &contentType, bool close=true) throw (ServerException) |
| void | sendStatusLine (int code, const std::string &detail=std::string()) throw (sella::net::SocketException) |
| void | sendHeaders (size_t size, const std::string &contentType=ContentTypeDefault, bool close=true) throw (sella::net::SocketException) |
| void | sendBody (const std::string &body) throw (sella::net::SocketException) |
| void | sendContent (const std::vector< char > &content) throw (sella::net::SocketException) |
| void | read (std::string &buffer) throw (ServerException) |
| void | chunker (void) throw (ServerException) |
| bool | isDirectory (const std::string &path) const throw () |
| bool | isFile (const std::string &file) const throw () |
| const std::string | buildHeaders (size_t contentSize, const std::string &contentType=ContentTypeDefault, bool close=true, bool useAllow=false, const std::string &transferEncoding=std::string()) throw () |
| std::string | statusCodeString (int code) throw () |
| std::string | getMIMEType (const std::string &file, const std::string &fallback=std::string()) const throw (ServerException) |
| std::string | getFullpath (const std::string &file=std::string()) throw (ServerException) |
| void | getFileContent (const std::string &file, std::vector< char > &content, std::string &contentType) throw (ServerException) |
| size_t | getFileSize (std::ifstream &ifile) throw (ServerException) |
| std::string | getErrorBody (int code, const std::string &detail=std::string()) throw () |
Protected Attributes | |
| const HTTP & | http |
| sella::net::TCPSocket::shared | socket |
| HTTPRequest | request |
Definition at line 29 of file HTTPConnection.h.
1.6.1