diff options
author | Brad King <brad.king@kitware.com> | 2023-12-12 01:33:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-12-12 01:33:07 (GMT) |
commit | 548f0cfd1db2f6a4b971df94a0a47655b51ff9d9 (patch) | |
tree | bbba54962c79e662d7d04986e113f50efd39654e /Utilities/cmcurl/lib/tftp.c | |
parent | 38f85b839019c0674e9f8abae141e7b087f44c16 (diff) | |
parent | fe5ffe06a9e09b7be5ff432049cb427894a78dcb (diff) | |
download | CMake-548f0cfd1db2f6a4b971df94a0a47655b51ff9d9.zip CMake-548f0cfd1db2f6a4b971df94a0a47655b51ff9d9.tar.gz CMake-548f0cfd1db2f6a4b971df94a0a47655b51ff9d9.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2023-12-06 (7161cb17)
Diffstat (limited to 'Utilities/cmcurl/lib/tftp.c')
-rw-r--r-- | Utilities/cmcurl/lib/tftp.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Utilities/cmcurl/lib/tftp.c b/Utilities/cmcurl/lib/tftp.c index e78140d..6630155 100644 --- a/Utilities/cmcurl/lib/tftp.c +++ b/Utilities/cmcurl/lib/tftp.c @@ -70,8 +70,6 @@ /* RFC2348 allows the block size to be negotiated */ #define TFTP_BLKSIZE_DEFAULT 512 -#define TFTP_BLKSIZE_MIN 8 -#define TFTP_BLKSIZE_MAX 65464 #define TFTP_OPTION_BLKSIZE "blksize" /* from RFC2349: */ @@ -978,11 +976,9 @@ static CURLcode tftp_connect(struct Curl_easy *data, bool *done) return CURLE_OUT_OF_MEMORY; /* alloc pkt buffers based on specified blksize */ - if(data->set.tftp_blksize) { + if(data->set.tftp_blksize) + /* range checked when set */ blksize = (int)data->set.tftp_blksize; - if(blksize > TFTP_BLKSIZE_MAX || blksize < TFTP_BLKSIZE_MIN) - return CURLE_TFTP_ILLEGAL; - } need_blksize = blksize; /* default size is the fallback when no OACK is received */ @@ -1107,7 +1103,6 @@ static CURLcode tftp_receive_packet(struct Curl_easy *data) CURLcode result = CURLE_OK; struct connectdata *conn = data->conn; struct tftp_state_data *state = conn->proto.tftpc; - struct SingleRequest *k = &data->req; /* Receive the packet */ fromlen = sizeof(fromaddr); @@ -1141,11 +1136,6 @@ static CURLcode tftp_receive_packet(struct Curl_easy *data) result = Curl_client_write(data, CLIENTWRITE_BODY, (char *)state->rpacket.data + 4, state->rbytes-4); - if(!result) { - k->bytecount += state->rbytes-4; - result = Curl_pgrsSetDownloadCounter(data, - (curl_off_t) k->bytecount); - } if(result) { tftp_state_machine(state, TFTP_EVENT_ERROR); return result; |