]> granicus.if.org Git - curl/commitdiff
http.c: log if it notices HTTP 1.1 after a upgrade to http2
authorDaniel Stenberg <daniel@haxx.se>
Fri, 5 Sep 2014 22:05:03 +0000 (00:05 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 20 Nov 2014 22:33:34 +0000 (23:33 +0100)
lib/http.c

index 2e9fd7d716bb1ab2d6b4c8db66d553bd8abcfcc4..b50d00f1510046ae4f99fd60bf81305cb39ef853 100644 (file)
@@ -3216,6 +3216,12 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
                     &k->httpcode);
         if(nc==3) {
           conn->httpversion += 10 * httpversion_major;
+
+          if(k->upgr101 == UPGR101_RECEIVED) {
+            /* supposedly upgraded to http2 now */
+            if(conn->httpversion != 20)
+              infof(data, "Lying server, not serving HTTP/2\n");
+          }
         }
         else {
           /* this is the real world, not a Nirvana