annotate http.h @ 885:cec1562ccf8a

Improvements
author nickols_k
date Sat, 26 May 2001 10:29:41 +0000
parents f641c96e431b
children ede5785faa53
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
1 #ifndef __HTTP_H
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
2 #define __HTTP_H
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
3
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
4 #define HTTP_FIELD_MAX 20
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
5
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
6 typedef struct {
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
7 char *protocol;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
8 char *method;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
9 char *uri;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
10 int status_code;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
11 char *reason_phrase;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
12 int http_minor_version;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
13 char *fields[HTTP_FIELD_MAX];
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
14 int field_nb;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
15 char *field_search;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
16 int search_pos;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
17 char *body;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
18 int body_size;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
19 } HTTP_header_t;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
20
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
21 HTTP_header_t* http_new_header();
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
22 void http_free( HTTP_header_t *http_hdr );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
23 HTTP_header_t* http_new_response( char *data, int length );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
24 char* http_get_request( HTTP_header_t *http_hdr );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
25 char* http_get_field( HTTP_header_t *http_hdr, const char *field_name );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
26 char* http_get_next_field( HTTP_header_t *http_hdr );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
27 void http_set_field( HTTP_header_t *http_hdr, const char *field );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
28 void http_set_method( HTTP_header_t *http_hdr, const char *method );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
29 void http_set_uri( HTTP_header_t *http_hdr, const char *uri );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
30
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
31 void http_debug_hdr( HTTP_header_t *http_hdr );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
32
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
33 #endif // __HTTP_H