HomePort
Data Structures | Functions | Variables
http-webserver_test.c File Reference
Include dependency graph for http-webserver_test.c:

Go to the source code of this file.

Data Structures

struct  data
 

Functions

static int basic_get_test (enum http_method method, char *host, char *path)
 
static int construct_body (char *body, int len, struct data *data)
 
static size_t data_from_curl (char *buffer, size_t buffer_size, size_t nmemb, char **userdata)
 
static size_t data_to_curl (void *ptr, size_t size, size_t nmemb, void *userdata)
 
static void exit_cb (EV_P_ ev_async *watcher, int revents)
 Exit callback for async watcher (Webserver) More...
 
static void exit_handler (int sig)
 Handle correct exiting. More...
 
int main (int argc, char *argv[])
 Main function. More...
 
static char * ncat (char *s1, const char *s2, int s2_len)
 
static int on_req_begin (struct httpws *ins, struct http_request *req, void *ws_ctx, void **req_data)
 
static int on_req_body (struct httpws *ins, struct http_request *req, void *ws_ctx, void **req_data, const char *buf, size_t len)
 
static int on_req_cmpl (struct httpws *ins, struct http_request *req, void *ws_ctx, void **req_data)
 
static int on_req_hdr_cmpl (struct httpws *ins, struct http_request *req, void *ws_ctx, void **req_data)
 
static int on_req_hdr_field (struct httpws *ins, struct http_request *req, void *ws_ctx, void **req_data, const char *buf, size_t len)
 
static int on_req_hdr_value (struct httpws *ins, struct http_request *req, void *ws_ctx, void **req_data, const char *buf, size_t len)
 
static int on_req_method (struct httpws *ins, struct http_request *req, void *ws_ctx, void **req_data, const char *buf, size_t len)
 
static int on_req_url (struct httpws *ins, struct http_request *req, void *ws_ctx, void **req_data, const char *buf, size_t len)
 
static int on_req_url_cmpl (struct httpws *ins, struct http_request *req, void *ws_ctx, void **req_data)
 
static char * simple_get_request (char *url)
 
static int test_thread ()
 Test thread. More...
 
static void * webserver_thread (void *arg)
 Webserver thread. More...
 

Variables

static struct ev_async exit_watcher
 
static struct ev_loop * loop
 
static char * req_data = "Hello world"
 
static int started = 0
 
static struct httpws * ws = NULL
 

Data Structure Documentation

struct data

Definition at line 32 of file header_parser_test.c.

Collaboration diagram for data:
Data Fields
int _errors
char * body
int call_order
int count
int cur_key_value
int cur_path
int errors
char * field
int hdr_count
char * hdr_field
int hdr_field_l
char * hdr_value
int hdr_value_l
char * host
char * key
char * method
char * path
char * port
char * protocol
int state
char * url
char * value

Function Documentation

static int basic_get_test ( enum http_method  method,
char *  host,
char *  path 
)
static

Definition at line 136 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int construct_body ( char *  body,
int  len,
struct data data 
)
static

Definition at line 394 of file http-webserver_test.c.

Here is the caller graph for this function:

static size_t data_from_curl ( char *  buffer,
size_t  buffer_size,
size_t  nmemb,
char **  userdata 
)
static

Definition at line 57 of file http-webserver_test.c.

Here is the caller graph for this function:

static size_t data_to_curl ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  userdata 
)
static

Definition at line 67 of file http-webserver_test.c.

Here is the caller graph for this function:

static void exit_cb ( EV_P_ ev_async *  watcher,
int  revents 
)
static

Exit callback for async watcher (Webserver)

Definition at line 469 of file http-webserver_test.c.

Here is the caller graph for this function:

static void exit_handler ( int  sig)
static

Handle correct exiting.

Definition at line 462 of file http-webserver_test.c.

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Main function.

Definition at line 525 of file http-webserver_test.c.

Here is the call graph for this function:

static char* ncat ( char *  s1,
const char *  s2,
int  s2_len 
)
static

Definition at line 215 of file http-webserver_test.c.

Here is the caller graph for this function:

static int on_req_begin ( struct httpws *  ins,
struct http_request *  req,
void *  ws_ctx,
void **  req_data 
)
static

Definition at line 225 of file http-webserver_test.c.

Here is the caller graph for this function:

static int on_req_body ( struct httpws *  ins,
struct http_request *  req,
void *  ws_ctx,
void **  req_data,
const char *  buf,
size_t  len 
)
static

Definition at line 378 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int on_req_cmpl ( struct httpws *  ins,
struct http_request *  req,
void *  ws_ctx,
void **  req_data 
)
static

Definition at line 412 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int on_req_hdr_cmpl ( struct httpws *  ins,
struct http_request *  req,
void *  ws_ctx,
void **  req_data 
)
static

Definition at line 353 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int on_req_hdr_field ( struct httpws *  ins,
struct http_request *  req,
void *  ws_ctx,
void **  req_data,
const char *  buf,
size_t  len 
)
static

Definition at line 297 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int on_req_hdr_value ( struct httpws *  ins,
struct http_request *  req,
void *  ws_ctx,
void **  req_data,
const char *  buf,
size_t  len 
)
static

Definition at line 324 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int on_req_method ( struct httpws *  ins,
struct http_request *  req,
void *  ws_ctx,
void **  req_data,
const char *  buf,
size_t  len 
)
static

Definition at line 246 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int on_req_url ( struct httpws *  ins,
struct http_request *  req,
void *  ws_ctx,
void **  req_data,
const char *  buf,
size_t  len 
)
static

Definition at line 262 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int on_req_url_cmpl ( struct httpws *  ins,
struct http_request *  req,
void *  ws_ctx,
void **  req_data 
)
static

Definition at line 278 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static char* simple_get_request ( char *  url)
static

Definition at line 93 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int test_thread ( )
static

Test thread.

Definition at line 189 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void* webserver_thread ( void *  arg)
static

Webserver thread.

Definition at line 482 of file http-webserver_test.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

struct ev_async exit_watcher
static

Definition at line 55 of file http-webserver_test.c.

struct ev_loop* loop
static

Definition at line 54 of file http-webserver_test.c.

char* req_data = "Hello world"
static

Definition at line 50 of file http-webserver_test.c.

int started = 0
static

Definition at line 52 of file http-webserver_test.c.

struct httpws* ws = NULL
static

Definition at line 53 of file http-webserver_test.c.