[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 145/264: http: don't consider upload done if the request isn't c
From: |
gnunet |
Subject: |
[gnurl] 145/264: http: don't consider upload done if the request isn't completely sent off |
Date: |
Thu, 30 Apr 2020 16:07:28 +0200 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 0ef54abf52086e48e7c751747650584d51b9ebaa
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Apr 7 18:16:01 2020 +0200
http: don't consider upload done if the request isn't completely sent off
Fixes #4919
Closes #5197
---
lib/http.c | 2 +-
lib/transfer.c | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/http.c b/lib/http.c
index e53f0d482..5a2edf09e 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -3057,7 +3057,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
}
if(result)
return result;
- if(!postsize)
+ if(!postsize && (http->sending != HTTPSEND_REQUEST))
data->req.upload_done = TRUE;
if(data->req.writebytecount) {
diff --git a/lib/transfer.c b/lib/transfer.c
index 27c984f8f..d5eb2c327 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1837,15 +1837,21 @@ Curl_setup_transfer(
{
struct SingleRequest *k = &data->req;
struct connectdata *conn = data->conn;
+ struct HTTP *http = data->req.protop;
+ bool httpsending = ((conn->handler->protocol&PROTO_FAMILY_HTTP) &&
+ (http->sending == HTTPSEND_REQUEST));
DEBUGASSERT(conn != NULL);
DEBUGASSERT((sockindex <= 1) && (sockindex >= -1));
- if(conn->bits.multiplex || conn->httpversion == 20) {
+ if(conn->bits.multiplex || conn->httpversion == 20 || httpsending) {
/* when multiplexing, the read/write sockets need to be the same! */
conn->sockfd = sockindex == -1 ?
((writesockindex == -1 ? CURL_SOCKET_BAD : conn->sock[writesockindex])) :
conn->sock[sockindex];
conn->writesockfd = conn->sockfd;
+ if(httpsending)
+ /* special and very HTTP-specific */
+ writesockindex = FIRSTSOCKET;
}
else {
conn->sockfd = sockindex == -1 ?
@@ -1873,7 +1879,6 @@ Curl_setup_transfer(
k->keepon |= KEEP_RECV;
if(writesockindex != -1) {
- struct HTTP *http = data->req.protop;
/* HTTP 1.1 magic:
Even if we require a 100-return code before uploading data, we might
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 210/264: test1028: make it run on dynamic FTP server port, (continued)
- [gnurl] 210/264: test1028: make it run on dynamic FTP server port, gnunet, 2020/04/30
- [gnurl] 211/264: test1055: make it work with dynamic FTP port, gnunet, 2020/04/30
- [gnurl] 176/264: appveyor: completely disable tests that fail to timeout early, gnunet, 2020/04/30
- [gnurl] 139/264: release-notes: output trailing references sorted numerically, gnunet, 2020/04/30
- [gnurl] 244/264: select: make Curl_socket_check take timediff_t timeout, gnunet, 2020/04/30
- [gnurl] 150/264: release-notes: fix the initial reference list output, gnunet, 2020/04/30
- [gnurl] 144/264: http: allow Curl_add_buffer_send() to do a short first send by force, gnunet, 2020/04/30
- [gnurl] 262/264: RELEASE-NOTES: 7.70.0, gnunet, 2020/04/30
- [gnurl] 159/264: lib: fix conversion warnings for SOCKET_WRITABLE/READABLE, gnunet, 2020/04/30
- [gnurl] 182/264: mqtt: add new experimental protocol, gnunet, 2020/04/30
- [gnurl] 145/264: http: don't consider upload done if the request isn't completely sent off,
gnunet <=
- [gnurl] 181/264: TODO: Consider convenience options for JSON and XML?, gnunet, 2020/04/30
- [gnurl] 143/264: connect: store connection info for QUIC connections, gnunet, 2020/04/30
- [gnurl] 148/264: runtests: provide nicer errormsg when protocol "dump" file is empty, gnunet, 2020/04/30
- [gnurl] 258/264: nss: check for PK11_CreateDigestContext() returning NULL, gnunet, 2020/04/30
- [gnurl] 151/264: runtests: fix warning about using an undefined variable, gnunet, 2020/04/30
- [gnurl] 153/264: url: allow non-HTTPS altsvc-matching for debug builds, gnunet, 2020/04/30
- [gnurl] 174/264: schannel: Fix blocking timeout logic, gnunet, 2020/04/30
- [gnurl] 123/264: test1566: verify --etag-compare that gets a 304 back, gnunet, 2020/04/30
- [gnurl] 158/264: test1148: tolerate progress updates better (again), gnunet, 2020/04/30
- [gnurl] 149/264: github actions: run when pushed to master or */ci + PRs, gnunet, 2020/04/30