CURLOPT_STREAM_DEPENDS_E.3 1.9 KB

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