DUNE: Uniform Navigational Environment
2.3.2
|
Public Types | |
typedef std::map< std::string, std::string > | HeaderFieldsMap |
Public Member Functions | |
HTTPRequestHandler (void) | |
virtual | ~HTTPRequestHandler (void) |
virtual void | handleGET (TCPSocket *sock, Utils::TupleList &headers, const char *uri) |
virtual void | handlePOST (TCPSocket *sock, Utils::TupleList &headers, const char *uri) |
virtual void | handlePUT (TCPSocket *sock, Utils::TupleList &headers, const char *uri) |
void | sendHeader (TCPSocket *sock, const char *status_line, int64_t length, HeaderFieldsMap *hdr_fields=0) |
void | sendResponse100 (TCPSocket *sock) |
void | sendResponse201 (TCPSocket *sock) |
void | sendResponse200 (TCPSocket *sock) |
void | sendResponse403 (TCPSocket *sock) |
void | sendResponse404 (TCPSocket *sock, const std::string &message) |
void | sendResponse404 (TCPSocket *sock) |
void | sendResponse416 (TCPSocket *sock) |
void | sendResponse500 (TCPSocket *sock) |
void | sendResponse503 (TCPSocket *sock) |
void | sendData (TCPSocket *sock, const char *data, int size, HeaderFieldsMap *hdr_fields=0) |
void | sendData (TCPSocket *sock, const std::string &data, HeaderFieldsMap *hdr_fields=0) |
void | sendFile (TCPSocket *sock, const std::string &file, HeaderFieldsMap &hdr_fields, int64_t off_beg=-1, int64_t off_end=-1) |
void | handleRequest (TCPSocket *sock) |
typedef std::map<std::string, std::string> DUNE::Network::HTTPRequestHandler::HeaderFieldsMap |
|
inline |
|
inlinevirtual |
|
virtual |
References sendResponse404().
Referenced by handleRequest().
|
virtual |
References sendResponse404().
Referenced by handleRequest().
|
virtual |
References sendResponse404().
Referenced by handleRequest().
void HTTPRequestHandler::handleRequest | ( | TCPSocket * | sock | ) |
References DUNE::Network::URL::decode(), handleGET(), handlePOST(), handlePUT(), and DUNE::Network::TCPSocket::read().
void HTTPRequestHandler::sendData | ( | TCPSocket * | sock, |
const char * | data, | ||
int | size, | ||
HeaderFieldsMap * | hdr_fields = 0 |
||
) |
References sendHeader(), and DUNE::Network::TCPSocket::write().
Referenced by sendData().
|
inline |
References sendData().
void HTTPRequestHandler::sendFile | ( | TCPSocket * | sock, |
const std::string & | file, | ||
HeaderFieldsMap & | hdr_fields, | ||
int64_t | off_beg = -1 , |
||
int64_t | off_end = -1 |
||
) |
void HTTPRequestHandler::sendHeader | ( | TCPSocket * | sock, |
const char * | status_line, | ||
int64_t | length, | ||
HeaderFieldsMap * | hdr_fields = 0 |
||
) |
References DUNE::Time::Format::getRFC1123(), and DUNE::Network::TCPSocket::write().
Referenced by sendData(), sendFile(), sendResponse100(), sendResponse200(), sendResponse201(), sendResponse403(), sendResponse404(), sendResponse416(), sendResponse500(), and sendResponse503().
void HTTPRequestHandler::sendResponse100 | ( | TCPSocket * | sock | ) |
References sendHeader(), and DUNE::Network::TCPSocket::write().
void HTTPRequestHandler::sendResponse200 | ( | TCPSocket * | sock | ) |
References sendHeader(), and DUNE::Network::TCPSocket::write().
void HTTPRequestHandler::sendResponse201 | ( | TCPSocket * | sock | ) |
References sendHeader(), and DUNE::Network::TCPSocket::write().
void HTTPRequestHandler::sendResponse403 | ( | TCPSocket * | sock | ) |
References sendHeader(), and DUNE::Network::TCPSocket::write().
void HTTPRequestHandler::sendResponse404 | ( | TCPSocket * | sock, |
const std::string & | message | ||
) |
References sendHeader(), and DUNE::Network::TCPSocket::write().
Referenced by handleGET(), handlePOST(), handlePUT(), sendFile(), and sendResponse404().
|
inline |
References sendResponse404().
void HTTPRequestHandler::sendResponse416 | ( | TCPSocket * | sock | ) |
References sendHeader(), and DUNE::Network::TCPSocket::write().
Referenced by sendFile().
void HTTPRequestHandler::sendResponse500 | ( | TCPSocket * | sock | ) |
References sendHeader(), and DUNE::Network::TCPSocket::write().
void HTTPRequestHandler::sendResponse503 | ( | TCPSocket * | sock | ) |
References sendHeader(), and DUNE::Network::TCPSocket::write().