rsstats 0.0.1
Redis Enterprise Statistic collector
libhttp.h File Reference

HTTP parsing and building library. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum HTTPVersion_e HTTPVersion_t
 
typedef enum HTTPMethod_e HTTPMethod_t
 
typedef struct HTTPHeader_s HTTPHeader_t
 
typedef struct HTTP_s HTTP_t
 

Enumerations

enum  HTTPVersion_e {
  HTTPVERSION_HTTP09 , HTTPVERSION_HTTP10 , HTTPVERSION_HTTP11 , HTTPVERSION_HTTP11b ,
  HTTPVERSION_HTTP2 , HTTPVERSION_HTTP3 , HTTPVERSION_INVALID
}
 
enum  HTTPMethod_e {
  HTTPMETHOD_GET , HTTPMETHOD_HEAD , HTTPMETHOD_POST , HTTPMETHOD_PUT ,
  HTTPMETHOD_DELETE , HTTPMETHOD_CONNECT , HTTPMETHOD_OPTIONS , HTTPMETHOD_TRACE ,
  HTTPMETHOD_PATCH , HTTPMETHOD_INVALID
}
 

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.

<+DETAILED+>

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

Definition in file libhttp.h.

Typedef Documentation

◆ HTTP_t

typedef struct HTTP_s HTTP_t

Definition at line 55 of file libhttp.h.

◆ HTTPHeader_t

typedef struct HTTPHeader_s HTTPHeader_t

Definition at line 47 of file libhttp.h.

◆ HTTPMethod_t

typedef enum HTTPMethod_e HTTPMethod_t

◆ HTTPVersion_t

Enumeration Type Documentation

◆ HTTPMethod_e

Enumerator
HTTPMETHOD_GET 
HTTPMETHOD_HEAD 
HTTPMETHOD_POST 
HTTPMETHOD_PUT 
HTTPMETHOD_DELETE 
HTTPMETHOD_CONNECT 
HTTPMETHOD_OPTIONS 
HTTPMETHOD_TRACE 
HTTPMETHOD_PATCH 
HTTPMETHOD_INVALID 

Definition at line 34 of file libhttp.h.

◆ HTTPVersion_e

Enumerator
HTTPVERSION_HTTP09 
HTTPVERSION_HTTP10 
HTTPVERSION_HTTP11 
HTTPVERSION_HTTP11b 
HTTPVERSION_HTTP2 
HTTPVERSION_HTTP3 
HTTPVERSION_INVALID 

Definition at line 24 of file libhttp.h.

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: