From 6ec2fd5f77d5c5a3d569978cc6f099af15d25fba Mon Sep 17 00:00:00 2001 From: Kirill Zorin Date: Thu, 16 Jun 2011 20:15:53 +0200 Subject: mmsh: fix 400 bad request There is no need to write two HTTP newlines (\r\n) into "headers", because http_connect (in http.c) already appends one HTTP newline at the end of the given headers chunk, which would result in sending three HTTP newlines after the headers. Most of the time it's okay (although not RFC-conforming), but many proxy servers and the occasional strict httpd will puke with a "400 bad request". --- libavformat/mmsh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavformat/mmsh.c') diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c index 64760e8555..a66e1d9ab2 100644 --- a/libavformat/mmsh.c +++ b/libavformat/mmsh.c @@ -244,7 +244,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags) "Pragma: no-cache,rate=1.000000,stream-time=0," "stream-offset=0:0,request-context=%u,max-duration=0\r\n" CLIENTGUID - "Connection: Close\r\n\r\n", + "Connection: Close\r\n", host, port, mmsh->request_seq++); ff_http_set_headers(mms->mms_hd, headers); @@ -284,7 +284,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags) CLIENTGUID "Pragma: stream-switch-count=%d\r\n" "Pragma: stream-switch-entry=%s\r\n" - "Connection: Close\r\n\r\n", + "Connection: Close\r\n", host, port, mmsh->request_seq++, mms->stream_num, stream_selection); av_freep(&stream_selection); if (err < 0) { -- cgit v1.2.3