CURLMOPT_C...NALTY_SIZE(3)

πŸ’… CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE(3) πŸ’…

okay so bestie, we're in the libcurl manual pages, section 3, and today's main character is CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE(3) β€” the chunk length threshold for pipelining. yes, that's a long name, no, we're not shortening it, it's iconic as-is πŸŽ€


✨ NAME ✨

CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE β€” the chunk length threshold for pipelining, fr fr


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <curl/curl.h>

CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE,
                            long size);

🌸 DESCRIPTION 🌸

so here's the tea: there's literally no function for this since pipelining was removed in 7.62.0. it's giving retirement era, ngl πŸ’€

but like, historically? you'd pass a long with a size in bytes. the vibe was: if a transfer in a pipeline is currently processing a chunked (Transfer-encoding: chunked) request with a current chunk length larger than CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE(3), then that pipeline is not considered for additional requests β€” even if it is shorter than CURLMOPT_MAX_PIPELINE_LENGTH(3). yes, even then. the pipeline gets a little time-out in the corner πŸ™ˆ


⭐ DEFAULT ⭐

0, which means that penalization is inactive. so by default nobody's in trouble, we're all slaying 🫢


🌈 PROTOCOLS 🌈

this functionality affects http only. http girlies only, sorry to the rest of y'all πŸ’…


πŸ”₯ EXAMPLE πŸ”₯

int main(void)
{
  CURLM *m = curl_multi_init();
  long maxchunk = 10000;
  curl_multi_setopt(m, CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, maxchunk);
}

look at her go. maxchunk = 10000, main character energy, no cap πŸ‘‘


🧚 AVAILABILITY 🧚

added in curl 7.30.0 β€” so she's been around a minute, an elder stateswoman of the multi options πŸŽ€


πŸ’– RETURN VALUE πŸ’–

curl_multi_setopt(3) returns a CURLMcode indicating success or error.

CURLM_OK (0) means everything was OK. non-zero means an error occurred β€” see libcurl-errors(3) for the full rundown, iykyk 😭


πŸ“ SEE ALSO πŸ“

go read those next bestie, they're lowkey siblings of this one 🌸


and that's the whole page!! written by the libcurl girlies, dated 2026-10-12 β€” catch you in the next manpage, mwah πŸ’œβœ¨

πŸ“¦ where this page comes from