GNURLOPT_E...TIMEOUT_MS(3)
π
GNURLOPT_E...TIMEOUT_MS(3) β aka the CURLOPT_EXPECT_100_TIMEOUT_MS moment
okay so bestie, we're deep in the curl_easy_setopt options corner of the gnurl manual (that's the manual name, and yes it's giving very "I live in the options section" energy) and today's main character is a timeout option. buckle up π
β¨ NAME β¨
CURLOPT_EXPECT_100_TIMEOUT_MS β the timeout for that whole Expect: 100-continue response situation π¦
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_EXPECT_100_TIMEOUT_MS,
long milliseconds);
β¨ DESCRIPTION β¨
so you pass a long here, right? and that number tells libcurl how many milliseconds to sit there and wait for the server to hit you back with HTTP status 100 (Continue), 417 (Expectation Failed) or something similar β and this is after you've already sent an HTTP request that had an Expect: 100-continue header in it. π
and if that wait times out before any response shows up? the request body gets sent anyway. no cap, it just goes. πββοΈπ¨
πΈ DEFAULT πΈ
1000 milliseconds β one whole second, periodt β±οΈ
π PROTOCOLS π
HTTP
π EXAMPLE π
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* wait 3 seconds for 100-continue */
curl_easy_setopt(curl, CURLOPT_EXPECT_100_TIMEOUT_MS, 3000L);
curl_easy_perform(curl);
}
look at her go ππ
β AVAILABILITY β
added in 7.36.0 β vintage but make it iconic π
π RETURN VALUE π
returns CURLE_OK if the option is supported (slay), and CURLE_UNKNOWN_OPTION if it's not (π).
π«Ά SEE ALSO π«Ά
and that's the whole vibe check, bestie β documented, footnoted, and fully served β¨
sign-off szn: this lil page is from libcurl 7.37.0, dated 19 Jun 2014, and it lives at GNURLOPT_E...TIMEOUT_MS(3) in the manual. mwah ππ
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, 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