|
HTTP Parser and message builder / objects in plain C Snapshot
|
http request object. More...
Classes | |
| struct | tagHTTP_REQUEST |
Typedefs | |
| typedef int(* | HEADER_ACTION )(struct tagHTTP_MESSAGE *request, struct tagHTTP_PARSER *parser) |
| callback that is invoked in order to parse contents of a specific http header | |
| typedef enum tagHttp_method_type | Http_method_type |
| typedef enum tagHttp_version_type | Http_version_type |
| typedef struct tagHTTP_REQUEST | HTTP_REQUEST |
Enumerations | |
| enum | tagHttp_method_type { HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_PUT, HTTP_METHOD_HEAD, HTTP_METHOD_OPTIONS, HTTP_METHOD_DELETE, HTTP_METHOD_TRACE, HTTP_METHOD_CONNECT } |
| enum | tagHttp_version_type { HTTP_VERSION_1_0, HTTP_VERSION_1_1 } |
Functions | |
| int | HTTP_REQUEST_is_persistent (HTTP_REQUEST *message) |
| M_INLINE int | HTTP_REQUEST_init (HTTP_REQUEST *message) |
| M_INLINE void | HTTP_REQUEST_free (HTTP_REQUEST *message) |
http request object.
| typedef int(* HEADER_ACTION)(struct tagHTTP_MESSAGE *request, struct tagHTTP_PARSER *parser) |
| typedef enum tagHttp_method_type Http_method_type |
| typedef struct tagHTTP_REQUEST HTTP_REQUEST |
| typedef enum tagHttp_version_type Http_version_type |
| enum tagHttp_method_type |
| enum tagHttp_version_type |
| M_INLINE void HTTP_REQUEST_free | ( | HTTP_REQUEST * | message | ) |
Definition at line 137 of file http.h.
{
URI_free( &message->url );
if (message->host_header) {
free( message->host_header);
}
if (message->raw_url) {
free( message->raw_url );
}
message->expect_100_continue = message->has_host_header = 0;
message->raw_url = message->host_header = 0;
message->has_host_header = 0;
message->host_header_port = -1;
HTTP_MESSAGE_free( &message->base );
}
| M_INLINE int HTTP_REQUEST_init | ( | HTTP_REQUEST * | message | ) |
Definition at line 121 of file http.h.
{
if (HTTP_MESSAGE_init( &message->base )) {
return -1;
}
URI_init( & message->url );
message->expect_100_continue = message->has_host_header = 0;
message->raw_url = message->host_header = 0;
message->has_host_header = 0;
message->host_header_port = -1;
return 0;
}
| int HTTP_REQUEST_is_persistent | ( | HTTP_REQUEST * | message | ) |
Definition at line 761 of file http.c.
{
if (message->version == HTTP_VERSION_1_1) {
if (message->base.flags & HTTP_MESSAGE_FLAG_CONNECTION_CLOSE) {
return 0;
}
return 1;
}
if (message->base.flags & HTTP_MESSAGE_FLAG_KEEPALIVE) {
return 0;
}
return 0;
}
1.7.4