http2: force "drainage" of streams

... which is necessary since the socket won't be readable but there is
data waiting in the buffer.
This commit is contained in:
Daniel Stenberg 2015-04-30 08:20:49 +02:00
parent 7bbac214f5
commit 01e1bdb10c
7 changed files with 123 additions and 57 deletions

View file

@ -1046,6 +1046,11 @@ CURLcode Curl_readwrite(struct connectdata *conn,
else
fd_write = CURL_SOCKET_BAD;
if(conn->data->state.drain) {
select_res |= CURL_CSELECT_IN;
DEBUGF(infof(data, "%s: forcibly told to drain data\n", __func__));
}
if(!select_res) /* Call for select()/poll() only, if read/write/error
status is not known. */
select_res = Curl_socket_ready(fd_read, fd_write, 0);
@ -1055,6 +1060,9 @@ CURLcode Curl_readwrite(struct connectdata *conn,
return CURLE_SEND_ERROR;
}
DEBUGF(infof(data, "%s: keepon: %x select_res %x\n", __func__, k->keepon,
select_res));
/* We go ahead and do a read if we have a readable socket or if
the stream was rewound (in which case we have data in a
buffer) */