mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
TFTP: send legal timeout value
Eric Mertens posted bug #3003705: when we made TFTP use the correct timeout option when sent to the server (fixed May 18th 2010) it became obvious that libcurl used invalid timeout values (300 by default while the RFC allows nothing above 255). While of course it is obvious that as TFTP has worked thus far without being able to set timeout at all, just removing the setting wouldn't make any difference in behavior. I decided to still keep it (but fix the problem) as it now actually allows for easier (future) customization of the timeout. (http://curl.haxx.se/bug/view.cgi?id=3003705)
This commit is contained in:
parent
0bb6deda72
commit
d17709da31
12
CHANGES
12
CHANGES
@ -7,11 +7,23 @@
|
|||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
Daniel Stenberg (21 May 2010)
|
Daniel Stenberg (21 May 2010)
|
||||||
|
- Eric Mertens posted bug #3003705: when we made TFTP use the correct timeout
|
||||||
|
option when sent to the server (fixed May 18th 2010) it became obvious that
|
||||||
|
libcurl used invalid timeout values (300 by default while the RFC allows
|
||||||
|
nothing above 255). While of course it is obvious that as TFTP has worked
|
||||||
|
thus far without being able to set timeout at all, just removing the setting
|
||||||
|
wouldn't make any difference in behavior. I decided to still keep it (but
|
||||||
|
fix the problem) as it now actually allows for easier (future) customization
|
||||||
|
of the timeout.
|
||||||
|
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=3003705)
|
||||||
|
|
||||||
- Douglas Kilpatrick filed bug report #3004787 and pointed out that the TFTP
|
- Douglas Kilpatrick filed bug report #3004787 and pointed out that the TFTP
|
||||||
code didn't handle block id wraps correctly. His suggested fix inspired the
|
code didn't handle block id wraps correctly. His suggested fix inspired the
|
||||||
fix I committed.
|
fix I committed.
|
||||||
|
|
||||||
(http://curl.haxx.se/bug/view.cgi?id=3004787)
|
(http://curl.haxx.se/bug/view.cgi?id=3004787)
|
||||||
|
|
||||||
Daniel Stenberg (20 May 2010)
|
Daniel Stenberg (20 May 2010)
|
||||||
- Tanguy Fautre brought a fix to allow curl to build with Microsoft VC10.
|
- Tanguy Fautre brought a fix to allow curl to build with Microsoft VC10.
|
||||||
|
|
||||||
|
@ -526,8 +526,9 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
TFTP_OPTION_BLKSIZE);
|
TFTP_OPTION_BLKSIZE);
|
||||||
sbytes += tftp_option_add(state, sbytes,
|
sbytes += tftp_option_add(state, sbytes,
|
||||||
(char *)state->spacket.data+sbytes, buf );
|
(char *)state->spacket.data+sbytes, buf );
|
||||||
/* add timeout option, this is the max time the session may live */
|
|
||||||
snprintf( buf, sizeof(buf), "%d", state->retry_time*state->retry_max );
|
/* add timeout option */
|
||||||
|
snprintf( buf, sizeof(buf), "%d", state->retry_time);
|
||||||
sbytes += tftp_option_add(state, sbytes,
|
sbytes += tftp_option_add(state, sbytes,
|
||||||
(char *)state->spacket.data+sbytes,
|
(char *)state->spacket.data+sbytes,
|
||||||
TFTP_OPTION_INTERVAL);
|
TFTP_OPTION_INTERVAL);
|
||||||
|
Loading…
Reference in New Issue
Block a user