diff options
author | Daniel Stenberg <daniel@haxx.se> | 2023-04-25 08:28:01 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2023-04-25 12:38:38 +0200 |
commit | 7815647d6582c0a4900be2e1de6c5e61272c496b (patch) | |
tree | 40ae2ddacadfddb1d5e26637158c8cf004da2c9d /lib/file.c | |
parent | e5af5b7905900a49522428f914ade3c28152bfd9 (diff) | |
download | curl-7815647d6582c0a4900be2e1de6c5e61272c496b.tar.gz |
lib: unify the upload/method handling
By making sure we set state.upload based on the set.method value and not
independently as set.upload, we reduce confusion and mixup risks, both
internally and externally.
Closes #11017
Diffstat (limited to 'lib/file.c')
-rw-r--r-- | lib/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/file.c b/lib/file.c index 51c5d07ce..c751e8861 100644 --- a/lib/file.c +++ b/lib/file.c @@ -240,7 +240,7 @@ static CURLcode file_connect(struct Curl_easy *data, bool *done) file->freepath = real_path; /* free this when done */ file->fd = fd; - if(!data->set.upload && (fd == -1)) { + if(!data->state.upload && (fd == -1)) { failf(data, "Couldn't open file %s", data->state.up.path); file_done(data, CURLE_FILE_COULDNT_READ_FILE, FALSE); return CURLE_FILE_COULDNT_READ_FILE; @@ -422,7 +422,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) Curl_pgrsStartNow(data); - if(data->set.upload) + if(data->state.upload) return file_upload(data); file = data->req.p.file; |