TFTP: add option to suppress TFTP option requests (Part 1)

Some TFTP server implementations ignore the "TFTP Option extension"
(RFC 1782-1784, 2347-2349), or implement it in a flawed way, causing
problems with libcurl. Another switch for curl_easy_setopt
"CURLOPT_TFTP_NO_OPTIONS" is introduced which prevents libcurl from
sending TFTP option requests to a server, avoiding many problems caused
by faulty implementations.

Bug: https://github.com/curl/curl/issues/481
This commit is contained in:
Michael Koenig 2015-08-17 17:54:47 +02:00 committed by Jay Satiro
parent 527e86b054
commit 9dc3eaee29
8 changed files with 90 additions and 27 deletions

View file

@ -843,9 +843,16 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
*/
data->set.server_response_timeout = va_arg( param , long ) * 1000;
break;
case CURLOPT_TFTP_NO_OPTIONS:
/*
* Option that prevents libcurl from sending TFTP option requests to the
* server.
*/
data->set.tftp_no_options = va_arg(param, long) != 0;
break;
case CURLOPT_TFTP_BLKSIZE:
/*
* TFTP option that specifies the block size to use for data transmission
* TFTP option that specifies the block size to use for data transmission.
*/
data->set.tftp_blksize = va_arg(param, long);
break;