1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_TFTP_BLKSIZE
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_MAXFILESIZE (3)
9Protocol:
10  - TFTP
11Added-in: 7.19.4
12---
13
14# NAME
15
16CURLOPT_TFTP_BLKSIZE - TFTP block size
17
18# SYNOPSIS
19
20~~~c
21#include <curl/curl.h>
22
23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TFTP_BLKSIZE, long blocksize);
24~~~
25
26# DESCRIPTION
27
28Specify *blocksize* to use for TFTP data transmission. Valid range as per
29RFC 2348 is 8-65464 bytes. The default of 512 bytes is used if this option is
30not specified. The specified block size is only used if supported by the
31remote server. If the server does not return an option acknowledgment or
32returns an option acknowledgment with no block size, the default of 512 bytes
33is used.
34
35# DEFAULT
36
37512
38
39# %PROTOCOLS%
40
41# EXAMPLE
42
43~~~c
44int 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
62Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
63