diff options
author | Daniel Stenberg <daniel@haxx.se> | 2014-04-15 13:49:18 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-04-26 18:17:10 +0200 |
commit | d5ec44ca4cca9bbe6c21a1d2a94b37cba77661ff (patch) | |
tree | 7d4f6429f80bacd0a314726572bdddbc265f7c72 /lib/url.c | |
parent | 9c941e92c4bd3d2a5dbe243f7517b6a6029afc6e (diff) |
INFILESIZE: fields in UserDefined must not be changed run-time
set.infilesize in this case was modified in several places, which could
lead to repeated requests using the same handle to get unintendent/wrong
consequences based on what the previous request did!
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -485,7 +485,7 @@ CURLcode Curl_init_userdefined(struct UserDefined *set) set->convtonetwork = ZERO_NULL; set->convfromutf8 = ZERO_NULL; - set->infilesize = -1; /* we don't know any size */ + set->filesize = -1; /* we don't know the size */ set->postfieldsize = -1; /* unknown size */ set->maxredirs = -1; /* allow any amount by default */ @@ -1491,14 +1491,14 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, * If known, this should inform curl about the file size of the * to-be-uploaded file. */ - data->set.infilesize = va_arg(param, long); + data->set.filesize = va_arg(param, long); break; case CURLOPT_INFILESIZE_LARGE: /* * If known, this should inform curl about the file size of the * to-be-uploaded file. */ - data->set.infilesize = va_arg(param, curl_off_t); + data->set.filesize = va_arg(param, curl_off_t); break; case CURLOPT_LOW_SPEED_LIMIT: /* @@ -4100,16 +4100,17 @@ static CURLcode setup_connection_internals(struct connectdata *conn) { const struct Curl_handler * p; CURLcode result; + struct SessionHandle *data = conn->data; /* in some case in the multi state-machine, we go back to the CONNECT state and then a second (or third or...) call to this function will be made without doing a DISCONNECT or DONE in between (since the connection is yet in place) and therefore this function needs to first make sure there's no lingering previous data allocated. */ - Curl_free_request_state(conn->data); + Curl_free_request_state(data); - memset(&conn->data->req, 0, sizeof(struct SingleRequest)); - conn->data->req.maxdownload = -1; + memset(&data->req, 0, sizeof(struct SingleRequest)); + data->req.maxdownload = -1; conn->socktype = SOCK_STREAM; /* most of them are TCP streams */ |