http.c File Reference

#include "http.h"
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <signal.h>
#include "hashtable.h"
#include "hashlist.h"
#include "trie.h"
#include "vector.h"
#include "log.h"
#include "util.h"
#include "socket.h"

Go to the source code of this file.

Data Structures

struct  cp_http_status_code_entry

Defines

#define HTTP_PARSE_BUFSIZE   0xFFFF
#define MATCHMAX   10
#define HTTP_RE_MATCHMAX   10
#define REQUEST_STAGE_START   0
#define REQUEST_STAGE_STATUS_LINE   1
#define REQUEST_STAGE_HEADERS   2
#define REQUEST_STAGE_BODY   3
#define REQUEST_STAGE_DONE   4
#define HEXDIGIT(c)

Functions

void cp_http_signal_handler (int sig)
void * session_cleanup_thread (void *)
int cp_http_init ()
void cp_httpsocket_stop_all ()
void cp_httpsocket_stop (cp_httpsocket *sock)
void * cp_http_add_shutdown_callback (void(*cb)(void *), void *prm)
void cp_http_shutdown ()
void cp_http_request_delete (cp_http_request *request)
char * get_http_request_type_lit (cp_http_request_type type)
void urldecode (char *str, char **decoded)
char * cp_http_request_get_header (cp_http_request *req, char *header)
char ** cp_http_request_get_headers (cp_http_request *request)
char * cp_http_request_get_parameter (cp_http_request *request, char *name)
void cp_http_request_dump (cp_http_request *req)
cp_http_responsecp_http_response_create (cp_http_request *req)
void cp_http_response_delete (cp_http_response *response)
void cp_http_response_destroy (cp_http_response *res)
int cp_http_response_write (cp_connection_descriptor *cdesc, cp_http_response *res)
void cp_http_response_set_status (cp_http_response *response, cp_http_status_code status)
cp_http_status_code cp_http_response_get_status (cp_http_response *response)
void cp_http_response_set_content_type (cp_http_response *response, cp_http_content_type type)
void cp_http_response_set_content_type_string (cp_http_response *response, char *content_type)
char * cp_http_response_get_content_type (cp_http_response *response)
void cp_http_response_set_header (cp_http_response *response, char *name, char *value)
char * cp_http_response_get_header (cp_http_response *response, char *name)
cp_vector * cp_http_response_get_header_names (cp_http_response *response)
void cp_http_response_set_body (cp_http_response *response, char *body)
void cp_http_response_set_content (cp_http_response *response, cp_string *content)
cp_stringcp_http_response_get_content (cp_http_response *response)
void cp_http_response_set_connection_policy (cp_http_response *response, connection_policy policy)
void cp_http_response_skip (cp_http_response *response)
cp_httpsocketcp_httpsocket_create (int port, cp_http_service_callback service)
void cp_httpsocket_set_keepalive (cp_httpsocket *socket, int sec)
void cp_httpsocket_set_server_name (cp_httpsocket *socket, char *name)
void cp_httpsocket_set_backlog (cp_httpsocket *socket, int backlog)
void cp_httpsocket_set_delay (cp_httpsocket *socket, struct timeval delay)
void cp_httpsocket_set_delay_sec (cp_httpsocket *socket, long sec)
void cp_httpsocket_set_delay_usec (cp_httpsocket *socket, long usec)
void cp_httpsocket_set_poolsize_min (cp_httpsocket *socket, int min)
void cp_httpsocket_set_poolsize_max (cp_httpsocket *socket, int max)
void cp_httpsocket_delete (cp_httpsocket *sock)
void * cp_httpsocket_add_shutdown_callback (cp_httpsocket *socket, void(*cb)(void *), void *prm)
int cp_httpsocket_listen (cp_httpsocket *sock)
int cp_httpsocket_register_service (cp_httpsocket *server, cp_http_service *service)
void * cp_httpsocket_unregister_service (cp_httpsocket *server, cp_http_service *service)
cp_http_servicecp_http_service_create (char *name, char *path, cp_http_service_callback callback)
void cp_http_service_delete (cp_http_service *service)
void cp_http_response_report_error (cp_http_response *response, cp_http_status_code code, char *message)
void * cp_http_thread_fn (void *prm)

Variables

cp_http_status_code_entry cp_http_status_code_list []
volatile int cp_http_stopping = 0


Detailed Description

http framework implementation

Definition in file http.c.


Generated on Mon Dec 5 23:00:22 2011 for cprops by  doxygen 1.4.7