GNURLOPT_TFTP_BLKSIZE(3)
π GNURLOPT_TFTP_BLKSIZE(3) β like, the TFTP block size one π
okay bestie so you're in the curl_easy_setopt options zone, and this little cutie lives in the gnurl fam (GNURLOPT_TFTP_BLKSIZE, bestie, say it with me). It's all about how big your TFTP blocks are. Let's get into it β¨
πΈ NAME πΈ
CURLOPT_TFTP_BLKSIZE β literally just the TFTP block size π¦
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_BLKSIZE, long
blocksize);
π DESCRIPTION π
So you're telling curl what blocksize to use for TFTP data transmission. That's the whole vibe π«Ά
The valid range, per RFC2348, is 8-65464 bytes. If you don't specify this option at all, you get the default of 512 bytes. No cap, that's just what it is.
Lowkey important caveat bestie: the block size you pick will only be used pending support by the remote server π like, it's not a guarantee, it's a hope.
And if the server doesn't return an option acknowledgement, or it returns an option acknowledgement with no blksize, then the default of 512 bytes gets used instead. So yeah, 512 is giving main character energy and always finds its way back π
π DEFAULT π
512
π¦ PROTOCOLS π¦
TFTP
π EXAMPLE π
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/bootimage");
/* try using larger blocks */
curl_easy_setopt(curl, CURLOPT_TFTP_BLKSIZE, 2048L);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
(not me obsessed with that 2048L β go big or go home fr fr π₯)
π AVAILABILITY π
Added in 7.19.4 β (she's been iconic for a minute)
π RETURN VALUE π
Returns CURLE_OK if the option is supported π and CURLE_UNKNOWN_OPTION if not π β that's the vibe check, and it took it.
πΈ SEE ALSO πΈ
and that's the whole page bestie!! ππ§
β¨ cute sign-off β¨ β this lil beauty comes to you from libcurl 7.37.0, dated 19 Jun 2014. slay forever, periodt π π
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms