[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 152/220: ngtcp2: make postfields-set posts work
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 152/220: ngtcp2: make postfields-set posts work |
Date: |
Thu, 12 Sep 2019 17:28:32 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 2056175dc2225337ee425c47e482bcf5bc397d5b
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Aug 20 11:01:36 2019 +0200
ngtcp2: make postfields-set posts work
Closes #4242
---
lib/vquic/ngtcp2.c | 47 +++++++++++++++++++++++++++++++++--------------
1 file changed, 33 insertions(+), 14 deletions(-)
diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c
index 9a1fd1690..f9de76960 100644
--- a/lib/vquic/ngtcp2.c
+++ b/lib/vquic/ngtcp2.c
@@ -1497,6 +1497,28 @@ static ssize_t ngh3_stream_recv(struct connectdata *conn,
return -1;
}
+static int cb_h3_readfunction(nghttp3_conn *conn, int64_t stream_id,
+ const uint8_t **pdata,
+ size_t *pdatalen, uint32_t *pflags,
+ void *user_data, void *stream_user_data)
+{
+ struct Curl_easy *data = stream_user_data;
+ (void)conn;
+ (void)stream_id;
+ (void)user_data;
+
+ fprintf(stderr, "called cb_h3_readfunction\n");
+
+ if(data->set.postfields) {
+ *pdata = data->set.postfields;
+ *pdatalen = data->state.infilesize;
+ *pflags = NGHTTP3_DATA_FLAG_EOF;
+ return 0;
+ }
+
+ return 0;
+}
+
/* Index where :authority header field will appear in request header
field list. */
#define AUTHORITY_DST_IDX 3
@@ -1690,28 +1712,25 @@ static CURLcode http_request(struct connectdata *conn,
const void *mem,
case HTTPREQ_POST:
case HTTPREQ_POST_FORM:
case HTTPREQ_POST_MIME:
- case HTTPREQ_PUT:
+ case HTTPREQ_PUT: {
+ nghttp3_data_reader data_reader;
if(data->state.infilesize != -1)
stream->upload_left = data->state.infilesize;
else
/* data sending without specifying the data amount up front */
stream->upload_left = -1; /* unknown, but not zero */
-#if 0
- stream3_id = quiche_h3_send_request(qs->h3c, qs->conn, nva, nheader,
- stream->upload_left ? FALSE: TRUE);
- if((stream3_id >= 0) && data->set.postfields) {
- ssize_t sent = quiche_h3_send_body(qs->h3c, qs->conn, stream3_id,
- (uint8_t *)data->set.postfields,
- stream->upload_left, TRUE);
- if(sent <= 0) {
- failf(data, "quiche_h3_send_body failed!");
- result = CURLE_SEND_ERROR;
- }
- stream->upload_left = 0; /* nothing left to send */
+ data_reader.read_data = cb_h3_readfunction;
+
+ rc = nghttp3_conn_submit_request(qs->h3conn, stream->stream3_id,
+ nva, nheader, &data_reader,
+ conn->data);
+ if(rc) {
+ result = CURLE_SEND_ERROR;
+ goto fail;
}
-#endif
break;
+ }
default:
stream->upload_left = 0; /* nothing left to send */
rc = nghttp3_conn_submit_request(qs->h3conn, stream->stream3_id,
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] 134/220: travis: reduce number of torture tests in 'coverage', (continued)
- [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, 2019/09/12
- [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 <=
- [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
- [GNUnet-SVN] [gnurl] 171/220: vauth: return CURLE_AUTH_ERROR on gss_init_sec_context() failure, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 173/220: RELEASE-NOTES: synced, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 142/220: base64: check for SSH, not specific SSH backends, gnunet, 2019/09/12