mirror of
https://github.com/curl/curl.git
synced 2026-05-30 12:37:28 +03:00
tftp: default timeout per block is now 15 seconds
Down from the previous (rather ridiculous) 3600. Reported-by: Joshua Rogers Closes #18893
This commit is contained in:
parent
f1ed50a517
commit
bc90f80556
1 changed files with 5 additions and 7 deletions
12
lib/tftp.c
12
lib/tftp.c
|
|
@ -206,7 +206,7 @@ const struct Curl_handler Curl_handler_tftp = {
|
|||
**********************************************************/
|
||||
static CURLcode tftp_set_timeouts(struct tftp_conn *state)
|
||||
{
|
||||
time_t maxtime, timeout;
|
||||
time_t timeout;
|
||||
timediff_t timeout_ms;
|
||||
bool start = (state->state == TFTP_STATE_START);
|
||||
|
||||
|
|
@ -219,13 +219,11 @@ static CURLcode tftp_set_timeouts(struct tftp_conn *state)
|
|||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
|
||||
if(timeout_ms > 0)
|
||||
maxtime = (time_t)(timeout_ms + 500) / 1000;
|
||||
else
|
||||
maxtime = 3600; /* use for calculating block timeouts */
|
||||
|
||||
/* Set per-block timeout to total */
|
||||
timeout = maxtime;
|
||||
if(timeout_ms > 0)
|
||||
timeout = (time_t)(timeout_ms + 500) / 1000;
|
||||
else
|
||||
timeout = 15;
|
||||
|
||||
/* Average reposting an ACK after 5 seconds */
|
||||
state->retry_max = (int)timeout/5;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue