I've been tinkering in C to handle PUT requests that use Chunked Encoding, and this answer has been immensely helpful.
While handling incoming datastreams, I noticed curl
seems to use 16372
as the max Chunklen,
--> ChunkSize string: 3ff4 Dec: 16372
--> ChunkSize string: 3ff4 Dec: 16372
--> ChunkSize string: 1e7d Dec: 7805
--> ChunkSize string: 0 Dec: 0
and Golang seems to use 32768
as max:
--> ChunkSize string: 8000 Dec: 32768
--> ChunkSize string: 8000 Dec: 32768
--> ChunkSize string: 1e1d Dec: 7709
--> ChunkSize string: 0 Dec: 0
How are ChunkLens chosen by say, curl? Is there a rhyme or reason to choose 16372
, which btw is not divisible by 8:
>>> 16372 / 8
2046.5
When sending a large file, why shouldn't we use a larger chunksize? Anything else I should be aware of when it comes to chunksize?
thanks!