rsstats 0.0.1
Redis Enterprise Statistic collector
libhttp.c File Reference

HTTP parsing and building library. More...

#include "libhttp.h"
#include "sclist.h"
#include "base64.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
Include dependency graph for libhttp.c:

Go to the source code of this file.

Classes

struct  HTTP_s
 
struct  HTTPHeader_s
 

Typedefs

typedef struct HTTP_s HTTP_t
 
typedef struct HTTPHeader_s HTTPHeader_t
 

Functions

HTTPHeader_tHTTPHeader_new (const char *name, const char *value)
 
void HTTPHeader_del (HTTPHeader_t *header)
 
HTTPHeader_tHTTPHeader_basicauth (const char *login, const char *pass)
 
char * HTTPHeader_getname (HTTPHeader_t *header)
 
char * HTTPHeader_getvalue (HTTPHeader_t *header)
 
HTTP_tHTTP_new ()
 
void HTTP_del (HTTP_t *http)
 
char * HTTP_setbody (HTTP_t *http, const char *body)
 
char * HTTP_getbody (HTTP_t *http)
 
HTTP_tHTTP_addheader (HTTP_t *http, HTTPHeader_t *header)
 
HTTPHeader_tHTTP_firstheader (const HTTP_t *http)
 
HTTPHeader_tHTTP_nextheader (const HTTPHeader_t *header)
 
HTTPHeader_tHTTP_findheader (const HTTPHeader_t *start, const char *name, const char *value)
 
HTTP_tHTTP_delheader (HTTP_t *http, HTTPHeader_t *header)
 
char * HTTP_buildrequest (const HTTPMethod_t method, const char *uri, const HTTPVersion_t version)
 
char * HTTP_buildheaders (const HTTP_t *http)
 

Detailed Description

HTTP parsing and building library.

Author
François Cerbelle (Fanfan), franc.nosp@m.ois@.nosp@m.cerbe.nosp@m.lle..nosp@m.net

Definition in file libhttp.c.

Typedef Documentation

◆ HTTP_t

typedef struct HTTP_s HTTP_t

◆ HTTPHeader_t

typedef struct HTTPHeader_s HTTPHeader_t

Function Documentation

◆ HTTP_addheader()

HTTP_t * HTTP_addheader ( HTTP_t http,
HTTPHeader_t header 
)

Definition at line 185 of file libhttp.c.

Here is the call graph for this function:

◆ HTTP_buildheaders()

char * HTTP_buildheaders ( const HTTP_t http)
Todo:
: OOM tests

Definition at line 350 of file libhttp.c.

Here is the call graph for this function:

◆ HTTP_buildrequest()

char * HTTP_buildrequest ( const HTTPMethod_t  method,
const char *  uri,
const HTTPVersion_t  version 
)

Definition at line 277 of file libhttp.c.

◆ HTTP_del()

void HTTP_del ( HTTP_t http)

Definition at line 138 of file libhttp.c.

Here is the call graph for this function:

◆ HTTP_delheader()

HTTP_t * HTTP_delheader ( HTTP_t http,
HTTPHeader_t header 
)
Todo:
: make sclist_remrecord return a status and use it

Definition at line 257 of file libhttp.c.

Here is the call graph for this function:

◆ HTTP_findheader()

HTTPHeader_t * HTTP_findheader ( const HTTPHeader_t start,
const char *  name,
const char *  value 
)

Definition at line 227 of file libhttp.c.

Here is the call graph for this function:

◆ HTTP_firstheader()

HTTPHeader_t * HTTP_firstheader ( const HTTP_t http)

Definition at line 204 of file libhttp.c.

Here is the call graph for this function:

◆ HTTP_getbody()

char * HTTP_getbody ( HTTP_t http)

Definition at line 178 of file libhttp.c.

◆ HTTP_new()

HTTP_t * HTTP_new ( )

Definition at line 113 of file libhttp.c.

Here is the call graph for this function:

◆ HTTP_nextheader()

HTTPHeader_t * HTTP_nextheader ( const HTTPHeader_t header)

Definition at line 213 of file libhttp.c.

Here is the call graph for this function:

◆ HTTP_setbody()

char * HTTP_setbody ( HTTP_t http,
const char *  body 
)

Definition at line 161 of file libhttp.c.

◆ HTTPHeader_basicauth()

HTTPHeader_t * HTTPHeader_basicauth ( const char *  login,
const char *  pass 
)

Definition at line 74 of file libhttp.c.

Here is the call graph for this function:

◆ HTTPHeader_del()

void HTTPHeader_del ( HTTPHeader_t header)

Definition at line 64 of file libhttp.c.

◆ HTTPHeader_getname()

char * HTTPHeader_getname ( HTTPHeader_t header)

Definition at line 103 of file libhttp.c.

Here is the caller graph for this function:

◆ HTTPHeader_getvalue()

char * HTTPHeader_getvalue ( HTTPHeader_t header)

Definition at line 108 of file libhttp.c.

Here is the caller graph for this function:

◆ HTTPHeader_new()

HTTPHeader_t * HTTPHeader_new ( const char *  name,
const char *  value 
)

Definition at line 39 of file libhttp.c.

Here is the caller graph for this function: