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
12       onoff);
13

DESCRIPTION

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

DEFAULT

23       0
24

PROTOCOLS

26       TFTP
27

EXAMPLE

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

AVAILABILITY

55       Added in 7.48.0
56

RETURN VALUE

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

SEE ALSO

62       CURLOPT_TFTP_BLKSIZE(3),
63
64
65
66libcurl 7.79.1                September 08, 2021    CURLOPT_TFTP_NO_OPTIONS(3)
Impressum