Commit e621e6ca authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '28df1d24'

* commit '28df1d24':
  http: Provide an option to override the HTTP method
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents dac096cf 28df1d24
...@@ -89,6 +89,7 @@ typedef struct { ...@@ -89,6 +89,7 @@ typedef struct {
#endif #endif
AVDictionary *chained_options; AVDictionary *chained_options;
int send_expect_100; int send_expect_100;
char *method;
} HTTPContext; } HTTPContext;
#define OFFSET(x) offsetof(HTTPContext, x) #define OFFSET(x) offsetof(HTTPContext, x)
...@@ -116,6 +117,7 @@ static const AVOption options[] = { ...@@ -116,6 +117,7 @@ static const AVOption options[] = {
{"location", "The actual location of the data received", OFFSET(location), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E }, {"location", "The actual location of the data received", OFFSET(location), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
{"offset", "initial byte offset", OFFSET(off), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D }, {"offset", "initial byte offset", OFFSET(off), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D },
{"end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D }, {"end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D },
{"method", "Override the HTTP method", OFFSET(method), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E, },
{NULL} {NULL}
}; };
#define HTTP_CLASS(flavor)\ #define HTTP_CLASS(flavor)\
...@@ -684,7 +686,11 @@ static int http_connect(URLContext *h, const char *path, const char *local_path, ...@@ -684,7 +686,11 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
s->chunked_post = 0; s->chunked_post = 0;
} }
method = post ? "POST" : "GET"; if (s->method)
method = s->method;
else
method = post ? "POST" : "GET";
authstr = ff_http_auth_create_response(&s->auth_state, auth, local_path, authstr = ff_http_auth_create_response(&s->auth_state, auth, local_path,
method); method);
proxyauthstr = ff_http_auth_create_response(&s->proxy_auth_state, proxyauth, proxyauthstr = ff_http_auth_create_response(&s->proxy_auth_state, proxyauth,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment