Skip to content

Commit eb8b05a

Browse files
committed
http: Add an option for forcing basic authentication
The default is to autodetect the auth method. This does require one extra request (and also closing and reopening the http connection). For some cases such as HTTP POST, the autodetection is not handled properly (yet). No option is added for digest, since this method requires getting nonce parameters from the server first and can't be used straight away like Basic. Signed-off-by: Martin Storsjö <martin@martin.st>
1 parent eb90a20 commit eb8b05a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

libavformat/http.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ static const AVOption options[] = {
7878
{"headers", "custom HTTP headers, can override built in default headers", OFFSET(headers), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
7979
{"multiple_requests", "use persistent connections", OFFSET(multiple_requests), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
8080
{"post_data", "custom HTTP post data", OFFSET(post_data), AV_OPT_TYPE_BINARY, .flags = D|E },
81+
{"auth_type", "HTTP authentication type", OFFSET(auth_state.auth_type), AV_OPT_TYPE_INT, {.i64 = HTTP_AUTH_NONE}, HTTP_AUTH_NONE, HTTP_AUTH_BASIC, D|E, "auth_type" },
82+
{"none", "No auth method set, autodetect", 0, AV_OPT_TYPE_CONST, {.i64 = HTTP_AUTH_NONE}, 0, 0, D|E, "auth_type" },
83+
{"basic", "HTTP basic authentication", 0, AV_OPT_TYPE_CONST, {.i64 = HTTP_AUTH_BASIC}, 0, 0, D|E, "auth_type" },
8184
{NULL}
8285
};
8386
#define HTTP_CLASS(flavor)\

libavformat/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#define LIBAVFORMAT_VERSION_MAJOR 55
3333
#define LIBAVFORMAT_VERSION_MINOR 6
34-
#define LIBAVFORMAT_VERSION_MICRO 0
34+
#define LIBAVFORMAT_VERSION_MICRO 1
3535

3636
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
3737
LIBAVFORMAT_VERSION_MINOR, \

0 commit comments

Comments
 (0)