CURLOPT_TFTP_BLKSIZE.md (1366B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLOPT_TFTP_BLKSIZE 5 Section: 3 6 Source: libcurl 7 See-also: 8 - CURLOPT_MAXFILESIZE (3) 9 Protocol: 10 - TFTP 11 Added-in: 7.19.4 12 --- 13 14 # NAME 15 16 CURLOPT_TFTP_BLKSIZE - TFTP block size 17 18 # SYNOPSIS 19 20 ~~~c 21 #include <curl/curl.h> 22 23 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_BLKSIZE, long blocksize); 24 ~~~ 25 26 # DESCRIPTION 27 28 Specify *blocksize* to use for TFTP data transmission. Valid range as per 29 RFC 2348 is 8-65464 bytes. The default of 512 bytes is used if this option is 30 not specified. The specified block size is only used if supported by the 31 remote server. If the server does not return an option acknowledgment or 32 returns an option acknowledgment with no block size, the default of 512 bytes 33 is used. 34 35 # DEFAULT 36 37 512 38 39 # %PROTOCOLS% 40 41 # EXAMPLE 42 43 ~~~c 44 int main(void) 45 { 46 CURL *curl = curl_easy_init(); 47 if(curl) { 48 CURLcode res; 49 curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/bootimage"); 50 /* try using larger blocks */ 51 curl_easy_setopt(curl, CURLOPT_TFTP_BLKSIZE, 2048L); 52 res = curl_easy_perform(curl); 53 curl_easy_cleanup(curl); 54 } 55 } 56 ~~~ 57 58 # %AVAILABILITY% 59 60 # RETURN VALUE 61 62 curl_easy_setopt(3) returns a CURLcode indicating success or error. 63 64 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see 65 libcurl-errors(3).