Imported Upstream version 7.48.0
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_STREAM_WEIGHT.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2015, 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.haxx.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 .\" **************************************************************************
22 .\"
23 .TH CURLOPT_STREAM_WEIGHT 3 "13 Sep 2015" "libcurl 7.46.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_STREAM_WEIGHT \- set numerical stream weight
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_STREAM_WEIGHT, long weight);
30 .SH DESCRIPTION
31 Set the long \fIweight\fP to a number between 1 and 256.
32
33 When using HTTP/2, this option sets the individual weight for this particular
34 stream used by the easy \fIhandle\fP. Setting and using weights only makes
35 sense and is only usable when doing multiple streams over the same
36 connections, which thus implies that you use \fICURLMOPT_PIPELINING(3)\fP.
37
38 This option can be set during transfer and will then cause the updated weight
39 info get sent to the server the next time a HTTP/2 frame is sent to the
40 server.
41
42 See section 5.3 of RFC 7540 for protocol details:
43 https://httpwg.github.io/specs/rfc7540.html#StreamPriority
44
45 Streams with the same parent should be allocated resources proportionally
46 based on their weight. So if you have two streams going, stream A with weight
47 16 and stream B with weight 32, stream B will get two thirds (32/48) of the
48 available bandwidth (assuming the server can send off the data equally for
49 both streams).
50 .SH DEFAULT
51 If nothing is set, the HTTP/2 protocol itself will use its own default which
52 is 16.
53 .SH PROTOCOLS
54 HTTP/2
55 .SH EXAMPLE
56 TODO
57 .SH AVAILABILITY
58 Added in 7.46.0
59 .SH RETURN VALUE
60 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
61 .SH "SEE ALSO"
62 .BR CURLOPT_STREAM_DEPENDS "(3), " CURLOPT_STREAM_DEPENDS_E "(3), "
63 .BR CURLOPT_PIPEWAIT "(3), " CURLMOPT_PIPELINING "(3), "