CURLOPT_STREAM_DEPENDS.3 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. .\" generated by cd2nroff 0.1 from CURLOPT_STREAM_DEPENDS.md
  2. .TH CURLOPT_STREAM_DEPENDS 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_STREAM_DEPENDS \- stream this transfer depends on
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_STREAM_DEPENDS,
  9. CURL *dephandle);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a CURL pointer in \fIdephandle\fP to identify the stream within the same
  13. connection that this stream is depending upon. This option clears the
  14. exclusive bit and is mutually exclusive to the \fICURLOPT_STREAM_DEPENDS_E(3)\fP
  15. option.
  16. The spec says "Including a dependency expresses a preference to allocate
  17. resources to the identified stream rather than to the dependent stream."
  18. This option can be set during transfer.
  19. \fIdephandle\fP must not be the same as \fIhandle\fP, that makes this function return
  20. an error. It must be another easy handle, and it also needs to be a handle of
  21. a transfer that is about to be sent over the same HTTP/2 connection for this
  22. option to have an actual effect.
  23. .SH DEFAULT
  24. NULL
  25. .SH PROTOCOLS
  26. This functionality affects http only
  27. .SH EXAMPLE
  28. .nf
  29. int main(void)
  30. {
  31. CURL *curl = curl_easy_init();
  32. CURL *curl2 = curl_easy_init(); /* a second handle */
  33. if(curl) {
  34. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/one");
  35. /* the second depends on the first */
  36. curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/two");
  37. curl_easy_setopt(curl2, CURLOPT_STREAM_DEPENDS, curl);
  38. /* then add both to a multi handle and transfer them! */
  39. }
  40. }
  41. .fi
  42. .SH AVAILABILITY
  43. Added in curl 7.46.0
  44. .SH RETURN VALUE
  45. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  46. .SH SEE ALSO
  47. .BR CURLMOPT_PIPELINING (3),
  48. .BR CURLOPT_HTTP_VERSION (3),
  49. .BR CURLOPT_STREAM_DEPENDS_E (3),
  50. .BR CURLOPT_STREAM_WEIGHT (3)