]> granicus.if.org Git - curl/commitdiff
http2: detect prematures close without data transfered
authorDaniel Stenberg <daniel@haxx.se>
Sat, 14 Mar 2015 17:17:59 +0000 (18:17 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 14 Mar 2015 17:19:51 +0000 (18:19 +0100)
... by using the regular Curl_http_done() method which checks for
that. This makes test 1801 fail consistently with error 56 (which seems
fine) to that test is also updated here.

Reported-by: Ben Darnell
Bug: https://github.com/bagder/curl/issues/166

lib/http2.c
tests/data/test1801

index 89bc57d5e43d76e83fadfdd55d4053b28a7e74e4..ea20b0a11b0138f155bdf2c9e3e64f56d0a3a45c 100644 (file)
@@ -102,7 +102,7 @@ const struct Curl_handler Curl_handler_http2 = {
   "HTTP2",                              /* scheme */
   ZERO_NULL,                            /* setup_connection */
   Curl_http,                            /* do_it */
-  ZERO_NULL,                            /* done */
+  Curl_http_done,                       /* done */
   ZERO_NULL,                            /* do_more */
   ZERO_NULL,                            /* connect_it */
   ZERO_NULL,                            /* connecting */
@@ -122,7 +122,7 @@ const struct Curl_handler Curl_handler_http2_ssl = {
   "HTTP2",                              /* scheme */
   ZERO_NULL,                            /* setup_connection */
   Curl_http,                            /* do_it */
-  ZERO_NULL,                            /* done */
+  Curl_http_done,                       /* done */
   ZERO_NULL,                            /* do_more */
   ZERO_NULL,                            /* connect_it */
   ZERO_NULL,                            /* connecting */
index 3e069f58553c294cb204b1c04f40e03edfcaf5c9..a95e76a221d4b608462a64856bee706cf5c30d74 100644 (file)
@@ -62,5 +62,9 @@ Upgrade: %H2CVER
 HTTP2-Settings: AAMAAABkAAQAAP__\r
 \r
 </protocol>
+# nothing is returned, because no HTTP/2 data nor headers was handled
+<errorcode>
+56
+</errorcode>
 </verify>
 </testcase>