]> git.sesse.net Git - ffmpeg/commitdiff
avformat/http: increase BUFFER_SIZE to MAX_URL_SIZE + HTTP_HEADERS_SIZE
authorJoey Smith <joeysmith@gmail.com>
Mon, 11 May 2020 05:05:51 +0000 (23:05 -0600)
committerMarton Balint <cus@passwd.hu>
Thu, 21 May 2020 20:45:21 +0000 (22:45 +0200)
Some real-world sites use an authorization header with a bearer token; when
combined with lengthy request parameters to identify the video segment,
it's rather trivial these days to have a request body of more than 4k bytes.

MAX_URL_SIZE is hard-coded to 4k bytes in libavformat/internal.h, and
HTTP_HEADERS_SIZE is 4k as well in libavformat/http.h, so this patch increases
the buffer size to 8k, as that is the default request body limit in Apache, and
most other httpds seem to support at least as much, if not more.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/http.c

index 20545ed1f89dcb92efc58beac5606279aeecac1a..6c39da1a8b8ab5bcf07d2cb58ef3969181ec80ed 100644 (file)
@@ -46,7 +46,7 @@
 /* The IO buffer size is unrelated to the max URL size in itself, but needs
  * to be large enough to fit the full request headers (including long
  * path names). */
-#define BUFFER_SIZE   MAX_URL_SIZE
+#define BUFFER_SIZE   (MAX_URL_SIZE + HTTP_HEADERS_SIZE)
 #define MAX_REDIRECTS 8
 #define HTTP_SINGLE   1
 #define HTTP_MUTLI    2