comparison mupdf-source/thirdparty/curl/docs/libcurl/opts/CURLOPT_STREAM_WEIGHT.3 @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 .\" **************************************************************************
2 .\" * _ _ ____ _
3 .\" * Project ___| | | | _ \| |
4 .\" * / __| | | | |_) | |
5 .\" * | (__| |_| | _ <| |___
6 .\" * \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2017, 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 an 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 .nf
57 CURL *curl = curl_easy_init();
58 CURL *curl2 = curl_easy_init(); /* a second handle */
59 if(curl) {
60 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/one");
61 curl_easy_setopt(curl, CURLOPT_STREAM_WEIGHT, 10L);
62
63 /* the second has twice the weight */
64 curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/two");
65 curl_easy_setopt(curl2, CURLOPT_STREAM_WEIGHT, 20L);
66
67 /* then add both to a multi handle and transfer them! */
68 }
69 .fi
70 .SH AVAILABILITY
71 Added in 7.46.0
72 .SH RETURN VALUE
73 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
74 .SH "SEE ALSO"
75 .BR CURLOPT_STREAM_DEPENDS "(3), " CURLOPT_STREAM_DEPENDS_E "(3), "
76 .BR CURLOPT_PIPEWAIT "(3), " CURLMOPT_PIPELINING "(3), "