1CURLOPT_TFTP_NO_OPTIONS(3) curl_easy_setopt options CURLOPT_TFTP_NO_OPTIONS(3)
2
3
4

NAME

6       CURLOPT_TFTP_NO_OPTIONS - send no TFTP options requests
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_NO_OPTIONS, long onoff);
12

DESCRIPTION

14       Set onoff to 1L to exclude all TFTP options defined in RFC2347, RFC2348
15       and RFC2349 from read and write requests.
16
17       This option improves interoperability with legacy servers that  do  not
18       acknowledge  or  properly  implement  TFTP options. When this option is
19       used CURLOPT_TFTP_BLKSIZE(3) is ignored.
20

DEFAULT

22       0
23

PROTOCOLS

25       TFTP
26

EXAMPLE

28       size_t write_callback(char *ptr, size_t size, size_t nmemb, void *fp)
29       {
30         return fwrite(ptr, size, nmemb, (FILE *)fp);
31       }
32
33       CURL *curl = curl_easy_init();
34       if(curl) {
35         FILE *fp = fopen("foo.bin", "wb");
36         if(fp) {
37           curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)fp);
38           curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
39
40           curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/foo.bin");
41
42           /* do not send TFTP options requests */
43           curl_easy_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
44
45           /* Perform the request */
46           curl_easy_perform(curl);
47
48           fclose(fp);
49         }
50         curl_easy_cleanup(curl);
51       }
52

AVAILABILITY

54       Added in 7.48.0
55

RETURN VALUE

57       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
58       if not.
59

SEE ALSO

61       CURLOPT_TFTP_BLKSIZE(3),
62
63
64
65libcurl 8.0.1                  January 02, 2023     CURLOPT_TFTP_NO_OPTIONS(3)
Impressum