My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Macros | Functions
connection-handler.h File Reference
#include <openssl/ssl.h>
#include "webserver.h"
#include "dbops.h"
#include "request_parser.h"

Go to the source code of this file.

Classes

struct  connection
 
struct  read_state
 
struct  http_state
 
struct  response_state
 

Macros

#define MAX_HEADER_LEN   4096
 
#define MAX_FILEPATH_LEN   512
 
#define MAX_BODY_LEN   4096
 
#define MAX_RECV_LEN   4096
 

Functions

void init_read_state (struct read_state *state, struct connection *conn)
 
void init_http_state (struct http_state *state, struct connection *conn)
 
void init_response_state (struct response_state *state, struct connection *conn)
 
void init_connection (struct connection *conn, int fd)
 
int accept_connection (struct connection *conn, int use_ssl)
 
int read_request (struct read_state *state)
 
int parse_request (char *req, int req_len, struct http_state *state)
 
int write_response (struct response_state *state)
 
int close_connection (struct connection *conn)
 
int access_database (char *url, struct db_state *state)
 
int has_regex (char *url)
 
int craft_error_response (char *url, char *response)
 
int craft_nonregex_response (char *url, char *response)
 
int craft_regex_response (char *url, char *response)
 

Macro Definition Documentation

#define MAX_BODY_LEN   4096

Definition at line 30 of file connection-handler.h.

#define MAX_FILEPATH_LEN   512

Definition at line 29 of file connection-handler.h.

#define MAX_HEADER_LEN   4096

Definition at line 28 of file connection-handler.h.

#define MAX_RECV_LEN   4096

Definition at line 31 of file connection-handler.h.

Function Documentation

int accept_connection ( struct connection conn,
int  use_ssl 
)

Definition at line 64 of file connection-handler.c.

int access_database ( char *  url,
struct db_state state 
)

Definition at line 173 of file connection-handler.c.

int close_connection ( struct connection conn)

Definition at line 298 of file connection-handler.c.

int craft_error_response ( char *  url,
char *  response 
)

Definition at line 207 of file connection-handler.c.

int craft_nonregex_response ( char *  url,
char *  response 
)

Definition at line 213 of file connection-handler.c.

int craft_regex_response ( char *  url,
char *  response 
)

Definition at line 220 of file connection-handler.c.

int has_regex ( char *  url)

Definition at line 138 of file connection-handler.c.

void init_connection ( struct connection conn,
int  fd 
)

Definition at line 36 of file connection-handler.c.

void init_http_state ( struct http_state state,
struct connection conn 
)

Definition at line 48 of file connection-handler.c.

void init_read_state ( struct read_state state,
struct connection conn 
)

Definition at line 42 of file connection-handler.c.

void init_response_state ( struct response_state state,
struct connection conn 
)

Definition at line 54 of file connection-handler.c.

int parse_request ( char *  req,
int  req_len,
struct http_state state 
)

Definition at line 117 of file connection-handler.c.

int read_request ( struct read_state state)

Definition at line 87 of file connection-handler.c.

int write_response ( struct response_state state)

Definition at line 239 of file connection-handler.c.