Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

HTTPServer Class Reference

#include <HTTPServer.h>

List of all members.

Public Methods

 HTTPServer (char *root_dir)
 ~HTTPServer ()
int createSocket (int port=0)
void acceptRequest (int sock)
void waitRequest ()
void msg200OK (int sock)
void sendFile (int sock, const char *file)
void execCGIPost (int sock, const char *path, const char *method, const char *query_string)
void execCGIGet ()
void msg400BadRequest (int sock)
void msg404NotFound (int sock)
void msg500InternalError (int sock)
void msg501Unimplemented (int sock)

Private Methods

int getLine (int sock, char *buf, int size)

Private Attributes

int srv_fd
int srv_port
sockaddr_in srv_addr
char * root


Constructor & Destructor Documentation

HTTPServer::HTTPServer char *    root_dir
 

Definition at line 39 of file HTTPServer.cpp.

References srv_fd.

HTTPServer::~HTTPServer  
 

Definition at line 46 of file HTTPServer.cpp.


Member Function Documentation

void HTTPServer::acceptRequest int    sock
 

Definition at line 57 of file HTTPServer.cpp.

References execCGIPost(), getLine(), ISspace, msg404NotFound(), msg501Unimplemented(), and sendFile().

Referenced by waitRequest().

int HTTPServer::createSocket int    port = 0
 

Definition at line 409 of file HTTPServer.cpp.

References srv_addr, srv_fd, and srv_port.

void HTTPServer::execCGIGet  
 

void HTTPServer::execCGIPost int    sock,
const char *    path,
const char *    method,
const char *    query_string
 

Definition at line 211 of file HTTPServer.cpp.

References getLine(), msg400BadRequest(), and msg500InternalError().

Referenced by acceptRequest().

int HTTPServer::getLine int    sock,
char *    buf,
int    size
[private]
 

Definition at line 312 of file HTTPServer.cpp.

Referenced by acceptRequest(), execCGIPost(), and sendFile().

void HTTPServer::msg200OK int    sock
 

Definition at line 350 of file HTTPServer.cpp.

References SERVER_STRING.

Referenced by sendFile().

void HTTPServer::msg400BadRequest int    sock
 

Definition at line 140 of file HTTPServer.cpp.

Referenced by execCGIPost().

void HTTPServer::msg404NotFound int    sock
 

Definition at line 160 of file HTTPServer.cpp.

References SERVER_STRING.

Referenced by acceptRequest(), and sendFile().

void HTTPServer::msg500InternalError int    sock
 

Definition at line 189 of file HTTPServer.cpp.

Referenced by execCGIPost().

void HTTPServer::msg501Unimplemented int    sock
 

Definition at line 442 of file HTTPServer.cpp.

References SERVER_STRING.

Referenced by acceptRequest().

void HTTPServer::sendFile int    sock,
const char *    file
 

Definition at line 372 of file HTTPServer.cpp.

References getLine(), msg200OK(), and msg404NotFound().

Referenced by acceptRequest().

void HTTPServer::waitRequest  
 

Definition at line 465 of file HTTPServer.cpp.

References acceptRequest(), and srv_fd.


Member Data Documentation

char* HTTPServer::root [private]
 

Definition at line 24 of file HTTPServer.h.

struct sockaddr_in HTTPServer::srv_addr [private]
 

Definition at line 23 of file HTTPServer.h.

Referenced by createSocket().

int HTTPServer::srv_fd [private]
 

Definition at line 21 of file HTTPServer.h.

Referenced by createSocket(), HTTPServer(), and waitRequest().

int HTTPServer::srv_port [private]
 

Definition at line 22 of file HTTPServer.h.

Referenced by createSocket().


The documentation for this class was generated from the following files:
Generated on Mon Nov 25 12:46:37 2002 for qadpz by doxygen1.2.18