From: Jaroslav Kysela Date: Wed, 16 Apr 2014 17:17:28 +0000 (+0200) Subject: http client: allow HTTP 1.1 to HTTP 1.0 switch X-Git-Tag: v4.1~2115^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20e1abc00c01ee708a559a4d4e0cde1d9f4a5995;p=thirdparty%2Ftvheadend.git http client: allow HTTP 1.1 to HTTP 1.0 switch --- diff --git a/src/httpc.c b/src/httpc.c index 52226be01..4be83d745 100644 --- a/src/httpc.c +++ b/src/httpc.c @@ -905,8 +905,13 @@ header: return http_client_flush(hc, -EINVAL); if ((ver = http_str2ver(argv[0])) < 0) return http_client_flush(hc, -EINVAL); - if (ver != hc->hc_version) - return http_client_flush(hc, -EINVAL); + if (ver != hc->hc_version) { + /* 1.1 -> 1.0 transition allowed */ + if (hc->hc_version == HTTP_VERSION_1_1 && ver == HTTP_VERSION_1_0) + hc->hc_version = ver; + else + return http_client_flush(hc, -EINVAL); + } if ((hc->hc_code = atoi(argv[1])) < 200) return http_client_flush(hc, -EINVAL); while ((p = strtok_r(NULL, "\r\n", &saveptr)) != NULL) {