http 1.12.11devel
|
Typedefs and prototypes used by HTTP parser. More...
#include <sofia-sip/su_alloc.h>
#include <sofia-sip/msg.h>
#include <sofia-sip/msg_parser.h>
#include <sofia-sip/http.h>
#include <sofia-sip/http_header.h>
Go to the source code of this file.
Macros | |
#define | HTTP_PARSER_H |
Defined when <sofia-sip/http_parser.h> has been included. | |
#define | HTTP_HEADER_CLASS(c, l, params, kind, dup) |
Define a header class for a HTTP header. | |
#define | HTTP_HEADER_CLASS_G(c, l, kind) |
This is used by headers with no extra data in copy. | |
#define | HTTP_HEADER_CLASS_LIST(c, l, kind) |
Define a header class for a msg_list_t kind of header. | |
#define | HTTP_HEADER_CLASS_AUTH(c, l, kind) |
Define a authorization header class. | |
Functions | |
int | http_version_d (char **ss, char const **ver) |
Parse HTTP version. | |
isize_t | http_version_xtra (char const *version) |
Calculate extra space required by version string. | |
void | http_version_dup (char **pp, char const **dd, char const *s) |
Duplicate a transport string. | |
http_method_t | http_method_d (char **ss, char const **nname) |
Parse a HTTP method name. | |
char const * | http_method_name (http_method_t method, char const *name) |
Return string corresponding to the method. | |
issize_t | http_extract_body (msg_t *, http_t *, char b[], isize_t bsiz, int eos) |
Extract HTTP message body. | |
Typedefs and prototypes used by HTTP parser.
Extract HTTP message body.
Extract HTTP message body.
-1 | error |
0 | cannot proceed |
other | number of bytes extracted |
http_method_t http_method_d | ( | char ** | ss, |
char const ** | nname | ||
) |
Parse a HTTP method name.
The function http_method_d()
parses a HTTP method, and returns a code corresponding to the method. It stores the address of the first non-LWS character after method name in *ss
.
ss | pointer to pointer to string to be parsed |
nname | pointer to value-result parameter formethod name |
http_method_d
returns the method code if method was identified, 0 (http_method_unknown
) if method is not known, or -1
(http_method_invalid
) if an error occurred.If the value-result argument nname is not NULL
, http_method_d() stores a pointer to the method name to it.
int http_version_d | ( | char ** | ss, |
char const ** | ver | ||
) |
Parse HTTP version.
The function http_version_d() parses a HTTP method.
0 | when successful, |
-1 | upon an error. |