avformat/http: avoid ff_http_do_new_request after http/1.0 response
authorAman Gupta <aman@tmm1.net>
Mon, 25 Dec 2017 19:35:26 +0000 (11:35 -0800)
committerAman Gupta <aman@tmm1.net>
Tue, 26 Dec 2017 22:48:14 +0000 (14:48 -0800)
This makes do_new_request fail early when dealing with a http/1.0 server, avoiding unnecessary "reconnecting" warnings shown to the user.

Signed-off-by: Aman Gupta <aman@tmm1.net>
libavformat/http.c

index c15ca52..213b6bb 100644 (file)
@@ -917,6 +917,8 @@ static int process_line(URLContext *h, char *line, int line_count,
             }
             av_log(h, AV_LOG_TRACE, "HTTP version string: %s\n", version);
         } else {
+            if (av_strncasecmp(p, "HTTP/1.0", 8) == 0)
+                s->willclose = 1;
             while (!av_isspace(*p) && *p != '\0')
                 p++;
             while (av_isspace(*p))