[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 166/220: ngtcp2: improve h3 response receiving
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 166/220: ngtcp2: improve h3 response receiving |
Date: |
Thu, 12 Sep 2019 17:28:46 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 30a606e06691979ee2822f8e2a48ee627bdffffb
Author: Daniel Stenberg <address@hidden>
AuthorDate: Sat Aug 24 18:43:31 2019 +0200
ngtcp2: improve h3 response receiving
Closes #4259
---
lib/vquic/ngtcp2.c | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c
index 5fd65429f..e3af71e94 100644
--- a/lib/vquic/ngtcp2.c
+++ b/lib/vquic/ngtcp2.c
@@ -1256,6 +1256,16 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t
stream_id,
memcpy(stream->mem, buf, ncopy);
stream->len -= ncopy;
stream->memlen += ncopy;
+#if 0 /* extra debugging of incoming h3 data */
+ fprintf(stderr, "!! Copies %zd bytes to %p (total %zd)\n",
+ ncopy, stream->mem, stream->memlen);
+ {
+ size_t i;
+ for(i = 0; i < ncopy; i++) {
+ fprintf(stderr, "!! data[%d]: %02x '%c'\n", i, buf[i], buf[i]);
+ }
+ }
+#endif
stream->mem += ncopy;
ngtcp2_conn_extend_max_stream_offset(qs->qconn, stream_id, buflen);
@@ -1472,11 +1482,13 @@ static ssize_t ngh3_stream_recv(struct connectdata
*conn,
fprintf(stderr, "ngh3_stream_recv CALLED (easy %p, socket %d)\n",
conn->data, sockfd);
- /* remember where to store incoming data for this stream and how big the
- buffer is */
- stream->mem = buf;
- stream->len = buffersize;
- stream->memlen = 0;
+ if(!stream->memlen) {
+ /* remember where to store incoming data for this stream and how big the
+ buffer is */
+ stream->mem = buf;
+ stream->len = buffersize;
+ }
+ /* else, there's data in the buffer already */
if(ng_process_ingress(conn, sockfd, qs)) {
*curlcode = CURLE_RECV_ERROR;
@@ -1488,11 +1500,16 @@ static ssize_t ngh3_stream_recv(struct connectdata
*conn,
}
if(stream->memlen) {
+ ssize_t memlen = stream->memlen;
/* data arrived */
*curlcode = CURLE_OK;
- infof(conn->data, "ngh3_stream_recv returns %zd bytes\n",
- stream->memlen);
- return stream->memlen;
+ /* reset to allow more data to come */
+ stream->memlen = 0;
+ stream->mem = buf;
+ stream->len = buffersize;
+ H3BUGF(infof(conn->data, "!! ngh3_stream_recv returns %zd bytes at %p\n",
+ memlen, buf));
+ return memlen;
}
if(stream->closed) {
@@ -1577,7 +1594,7 @@ static int cb_h3_readfunction(nghttp3_conn *conn, int64_t
stream_id,
}
if(stream->upload_done && !stream->upload_len &&
(stream->upload_left <= 0)) {
- fprintf(stderr, "!!!!!!!!! cb_h3_readfunction sets EOF\n");
+ H3BUGF(infof(data, "!!!!!!!!! cb_h3_readfunction sets EOF\n"));
*pdata = NULL;
*pdatalen = 0;
*pflags = NGHTTP3_DATA_FLAG_EOF;
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] 114/220: CURLOPT_ALTSVC_CTRL.3: remove CURLALTSVC_ALTUSED, (continued)
- [GNUnet-SVN] [gnurl] 114/220: CURLOPT_ALTSVC_CTRL.3: remove CURLALTSVC_ALTUSED, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 120/220: curl_version_info: make the quic_version a const, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 126/220: connect: connections are persistent by default for HTTP/3, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 134/220: travis: reduce number of torture tests in 'coverage', gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 150/220: configure: use pkg-config to detect quiche, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 129/220: ngtcp2: Consume QUIC STREAM data properly, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 137/220: travis: add a quiche build, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 149/220: CURLOPT_SSL_VERIFYHOST: treat the value 1 as 2, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 154/220: openssl: build warning free with boringssl, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 165/220: ngtcp2: use nghttp3_version(), gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 166/220: ngtcp2: improve h3 response receiving,
gnunet <=
- [GNUnet-SVN] [gnurl] 136/220: http: fix use of credentials from URL when using HTTP proxy, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 155/220: spnego_sspi: add typecast to fix build warning, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 152/220: ngtcp2: make postfields-set posts work, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 162/220: http: the 'closed' struct field is used by both ngh2 and ngh3, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 164/220: ngtcp2: sync with upstream API changes, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 167/220: ngtcp2: add support for SSLKEYLOGFILE, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 143/220: ssh: add a generic Curl_ssh_version function for SSH backends, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 139/220: TODO/ROADMAP: remove "refuse downgrade redirects" and HTTP/3, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 146/220: ngtcp2: use ngtcp2_version() to get the run-time version, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 156/220: cleanup: remove DOT_CHAR completely, gnunet, 2019/09/12