Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-12 06:44:23 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-03-12 06:45:16 +0400
commitf36da16ede525fb4925ad3ec863f131bc6743540 (patch)
tree460f987b290457bebc9bba558bf2b1777609f656
parentc03af3ac1c4c865fdde5f57df6c2ccc646680f77 (diff)
parentddfc98906373d1f17f6205cedd14c68d7a75995f (diff)
Merge commit 'ddfc98906373d1f17f6205cedd14c68d7a75995f'
* commit 'ddfc98906373d1f17f6205cedd14c68d7a75995f': http: Support setting custom User-Agent Conflicts: doc/protocols.texi libavformat/http.c See: 2bb1c713cc7e8fd018a3a0b579145a31a1c47bce Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--doc/protocols.texi5
-rw-r--r--libavformat/http.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/doc/protocols.texi b/doc/protocols.texi
index ee9e01193c..f66f77d27e 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -233,8 +233,9 @@ value must be a string encoding the headers.
Force a content type.
@item user-agent
-Override User-Agent header. If not specified the protocol will use a
-string describing the libavformat build.
+@item user_agent
+Override the User-Agent header. If not specified the protocol will use a
+string describing the libavformat build. ("Lavf/<version>")
@item multiple_requests
Use persistent connections if set to 1. By default it is 0.
diff --git a/libavformat/http.c b/libavformat/http.c
index 7c2b2bb5ee..c301e45a01 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -52,13 +52,13 @@ typedef struct {
/* Used if "Transfer-Encoding: chunked" otherwise -1. */
int64_t chunksize;
char *content_type;
- char *user_agent;
int64_t off, filesize, req_end_offset;
char *location;
HTTPAuthState auth_state;
HTTPAuthState proxy_auth_state;
char *headers;
char *mime_type;
+ char *user_agent;
/* Set if the server correctly handles Connection: close and will close
* the connection after feeding us the content. */
int willclose;
@@ -100,6 +100,7 @@ static const AVOption options[] = {
{"chunked_post", "use chunked transfer-encoding for posts", OFFSET(chunked_post), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E },
{"headers", "set custom HTTP headers, can override built in default headers", OFFSET(headers), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
{"content_type", "force a content type", OFFSET(content_type), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
+{"user_agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = DEFAULT_USER_AGENT}, 0, 0, D },
{"user-agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = DEFAULT_USER_AGENT}, 0, 0, D },
{"multiple_requests", "use persistent connections", OFFSET(multiple_requests), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
{"post_data", "set custom HTTP post data", OFFSET(post_data), AV_OPT_TYPE_BINARY, .flags = D|E },