CURLINFO_CONDITION_UNMET(3)
π CURLINFO_CONDITION_UNMET(3) β Library Functions Manual
ok so bestie, we're looking at CURLINFO_CONDITION_UNMET today, and it's genuinely one of those little info-grabbers that eats. it lives over in the curl_easy_getinfo fam, iykyk π
β¨ NAME β¨
CURLINFO_CONDITION_UNMET β the "unmet time conditional or 304 HTTP response" vibe check πΈ
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONDITION_UNMET,
long *unmet);
π DESCRIPTION π
okay so the move here is: you pass a pointer to a long, and that long gets the number 1 dropped into it if the condition you set up in the previous request did not match β see CURLOPT_TIMECONDITION(3) for the receipts π
and like, the way that this is actually useful? if this returns a 1, you know the reason you didn't get any data back is that your condition wasn't fulfilled. no mystery, no ghosting, the condition just said no π
the long that this argument points to gets a zero stored instead if the condition was met. slay.
also β and this is the part people forget β this can also return 1 if the server responded with a 304 HTTP status code, for example after you sent a custom "If-Match-*" header. so it's doing double duty, main character energy fr fr π
π PROTOCOLS π
this functionality affects http only. that's it, that's the whole list π«Ά
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* January 1, 2020 is 1577833200 */
curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
/* If-Modified-Since the above time stamp */
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
/* Perform the request */
result = curl_easy_perform(curl);
if(!result) {
/* check the time condition */
long unmet;
result = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
if(!result) {
printf("The time condition was %sfulfilled\n", unmet?"NOT":"");
}
}
}
}
like, look at her go π§ she sets a URL, sets CURLOPT_TIMEVALUE to 1577833200L (that's January 1, 2020, the comment literally says so), asks for CURL_TIMECOND_IFMODSINCE, performs the request, and then checks CURLINFO_CONDITION_UNMET to see what happened. and the printf there does that cute little trick where unmet?"NOT":"" slots right into "%sfulfilled" β so you get either fulfilled or NOTfulfilled. iconic string surgery π
β¨
β AVAILABILITY β
Added in curl 7.19.4 β so she's been around a minute, respect the elders π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK. non-zero means an error occurred β go peek at libcurl-errors(3) for the full tea π
π₯ SEE ALSO π₯
ok that's the whole page, no notes πΈ this has been libcurl, dated 2026-10-12, and your girl CURLINFO_CONDITION_UNMET(3) is signing off β mwah, go check your time conditions, ily π«Άππ
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms