GNURLOPT_E...TIMEOUT_MS(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’… 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