1CURLOPT_TFTP_NO_OPTIONS(3) curl_easy_setopt options CURLOPT_TFTP_NO_OPTIONS(3)
2
3
4
6 CURLOPT_TFTP_NO_OPTIONS - Do not send TFTP options requests.
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_NO_OPTIONS, long
12 onoff);
13
15 Set onoff to 1L to exclude all TFTP options defined in RFC2347, RFC2348
16 and RFC2349 from read and write requests (RRQs/WRQs).
17
18 This option improves interop with some legacy servers that do not ac‐
19 knowledge or properly implement TFTP options. When this option is used
20 CURLOPT_TFTP_BLKSIZE(3) is ignored.
21
23 0
24
26 TFTP
27
29 size_t write_callback(char *ptr, size_t size, size_t nmemb, void *fp)
30 {
31 return fwrite(ptr, size, nmemb, (FILE *)fp);
32 }
33
34 CURL *curl = curl_easy_init();
35 if(curl) {
36 FILE *fp = fopen("foo.bin", "wb");
37 if(fp) {
38 curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)fp);
39 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
40
41 curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/foo.bin");
42
43 /* do not send TFTP options requests */
44 curl_easy_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
45
46 /* Perform the request */
47 curl_easy_perform(curl);
48
49 fclose(fp);
50 }
51 curl_easy_cleanup(curl);
52 }
53
55 Added in 7.48.0
56
58 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
59 if not.
60
61
62
63libcurl 7.76.1 November 04, 2020 CURLOPT_TFTP_NO_OPTIONS(3)