diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-02-08 15:56:10 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-02-09 14:06:28 +0100 |
commit | 115c9e27f53809a254fba44b023bea92f4d4dcd0 (patch) | |
tree | 148e355a72b3cbf932fd3e7bbfb48aeb4c30288a /lib/tftp.c | |
parent | 0829909ebd8ded89189d2cae699231512962f31c (diff) | |
download | curl-115c9e27f53809a254fba44b023bea92f4d4dcd0.tar.gz |
ftp: add 'prefer_ascii' to the transfer state struct
... and make sure the code never updates 'set.prefer_ascii' as it breaks
handle reuse which should use the setting as the user specified it.
Added test 1569 to verify: it first makes an FTP transfer with ';type=A'
and then another without type on the same handle and the second should
then use binary. Previously, curl failed this.
Closes #6578
Diffstat (limited to 'lib/tftp.c')
-rw-r--r-- | lib/tftp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/tftp.c b/lib/tftp.c index 3f1d1b51b..defc9105e 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -460,7 +460,7 @@ static CURLcode tftp_send_first(struct tftp_state_data *state, CURLcode result = CURLE_OK; /* Set ascii mode if -B flag was used */ - if(data->set.prefer_ascii) + if(data->state.prefer_ascii) mode = "netascii"; switch(event) { @@ -1420,14 +1420,14 @@ static CURLcode tftp_setup_connection(struct Curl_easy *data, switch(command) { case 'A': /* ASCII mode */ case 'N': /* NETASCII mode */ - data->set.prefer_ascii = TRUE; + data->state.prefer_ascii = TRUE; break; case 'O': /* octet mode */ case 'I': /* binary mode */ default: /* switch off ASCII */ - data->set.prefer_ascii = FALSE; + data->state.prefer_ascii = FALSE; break; } } |