summaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
authorStefan Eissing <stefan@eissing.org>2023-04-05 14:52:16 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-04-06 09:41:54 +0200
commit8f50e393ab0d2305cb5fc1aa4b47fd9d83f415dc (patch)
treee7090700c20780d5eeb096139d975f061644036d /lib/http2.c
parent3da642c4f0cc7dbc0bc428f8028e2b45f1eca379 (diff)
downloadcurl-8f50e393ab0d2305cb5fc1aa4b47fd9d83f415dc.tar.gz
vtls and h2 improvements
- eliminate receive loop in vtls to fill buffer. This may lead to partial reads of data which is counter productive - let http2 instead loop smarter to process pending network data without transfer switches scorecard improvements - do not start caddy when only httpd is requested - allow curl -v to stderr file on --curl-verbose Closes #10891
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/http2.c b/lib/http2.c
index f43462d70..7de155bb6 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -1643,6 +1643,7 @@ static ssize_t stream_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
ssize_t nread = -1;
*err = CURLE_AGAIN;
+ drained_transfer(cf, data);
if(!Curl_bufq_is_empty(&stream->h2_recvbuf)) {
nread = Curl_bufq_read(&stream->h2_recvbuf,
(unsigned char *)buf, len, err);
@@ -1682,7 +1683,6 @@ static CURLcode h2_progress_ingress(struct Curl_cfilter *cf,
struct HTTP *stream = data->req.p.http;
CURLcode result = CURLE_OK;
ssize_t nread;
- bool keep_reading = TRUE;
/* Process network input buffer fist */
if(!Curl_bufq_is_empty(&ctx->inbufq)) {
@@ -1694,12 +1694,11 @@ static CURLcode h2_progress_ingress(struct Curl_cfilter *cf,
/* Receive data from the "lower" filters, e.g. network until
* it is time to stop or we have enough data for this stream */
- while(keep_reading &&
- !ctx->conn_closed && /* not closed the connection */
+ while(!ctx->conn_closed && /* not closed the connection */
!stream->closed && /* nor the stream */
Curl_bufq_is_empty(&ctx->inbufq) && /* and we consumed our input */
!Curl_bufq_is_full(&stream->h2_recvbuf) && /* enough? */
- Curl_bufq_len(&stream->h2_recvbuf) < data->set.buffer_size) {
+ 1 /* Curl_bufq_len(&stream->h2_recvbuf) < data->set.buffer_size */) {
nread = Curl_bufq_slurp(&ctx->inbufq, nw_in_reader, cf, &result);
DEBUGF(LOG_CF(data, cf, "read %zd bytes nw data -> %zd, %d",
@@ -1716,7 +1715,6 @@ static CURLcode h2_progress_ingress(struct Curl_cfilter *cf,
break;
}
- keep_reading = Curl_bufq_is_full(&ctx->inbufq);
if(h2_process_pending_input(cf, data, &result))
return result;
}
@@ -1755,9 +1753,6 @@ static ssize_t cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
goto out;
nread = stream_recv(cf, data, buf, len, err);
- if(Curl_bufq_is_empty(&stream->h2_recvbuf)) {
- drained_transfer(cf, data);
- }
}
if(nread > 0) {