53b1770be2c520562bc54d1688f03ae7007b68ad
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_TFTP_NO_OPTIONS.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
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.
13 .\" *
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.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH CURLOPT_TFTP_NO_OPTIONS 3 "23 Feb 2016" "libcurl 7.48.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_TFTP_NO_OPTIONS \- Do not send TFTP options requests.
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_NO_OPTIONS, long onoff);
30 .SH DESCRIPTION
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).
33
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.
37 .SH DEFAULT
38 0
39 .SH PROTOCOLS
40 TFTP
41 .SH EXAMPLE
42 .nf
43 size_t write_callback(char *ptr, size_t size, size_t nmemb, void *fp)
44 {
45   return fwrite(ptr, size, nmemb, (FILE *)fp);
46 }
47
48 CURL *curl = curl_easy_init();
49 if(curl) {
50   FILE *fp = fopen("foo.bin", "wb");
51   if(fp) {
52     curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)fp);
53     curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
54
55     curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/foo.bin");
56
57     /* do not send TFTP options requests */
58     curl_easy_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
59
60     /* Perform the request */
61     curl_easy_perform(curl);
62
63     fclose(fp);
64   }
65   curl_easy_cleanup(curl);
66 }
67 .fi
68 .SH AVAILABILITY
69 Added in 7.48.0
70 .SH RETURN VALUE
71 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.