CURLOPT_TFTP_NO_OPTIONS.3 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2021, 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 https://curl.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 \- send no TFTP options requests
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_NO_OPTIONS, long onoff);
  30. .fi
  31. .SH DESCRIPTION
  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).
  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. CURL *curl = curl_easy_init();
  48. if(curl) {
  49. FILE *fp = fopen("foo.bin", "wb");
  50. if(fp) {
  51. curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)fp);
  52. curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
  53. curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/foo.bin");
  54. /* do not send TFTP options requests */
  55. curl_easy_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
  56. /* Perform the request */
  57. curl_easy_perform(curl);
  58. fclose(fp);
  59. }
  60. curl_easy_cleanup(curl);
  61. }
  62. .fi
  63. .SH AVAILABILITY
  64. Added in 7.48.0
  65. .SH RETURN VALUE
  66. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  67. .SH SEE ALSO
  68. .BR CURLOPT_TFTP_BLKSIZE "(3), "