summaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-08-02 10:57:30 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-08-04 00:26:01 +0200
commitbde2f09d5e4c4a3b2826aefdda0a10c07bbb551a (patch)
treed547dda6be69a0740afb2c8939ade8a2d3c3d7df /lib/http2.c
parent6eb60c2dc589a15ff8a3aa5961745d86044a9b78 (diff)
downloadgnurl-bde2f09d5e4c4a3b2826aefdda0a10c07bbb551a.tar.gz
gnurl-bde2f09d5e4c4a3b2826aefdda0a10c07bbb551a.tar.bz2
gnurl-bde2f09d5e4c4a3b2826aefdda0a10c07bbb551a.zip
multi: make Curl_expire() work with 0 ms timeouts
Previously, passing a timeout of zero to Curl_expire() was a magic code for clearing all timeouts for the handle. That is now instead made with the new Curl_expire_clear() function and thus a 0 timeout is fine to set and will trigger a timeout ASAP. This will help removing short delays, in particular notable when doing HTTP/2.
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/http2.c b/lib/http2.c
index efc082dd5..8e10c6601 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -547,7 +547,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
/* if we receive data for another handle, wake that up */
if(conn_s->data != data_s)
- Curl_expire(data_s, 1);
+ Curl_expire(data_s, 0);
}
break;
case NGHTTP2_PUSH_PROMISE:
@@ -621,8 +621,7 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
/* if we receive data for another handle, wake that up */
if(conn->data != data_s)
- Curl_expire(data_s, 1); /* TODO: fix so that this can be set to 0 for
- immediately? */
+ Curl_expire(data_s, 0);
DEBUGF(infof(data_s, "%zu data received for stream %u "
"(%zu left in buffer %p, total %zu)\n",
@@ -883,7 +882,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
Curl_add_buffer(stream->header_recvbuf, " \r\n", 3);
/* if we receive data for another handle, wake that up */
if(conn->data != data_s)
- Curl_expire(data_s, 1);
+ Curl_expire(data_s, 0);
DEBUGF(infof(data_s, "h2 status: HTTP/2 %03d (easy %p)\n",
stream->status_code, data_s));
@@ -899,7 +898,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
Curl_add_buffer(stream->header_recvbuf, "\r\n", 2);
/* if we receive data for another handle, wake that up */
if(conn->data != data_s)
- Curl_expire(data_s, 1);
+ Curl_expire(data_s, 0);
DEBUGF(infof(data_s, "h2 header: %.*s: %.*s\n", namelen, name, valuelen,
value));