Mercurial > mplayer.hg
annotate stream/http.h @ 30525:956bdcb944aa
Change aspect calculation code to switch to floating point earlier so integer
overflows are not possible.
author | reimar |
---|---|
date | Sun, 14 Feb 2010 11:13:20 +0000 |
parents | ce0122361a39 |
children | 6a629e6fdb09 |
rev | line source |
---|---|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26184
diff
changeset
|
1 /* |
902 | 2 * HTTP Helper |
30426
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
3 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
4 * Copyright (C) 2001 Bertrand Baudet <bertrand_baudet@yahoo.com> |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
5 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
6 * This file is part of MPlayer. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
7 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
8 * MPlayer is free software; you can redistribute it and/or modify |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
11 * (at your option) any later version. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
12 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
13 * MPlayer is distributed in the hope that it will be useful, |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
16 * GNU General Public License for more details. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
17 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
18 * You should have received a copy of the GNU General Public License along |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
19 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
29263
diff
changeset
|
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
902 | 21 */ |
22 | |
26029 | 23 #ifndef MPLAYER_HTTP_H |
24 #define MPLAYER_HTTP_H | |
870 | 25 |
26184
7ee4ae1648e6
Add missing header #includes to fix 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
26 #include <sys/types.h> |
7ee4ae1648e6
Add missing header #includes to fix 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
27 |
3039 | 28 typedef struct HTTP_field_type { |
29 char *field_name; | |
30 struct HTTP_field_type *next; | |
31 } HTTP_field_t; | |
870 | 32 |
33 typedef struct { | |
34 char *protocol; | |
35 char *method; | |
36 char *uri; | |
7953 | 37 unsigned int status_code; |
870 | 38 char *reason_phrase; |
7953 | 39 unsigned int http_minor_version; |
3039 | 40 // Field variables |
41 HTTP_field_t *first_field; | |
42 HTTP_field_t *last_field; | |
7953 | 43 unsigned int field_nb; |
870 | 44 char *field_search; |
3039 | 45 HTTP_field_t *field_search_pos; |
6514 | 46 // Body variables |
870 | 47 char *body; |
7953 | 48 size_t body_size; |
902 | 49 char *buffer; |
7953 | 50 size_t buffer_size; |
51 unsigned int is_parsed; | |
870 | 52 } HTTP_header_t; |
53 | |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
7953
diff
changeset
|
54 HTTP_header_t* http_new_header(void); |
870 | 55 void http_free( HTTP_header_t *http_hdr ); |
902 | 56 int http_response_append( HTTP_header_t *http_hdr, char *data, int length ); |
57 int http_response_parse( HTTP_header_t *http_hdr ); | |
2489
0ecc1b4f7cf8
Added ASF http server streaming (Not mms streaming).
bertrand
parents:
2310
diff
changeset
|
58 int http_is_header_entire( HTTP_header_t *http_hdr ); |
902 | 59 char* http_build_request( HTTP_header_t *http_hdr ); |
870 | 60 char* http_get_field( HTTP_header_t *http_hdr, const char *field_name ); |
61 char* http_get_next_field( HTTP_header_t *http_hdr ); | |
3039 | 62 void http_set_field( HTTP_header_t *http_hdr, const char *field_name ); |
870 | 63 void http_set_method( HTTP_header_t *http_hdr, const char *method ); |
64 void http_set_uri( HTTP_header_t *http_hdr, const char *uri ); | |
6514 | 65 int http_add_basic_authentication( HTTP_header_t *http_hdr, const char *username, const char *password ); |
870 | 66 |
67 void http_debug_hdr( HTTP_header_t *http_hdr ); | |
68 | |
6514 | 69 int base64_encode(const void *enc, int encLen, char *out, int outMax); |
26029 | 70 #endif /* MPLAYER_HTTP_H */ |