1 .\" **************************************************************************
3 .\" * Project ___| | | | _ \| |
4 .\" * / __| | | | |_) | |
5 .\" * | (__| |_| | _ <| |___
6 .\" * \___|\___/|_| \_\_____|
8 .\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
21 .\" **************************************************************************
23 .TH CURLOPT_TFTP_NO_OPTIONS 3 "April 06, 2016" "libcurl 7.59.0" "curl_easy_setopt options"
26 CURLOPT_TFTP_NO_OPTIONS \- Do not send TFTP options requests.
28 #include <curl/curl.h>
30 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_NO_OPTIONS, long onoff);
32 Set \fIonoff\fP to 1L to exclude all TFTP options defined in RFC2347, RFC2348
33 and RFC2349 from read and write requests (RRQs/WRQs).
35 This option improves interop with some legacy servers that do not acknowledge
36 or properly implement TFTP options. When this option is used
37 \fICURLOPT_TFTP_BLKSIZE(3)\fP is ignored.
44 size_t write_callback(char *ptr, size_t size, size_t nmemb, void *fp)
46 return fwrite(ptr, size, nmemb, (FILE *)fp);
49 CURL *curl = curl_easy_init();
51 FILE *fp = fopen("foo.bin", "wb");
53 curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)fp);
54 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
56 curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/foo.bin");
58 /* do not send TFTP options requests */
59 curl_easy_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
61 /* Perform the request */
62 curl_easy_perform(curl);
66 curl_easy_cleanup(curl);
72 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.