CURLOPT_TFTP_NO_OPTIONS.3 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. .\" generated by cd2nroff 0.1 from CURLOPT_TFTP_NO_OPTIONS.md
  2. .TH CURLOPT_TFTP_NO_OPTIONS 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_TFTP_NO_OPTIONS \- send no TFTP options requests
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_NO_OPTIONS, long onoff);
  9. .fi
  10. .SH DESCRIPTION
  11. Set \fIonoff\fP to 1L to exclude all TFTP options defined in RFC 2347,
  12. RFC 2348 and RFC 2349 from read and write requests.
  13. This option improves interoperability with legacy servers that do not
  14. acknowledge or properly implement TFTP options. When this option is used
  15. \fICURLOPT_TFTP_BLKSIZE(3)\fP is ignored.
  16. .SH DEFAULT
  17. 0
  18. .SH PROTOCOLS
  19. This functionality affects tftp only
  20. .SH EXAMPLE
  21. .nf
  22. size_t write_callback(char *ptr, size_t size, size_t nmemb, void *fp)
  23. {
  24. return fwrite(ptr, size, nmemb, (FILE *)fp);
  25. }
  26. int main(void)
  27. {
  28. CURL *curl = curl_easy_init();
  29. if(curl) {
  30. FILE *fp = fopen("foo.bin", "wb");
  31. if(fp) {
  32. curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)fp);
  33. curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
  34. curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/foo.bin");
  35. /* do not send TFTP options requests */
  36. curl_easy_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
  37. /* Perform the request */
  38. curl_easy_perform(curl);
  39. fclose(fp);
  40. }
  41. curl_easy_cleanup(curl);
  42. }
  43. }
  44. .fi
  45. .SH AVAILABILITY
  46. Added in curl 7.48.0
  47. .SH RETURN VALUE
  48. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  49. .SH SEE ALSO
  50. .BR CURLOPT_TFTP_BLKSIZE (3)