CURLOPT_STREAM_DEPENDS.3 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_STREAM_DEPENDS 3 "13 Sep 2015" libcurl libcurl
  26. .SH NAME
  27. CURLOPT_STREAM_DEPENDS \- stream this transfer depends on
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_STREAM_DEPENDS,
  32. CURL *dephandle);
  33. .fi
  34. .SH DESCRIPTION
  35. Pass a CURL * pointer in \fIdephandle\fP to identify the stream within the
  36. same connection that this stream is depending upon. This option clears the
  37. exclusive bit and is mutually exclusive to the
  38. \fICURLOPT_STREAM_DEPENDS_E(3)\fP option.
  39. The spec says "Including a dependency expresses a preference to allocate
  40. resources to the identified stream rather than to the dependent stream."
  41. This option can be set during transfer.
  42. \fIdephandle\fP must not be the same as \fIhandle\fP, that will cause this
  43. function to return an error. It must be another easy handle, and it also needs
  44. to be a handle of a transfer that will be sent over the same HTTP/2 connection
  45. for this option to have an actual effect.
  46. .SH DEFAULT
  47. NULL
  48. .SH PROTOCOLS
  49. HTTP/2
  50. .SH EXAMPLE
  51. .nf
  52. CURL *curl = curl_easy_init();
  53. CURL *curl2 = curl_easy_init(); /* a second handle */
  54. if(curl) {
  55. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/one");
  56. /* the second depends on the first */
  57. curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/two");
  58. curl_easy_setopt(curl2, CURLOPT_STREAM_DEPENDS, curl);
  59. /* then add both to a multi handle and transfer them! */
  60. }
  61. .fi
  62. .SH AVAILABILITY
  63. Added in 7.46.0
  64. .SH RETURN VALUE
  65. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  66. .SH "SEE ALSO"
  67. .BR CURLOPT_STREAM_WEIGHT "(3), " CURLOPT_STREAM_DEPENDS_E "(3), "