DUNE: Uniform Navigational Environment  2019.02.1
Transports::HTTP::RequestHandler Class Reference

Public Types

typedef std::map< std::string, std::string > HeaderFieldsMap
 

Public Member Functions

 RequestHandler (void)
 
virtual ~RequestHandler (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)
 

Member Typedef Documentation

typedef std::map<std::string, std::string> Transports::HTTP::RequestHandler::HeaderFieldsMap

Constructor & Destructor Documentation

Transports::HTTP::RequestHandler::RequestHandler ( void  )
inline
virtual Transports::HTTP::RequestHandler::~RequestHandler ( void  )
inlinevirtual

Member Function Documentation

void Transports::HTTP::RequestHandler::handleGET ( TCPSocket *  sock,
Utils::TupleList &  headers,
const char *  uri 
)
virtual

References sendResponse404().

Referenced by handleRequest(), and ~RequestHandler().

void Transports::HTTP::RequestHandler::handlePOST ( TCPSocket *  sock,
Utils::TupleList &  headers,
const char *  uri 
)
virtual

References sendResponse404().

Referenced by handleRequest(), and ~RequestHandler().

void Transports::HTTP::RequestHandler::handlePUT ( TCPSocket *  sock,
Utils::TupleList &  headers,
const char *  uri 
)
virtual

References sendResponse404().

Referenced by handleRequest(), and ~RequestHandler().

void Transports::HTTP::RequestHandler::handleRequest ( TCPSocket *  sock)
void Transports::HTTP::RequestHandler::sendData ( TCPSocket *  sock,
const char *  data,
int  size,
HeaderFieldsMap hdr_fields = 0 
)

References sendHeader().

Referenced by sendData(), and sendResponse404().

void Transports::HTTP::RequestHandler::sendData ( TCPSocket *  sock,
const std::string &  data,
HeaderFieldsMap hdr_fields = 0 
)
inline
void Transports::HTTP::RequestHandler::sendFile ( TCPSocket *  sock,
const std::string &  file,
HeaderFieldsMap hdr_fields,
int64_t  off_beg = -1,
int64_t  off_end = -1 
)

References sendHeader(), sendResponse404(), and sendResponse416().

Referenced by sendData().

void Transports::HTTP::RequestHandler::sendHeader ( TCPSocket *  sock,
const char *  status_line,
int64_t  length,
HeaderFieldsMap hdr_fields = 0 
)
void Transports::HTTP::RequestHandler::sendResponse100 ( TCPSocket *  sock)

References sendHeader().

Referenced by ~RequestHandler().

void Transports::HTTP::RequestHandler::sendResponse200 ( TCPSocket *  sock)

References sendHeader().

Referenced by ~RequestHandler().

void Transports::HTTP::RequestHandler::sendResponse201 ( TCPSocket *  sock)

References sendHeader().

Referenced by ~RequestHandler().

void Transports::HTTP::RequestHandler::sendResponse403 ( TCPSocket *  sock)

References sendHeader().

Referenced by ~RequestHandler().

void Transports::HTTP::RequestHandler::sendResponse404 ( TCPSocket *  sock,
const std::string &  message 
)
void Transports::HTTP::RequestHandler::sendResponse404 ( TCPSocket *  sock)
inline
void Transports::HTTP::RequestHandler::sendResponse416 ( TCPSocket *  sock)

References sendHeader().

Referenced by sendFile(), and sendResponse404().

void Transports::HTTP::RequestHandler::sendResponse500 ( TCPSocket *  sock)

References sendHeader().

Referenced by sendResponse404().

void Transports::HTTP::RequestHandler::sendResponse503 ( TCPSocket *  sock)

References sendHeader().

Referenced by sendResponse404().

Collaboration diagram for Transports::HTTP::RequestHandler:
Collaboration graph