[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 181/254: transfer: init the infilesize from the pos
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 181/254: transfer: init the infilesize from the postfields... |
Date: |
Sat, 17 Jun 2017 16:53:33 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit e54db1b053614ce5d332b5eea673ab370843e65b
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue May 30 00:45:54 2017 +0200
transfer: init the infilesize from the postfields...
... with a strlen() if no size was set, and do this in the pretransfer
function so that the info is set early. Otherwise, the default strlen()
done on the POSTFIELDS data never sets state.infilesize.
Reported-by: Vincas Razma
Bug: #1294
---
lib/http.c | 11 +++--------
lib/transfer.c | 5 ++++-
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/lib/http.c b/lib/http.c
index 8e7fb0fa9..21574e21d 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -419,8 +419,6 @@ static CURLcode http_perhapsrewind(struct connectdata *conn)
case HTTPREQ_POST:
if(data->state.infilesize != -1)
expectsend = data->state.infilesize;
- else if(data->set.postfields)
- expectsend = (curl_off_t)strlen(data->set.postfields);
break;
case HTTPREQ_PUT:
if(data->state.infilesize != -1)
@@ -2559,12 +2557,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
if(conn->bits.authneg)
postsize = 0;
- else {
- /* figure out the size of the postfields */
- postsize = (data->state.infilesize != -1)?
- data->state.infilesize:
- (data->set.postfields? (curl_off_t)strlen(data->set.postfields):-1);
- }
+ else
+ /* the size of the post body */
+ postsize = data->state.infilesize;
/* We only set Content-Length and allow a custom Content-Length if
we don't upload data chunked, as RFC2616 forbids us to set both
diff --git a/lib/transfer.c b/lib/transfer.c
index 799fd4da8..43e8f64aa 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1309,8 +1309,11 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
if(data->set.httpreq == HTTPREQ_PUT)
data->state.infilesize = data->set.filesize;
- else
+ else {
data->state.infilesize = data->set.postfieldsize;
+ if(data->set.postfields && (data->state.infilesize == -1))
+ data->state.infilesize = (curl_off_t)strlen(data->set.postfields);
+ }
/* If there is a list of cookie files to read, do it now! */
if(data->change.cookielist)
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 122/254: tests: removed redundant --trace-ascii arguments, (continued)
- [GNUnet-SVN] [gnurl] 122/254: tests: removed redundant --trace-ascii arguments, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 174/254: runtests.pl: removed unused arguments to valgrindparse, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 128/254: cookie_interface: fix -Wcomma warning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 123/254: tests: make test file names more unique, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 116/254: rand: treat fake entropy the same regardless of endianness, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 161/254: memdebug: fix compilation failure, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 145/254: curl_sasl: fix build error with CURL_DISABLE_CRYPTO_AUTH + USE_NTLM, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 150/254: asiohiper.cpp / evhiperfifo.c: deal with negative timerfunction input, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 168/254: winbuild: fix the nghttp2 build, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 142/254: SecureTransport/DarwinSSL: Implement public key pinning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 181/254: transfer: init the infilesize from the postfields...,
gnunet <=
- [GNUnet-SVN] [gnurl] 144/254: docs/cmdline-opts/config.d: edit for language, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 118/254: curl: generate the --help output, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 231/254: lib1521: fix compiler warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 190/254: libtest/lib574.c: use correct callback proto, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 196/254: lib583: fix compiler warning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 151/254: ghiper.c/hiperfifo.c: add comment about missing timer functionality, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 225/254: test1262: verify ftp download with -z for "if older than this", gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 167/254: LDAP: documentation update per #878 changes (#1506), gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 172/254: docs/CURLOPT_SSLVERSION.3: Correct define name in example, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 205/254: test1537: dedicated tests of the URL (un)escape API calls, gnunet, 2017/06/17