summaryrefslogtreecommitdiff
path: root/lib/file.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2023-04-25 08:28:01 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-04-25 12:38:38 +0200
commit7815647d6582c0a4900be2e1de6c5e61272c496b (patch)
tree40ae2ddacadfddb1d5e26637158c8cf004da2c9d /lib/file.c
parente5af5b7905900a49522428f914ade3c28152bfd9 (diff)
downloadcurl-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.c4
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;