[FFmpeg-cvslog] avformat/http: increase BUFFER_SIZE to MAX_URL_SIZE + HTTP_HEADERS_SIZE

Joey Smith git at videolan.org
Thu May 21 23:49:24 EEST 2020

ffmpeg | branch: master | Joey Smith <joeysmith at gmail.com> | Sun May 10 23:05:51 2020 -0600| [d29c42974487d5fa0a5c1b05a09da5c5818ab63e] | committer: Marton Balint

avformat/http: increase BUFFER_SIZE to MAX_URL_SIZE + HTTP_HEADERS_SIZE

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 at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d29c42974487d5fa0a5c1b05a09da5c5818ab63e

 libavformat/http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 20545ed1f8..6c39da1a8b 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -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 MAX_REDIRECTS 8
 #define HTTP_SINGLE   1
 #define HTTP_MUTLI    2

More information about the ffmpeg-cvslog mailing list