CURLOPT_STREAM_DEPENDS(3)
π CURLOPT_STREAM_DEPENDS(3) β the "stream this transfer depends on" one
ok so this page lives in the Library Functions Manual section of the libcurl docs, and honestly bestie, it's a little bit of a sad story (deprecation arc π) but we're gonna get through it together.
πΈ NAME πΈ
CURLOPT_STREAM_DEPENDS β literally "stream this transfer depends on". that's the whole vibe. a stream that has a dependency.
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_STREAM_DEPENDS,
CURL *dephandle);
look at that signature. two handles. one of them is the dependee, one is the depender. bestie energy fr fr π«Ά
π DESCRIPTION π
So here's the tea. You pass a CURL pointer in dephandle to identify the stream β within the same connection β that this stream is depending upon. it's giving "you're my emotional support stream" π
Important bits, no cap:
- This option clears the exclusive bit.
- It is mutually exclusive to the
CURLOPT_STREAM_DEPENDS_E(3)option. like, pick one. you can't have both. that's not the vibe.
The spec says β and I'm quoting here because it's iconic β "Including a dependency expresses a preference to allocate resources to the identified stream rather than to the dependent stream." so basically you're telling the server "hey, feed my friend first π".
You can set this option during transfer. it's flexible like that β¨
β οΈ okay so the rules, and these are real rules: dephandle must not be the same as handle β if it is, this function returns an error. periodt. It must be another easy handle, and it also needs to be a handle of a transfer that's about to be sent over the same HTTP/2 connection for this option to have an actual effect. otherwise it's just screaming into the void π
And now 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. they really said "we don't do that anymore". rip to a real one π
π DEFAULT π
NULL
like, nothing. nobody's depending on anybody. independent queen behavior π
π PROTOCOLS π
This functionality affects http only. just http. that's it. that's the list.
π¦ EXAMPLE π¦
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, curl);
/* then add both to a multi handle and transfer them */
}
}
see how curl2 is like "I depend on curl"? cute. very sibling energy. the comment even says it: the second depends on the first π«Ά (and yes, you do have to add both to a multi handle and transfer them yourself β the comment says so, I don't make the rules)
π DEPRECATED π
Deprecated since 8.21.0. she's retired but she's still iconic, okay? π
β AVAILABILITY β
Added in curl 7.46.0. so she had a good run, ngl.
π₯ RETURN VALUE π₯
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK(0) means everything was OK π- non-zero means an error occurred π β see
libcurl-errors(3)for the whole encyclopedia of what went wrong.
π SEE ALSO π
that's the whole page bestie, you ate that π β¨
π§ signing off: this was libcurl, dated 2026-10-12, page CURLOPT_STREAM_DEPENDS(3). streams may come and go but the manual page remains π
π¦ 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