annotate libmpdemux/http.h @ 4002:6ce744b637ad

paint background on -v -v
author nick
date Sun, 06 Jan 2002 10:58:04 +0000
parents 80189681c02b
children 37b0b3302395
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
902
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
1 /*
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
2 * HTTP Helper
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
3 * by Bertrand Baudet <bertrand_baudet@yahoo.com>
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
4 * (C) 2001, MPlayer team.
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
5 */
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
6
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
7 #ifndef __HTTP_H
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
8 #define __HTTP_H
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
9
3039
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
10 typedef struct HTTP_field_type {
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
11 char *field_name;
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
12 struct HTTP_field_type *next;
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
13 } HTTP_field_t;
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
14
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
15 typedef struct {
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
16 char *protocol;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
17 char *method;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
18 char *uri;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
19 int status_code;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
20 char *reason_phrase;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
21 int http_minor_version;
3039
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
22 // Field variables
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
23 HTTP_field_t *first_field;
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
24 HTTP_field_t *last_field;
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
25 int field_nb;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
26 char *field_search;
3039
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
27 HTTP_field_t *field_search_pos;
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
28 // Body varibles
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
29 char *body;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
30 int body_size;
902
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
31 char *buffer;
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
32 int buffer_size;
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
33 int is_parsed;
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
34 } HTTP_header_t;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
35
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
36 HTTP_header_t* http_new_header();
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
37 void http_free( HTTP_header_t *http_hdr );
902
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
38 int http_response_append( HTTP_header_t *http_hdr, char *data, int length );
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
39 int http_response_parse( HTTP_header_t *http_hdr );
2489
0ecc1b4f7cf8 Added ASF http server streaming (Not mms streaming).
bertrand
parents: 2310
diff changeset
40 int http_is_header_entire( HTTP_header_t *http_hdr );
902
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
41 char* http_build_request( HTTP_header_t *http_hdr );
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
42 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
43 char* http_get_next_field( HTTP_header_t *http_hdr );
3039
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
44 void http_set_field( HTTP_header_t *http_hdr, const char *field_name );
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
45 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
46 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
47
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
48 void http_debug_hdr( HTTP_header_t *http_hdr );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
49
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
50 #endif // __HTTP_H