[FFmpeg-cvslog] mmsh: fix 400 bad request

Kirill Zorin git at videolan.org
Thu Jun 16 23:12:14 CEST 2011


ffmpeg | branch: master | Kirill Zorin <cyril.zorin at gmail.com> | Thu Jun 16 20:15:53 2011 +0200| [6ec2fd5f77d5c5a3d569978cc6f099af15d25fba] | committer: Michael Niedermayer

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".

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

 libavformat/mmsh.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c
index 64760e8..a66e1d9 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) {



More information about the ffmpeg-cvslog mailing list