CURLOPT_TFTP_NO_OPTIONS(3)
π CURLOPT_TFTP_NO_OPTIONS β the "no options, thanks" era π
Okay bestie, this one is from the Library Functions Manual, and it's literally about telling TFTP to chill with the option requests. Let me put you on. β¨
πΈ NAME πΈ
CURLOPT_TFTP_NO_OPTIONS β send no TFTP options requests. That's it. That's the whole gig. π«Ά
β SYNOPSIS β
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_NO_OPTIONS, long onoff);
π DESCRIPTION π
So you set onoff to 1L and boom β you're excluding all the TFTP options defined in RFC 2347, RFC 2348 and RFC 2349 from your read and write requests. All of them. Not a single option. Iconic behavior honestly. π
This is the move when you're dealing with legacy servers that don't acknowledge or properly implement TFTP options β like, this option improves interoperability with those guys. It's giving "we can't make them learn, so we'll just work around them" energy. π
β οΈ Heads up though: when this option is used, CURLOPT_TFTP_BLKSIZE(3) is ignored. Like fully ignored. Don't come for me when your block size setting does nothing, I warned you. π
π DEFAULT π
0
π¦ PROTOCOLS π¦
This functionality affects tftp only. Literally only tftp. Nothing else. Periodt. π
π₯ EXAMPLE π₯
Here's the whole thing, copy it exactly bestie:
size_t write_callback(char *ptr, size_t size, size_t nmemb, void *fp)
{
return fwrite(ptr, size, nmemb, (FILE *)fp);
}
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
FILE *fp = fopen("foo.bin", "wb");
if(fp) {
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)fp);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/foo.bin");
/* do not send TFTP options requests */
curl_easy_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
/* Perform the request */
curl_easy_perform(curl);
fclose(fp);
}
curl_easy_cleanup(curl);
}
}
See that little comment? /* do not send TFTP options requests */ β that's the whole vibe of this manpage in one line. π
π AVAILABILITY π
Added in curl 7.48.0 β so if you're on something older, sorry babe, you don't get this one. π
β¨ RETURN VALUE β¨
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK β slay. Non-zero means an error occurred, and you should check libcurl-errors(3) for the tea. π
π SEE ALSO π
CURLOPT_TFTP_BLKSIZE(3)β the one that gets ignored when you use this option, iykyk π
mwah π that's the whole page! Brought to you by the fine folks at libcurl, dated 2026-10-12, and it's CURLOPT_TFTP_NO_OPTIONS(3) all the way down. Go forth and send zero options requests, bestie. π§π
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms