annotate http.h @ 6160:1b4be334ef89 libavformat

Split url_open and url_open_protocol into url_alloc and url_connect
author mstorsjo
date Tue, 22 Jun 2010 14:03:37 +0000
parents 85710c0ef275
children fa244b4fe683
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6104
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
1 /*
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
2 * HTTP definitions
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
3 * Copyright (c) 2010 Josh Allmann
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
4 *
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
5 * This file is part of FFmpeg.
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
6 *
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
11 *
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
15 * Lesser General Public License for more details.
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
16 *
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
20 */
6138
6fa300e438f3 Add the necessary includes, add an extra empty line for cosmetics
mstorsjo
parents: 6108
diff changeset
21
6104
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
22 #ifndef AVFORMAT_HTTP_H
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
23 #define AVFORMAT_HTTP_H
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
24
6138
6fa300e438f3 Add the necessary includes, add an extra empty line for cosmetics
mstorsjo
parents: 6108
diff changeset
25 #include "avio.h"
6fa300e438f3 Add the necessary includes, add an extra empty line for cosmetics
mstorsjo
parents: 6108
diff changeset
26
6104
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
27 /**
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
28 * Sets custom HTTP headers.
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
29 * A trailing CRLF ("\r\n") is required for custom headers.
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
30 * Passing in an empty header string ("\0") will reset to defaults.
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
31 *
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
32 * The following headers can be overriden by custom values,
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
33 * otherwise they will be set to their defaults.
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
34 * -User-Agent
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
35 * -Accept
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
36 * -Range
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
37 * -Host
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
38 * -Connection
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
39 *
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
40 * @param h URL context for this HTTP connection
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
41 * @param headers the custom headers to set
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
42 */
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
43 void ff_http_set_headers(URLContext *h, const char *headers);
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
44
6108
117b1826ce8e Add support for disabling chunked transfer encoding for the http protocol
mstorsjo
parents: 6104
diff changeset
45 /**
117b1826ce8e Add support for disabling chunked transfer encoding for the http protocol
mstorsjo
parents: 6104
diff changeset
46 * Enables or disables chunked transfer encoding. (default is enabled)
117b1826ce8e Add support for disabling chunked transfer encoding for the http protocol
mstorsjo
parents: 6104
diff changeset
47 *
117b1826ce8e Add support for disabling chunked transfer encoding for the http protocol
mstorsjo
parents: 6104
diff changeset
48 * @param h URL context for this HTTP connection
117b1826ce8e Add support for disabling chunked transfer encoding for the http protocol
mstorsjo
parents: 6104
diff changeset
49 * @param is_chunked 0 to disable chunking, nonzero otherwise.
117b1826ce8e Add support for disabling chunked transfer encoding for the http protocol
mstorsjo
parents: 6104
diff changeset
50 */
117b1826ce8e Add support for disabling chunked transfer encoding for the http protocol
mstorsjo
parents: 6104
diff changeset
51 void ff_http_set_chunked_transfer_encoding(URLContext *h, int is_chunked);
117b1826ce8e Add support for disabling chunked transfer encoding for the http protocol
mstorsjo
parents: 6104
diff changeset
52
6156
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
53 /**
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
54 * Initialize the authentication state based on another HTTP URLContext.
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
55 * This can be used to pre-initialize the authentication parameters if
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
56 * they are known beforehand, to avoid having to do an initial failing
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
57 * request just to get the parameters.
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
58 *
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
59 * @param dest URL context whose authentication state gets updated
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
60 * @param src URL context whose authentication state gets copied
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
61 */
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
62 void ff_http_init_auth_state(URLContext *dest, const URLContext *src);
85710c0ef275 HTTP: Add a method for initializing the authentication state from another connection
mstorsjo
parents: 6138
diff changeset
63
6104
a5eaf91edd4a Add the capability to write custom HTTP headers
mstorsjo
parents:
diff changeset
64 #endif /* AVFORMAT_HTTP_H */