2
0

CURLOPT_TFTP_NO_OPTIONS.3 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 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. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_TFTP_NO_OPTIONS 3 "23 Feb 2016" libcurl libcurl
  26. .SH NAME
  27. CURLOPT_TFTP_NO_OPTIONS \- send no TFTP options requests
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_NO_OPTIONS, long onoff);
  32. .fi
  33. .SH DESCRIPTION
  34. Set \fIonoff\fP to 1L to exclude all TFTP options defined in RFC 2347,
  35. RFC 2348 and RFC 2349 from read and write requests.
  36. This option improves interoperability with legacy servers that do not
  37. acknowledge or properly implement TFTP options. When this option is used
  38. \fICURLOPT_TFTP_BLKSIZE(3)\fP is ignored.
  39. .SH DEFAULT
  40. 0
  41. .SH PROTOCOLS
  42. TFTP
  43. .SH EXAMPLE
  44. .nf
  45. size_t write_callback(char *ptr, size_t size, size_t nmemb, void *fp)
  46. {
  47. return fwrite(ptr, size, nmemb, (FILE *)fp);
  48. }
  49. CURL *curl = curl_easy_init();
  50. if(curl) {
  51. FILE *fp = fopen("foo.bin", "wb");
  52. if(fp) {
  53. curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)fp);
  54. curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
  55. curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/foo.bin");
  56. /* do not send TFTP options requests */
  57. curl_easy_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
  58. /* Perform the request */
  59. curl_easy_perform(curl);
  60. fclose(fp);
  61. }
  62. curl_easy_cleanup(curl);
  63. }
  64. .fi
  65. .SH AVAILABILITY
  66. Added in 7.48.0
  67. .SH RETURN VALUE
  68. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  69. .SH SEE ALSO
  70. .BR CURLOPT_TFTP_BLKSIZE "(3), "