1 .\" **************************************************************************
3 .\" * Project ___| | | | _ \| |
4 .\" * / __| | | | |_) | |
5 .\" * | (__| |_| | _ <| |___
6 .\" * \___|\___/|_| \_\_____|
8 .\" * Copyright (C) 1998 - 2014, 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 http://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 "23 Feb 2016" "libcurl 7.48.0" "curl_easy_setopt options"
25 CURLOPT_TFTP_NO_OPTIONS \- Do not send TFTP options requests.
27 #include <curl/curl.h>
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_NO_OPTIONS, long onoff);
31 Set \fIonoff\fP to 1L to exclude all TFTP options defined in RFC2347, RFC2348
32 and RFC2349 from read and write requests (RRQs/WRQs).
34 This option improves interop with some legacy servers that do not acknowledge
35 or properly implement TFTP options. When this option is used
36 \fICURLOPT_TFTP_BLKSIZE(3)\fP is ignored.
43 size_t write_callback(char *ptr, size_t size, size_t nmemb, void *fp)
45 return fwrite(ptr, size, nmemb, (FILE *)fp);
48 CURL *curl = curl_easy_init();
50 FILE *fp = fopen("foo.bin", "wb");
52 curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)fp);
53 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
55 curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/foo.bin");
57 /* do not send TFTP options requests */
58 curl_easy_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
60 /* Perform the request */
61 curl_easy_perform(curl);
65 curl_easy_cleanup(curl);
71 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.