CURLOPT_STREAM_DEPENDS_E(3)
π CURLOPT_STREAM_DEPENDS_E(3) β like, the exclusive-stream-dependency one, bestie
okay so this is a page from the Library Functions Manual and honestly? it's giving "iconic feature that got canceled" π but we're gonna learn it anyway because knowledge is free β¨ the function is CURLOPT_STREAM_DEPENDS_E and its whole personality is "stream this transfer depends on exclusively" β and yes, the _E stands for Exclusive, we love a dramatic capital letter π
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_STREAM_DEPENDS_E,
CURL *dephandle);
πΈ DESCRIPTION πΈ
so basically you pass a CURL pointer in dephandle and that's you telling curl "hey bestie, this stream depends on that stream β exclusively β within the same connection." π«Ά that means it depends on it and it sets the Exclusive bit. both things. at once. main character energy fr fr π
the spec is out here saying, and I quote directly:
"Including a dependency expresses a preference to allocate resources to the identified stream rather than to the dependent stream."
like yes, the spec said preference, we love a polite king π
and okay, here's the tea on what exclusive actually does: setting a dependency with the exclusive flag for a reprioritized stream causes all the dependencies of the new parent stream to become dependent on the reprioritized stream. so like... the whole family tree gets rearranged. it's giving reprioritization arc π
this option can be set during transfer β no need to finish anything first, go off β¨
now the rules, because there are always rules π:
dephandlemust not be the same ashandle. if you do that? the function returns an error. not it.- it must be another easy handle
- and it also needs to be a handle of a transfer that is about to be sent over the same HTTP/2 connection β otherwise this option doesn't actually do anything, it's just vibes π
β οΈ and now for the sad part π β since version 8.21.0, setting this option no longer has an effect. HTTP/2 stream dependencies were introduced in RFC 7540 and then later deprecated in RFC 9113. it was iconic, then it was deprecated. we've all been there π
π DEFAULT π
NULL
(obviously. no dependency, no drama. a clean slate. a fresh face. π¦)
π¦ PROTOCOLS π¦
this functionality affects http only β that's it, that's the tweet π
π₯ EXAMPLE π₯
here's the actual example, character for character, because we do not mess with code in this house:
int main(void)
{
CURL *curl = curl_easy_init();
CURL *curl2 = curl_easy_init(); /* a second handle */
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/one");
/* the second depends on the first */
curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/two");
curl_easy_setopt(curl2, CURLOPT_STREAM_DEPENDS_E, curl);
/* then add both to a multi handle and transfer them */
}
}
see how curl2 is like "I'm nothing without curl" π obsessed. the comment literally says /* the second depends on the first */ β the way that comment ate π
π DEPRECATED π
Deprecated since 8.21.0. yeah. we know. it's fine. it's fine. π₯²
β AVAILABILITY β
Added in curl 7.46.0 β a vintage. an icon. a legend, even π
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error π
CURLE_OK (0) means everything was OK β slay π non-zero means an error occurred, so go check libcurl-errors(3) for the whole lore dump π
π SEE ALSO π
(yes go read those too, we're nothing if not thorough π«Ά)
and that's the whole page, bestie π brought to you by libcurl, dated 2026-10-12, with love from the Library Functions Manual β stay exclusive, stay deprecated, stay iconic β¨ π π¦ π
π¦ 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