annotate libmpdemux/http.h @ 2315:c3c73ba53f0e

streaming fixed
author arpi
date Sat, 20 Oct 2001 20:35:12 +0000
parents 9e059416eea6
children 0ecc1b4f7cf8
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
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
10 #define HTTP_FIELD_MAX 20
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
11
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
12 typedef struct {
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
13 char *protocol;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
14 char *method;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
15 char *uri;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
16 int status_code;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
17 char *reason_phrase;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
18 int http_minor_version;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
19 char *fields[HTTP_FIELD_MAX];
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
20 int field_nb;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
21 char *field_search;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
22 int search_pos;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
23 char *body;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
24 int body_size;
902
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
25 char *buffer;
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
26 int buffer_size;
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
27 int is_parsed;
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
28 } HTTP_header_t;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
29
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
30 HTTP_header_t* http_new_header();
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
31 void http_free( HTTP_header_t *http_hdr );
902
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
32 int http_response_append( HTTP_header_t *http_hdr, char *data, int length );
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
33 int http_response_parse( HTTP_header_t *http_hdr );
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
34 int http_is_header_entired( HTTP_header_t *http_hdr );
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
35 char* http_build_request( HTTP_header_t *http_hdr );
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
36 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
37 char* http_get_next_field( HTTP_header_t *http_hdr );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
38 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
39 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
40 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
41
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
42 void http_debug_hdr( HTTP_header_t *http_hdr );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
43
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
44 #endif // __HTTP_H