reference/curl/functions/curl-multi-setopt.xml
054a327c0f5802cb86c110f9b25b7caff9613f95
...
...
@@ -1,39 +1,29 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="function.curl-multi-setopt" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>curl_multi_setopt</refname>
7
-
<refpurpose>Set an option for the cURL multi handle</refpurpose>
6
+
<refpurpose>Set a cURL multi option</refpurpose>
8
7
</refnamediv>
9
8

10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
11
<methodsynopsis>
13
12
<type>bool</type><methodname>curl_multi_setopt</methodname>
14
-
<methodparam><type>resource</type><parameter>mh</parameter></methodparam>
13
+
<methodparam><type>CurlMultiHandle</type><parameter>multi_handle</parameter></methodparam>
15
14
<methodparam><type>int</type><parameter>option</parameter></methodparam>
16
15
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
17
16
</methodsynopsis>
18
17
<para>
19
-

18
+
Sets an option on the given cURL multi handle.
20
19
</para>
21
20

22
-
&warn.undocumented.func;
23
-

24
21
</refsect1>
25
22

26
23
<refsect1 role="parameters">
27
24
&reftitle.parameters;
28
25
<variablelist>
29
-
<varlistentry>
30
-
<term><parameter>mh</parameter></term>
31
-
<listitem>
32
-
<para>
33
-
34
-
</para>
35
-
</listitem>
36
-
</varlistentry>
26
+
&curl.mh.description;
37
27
<varlistentry>
38
28
<term><parameter>option</parameter></term>
39
29
<listitem>
...
...
@@ -68,17 +58,113 @@
68
58
possible for transfers using this handle. This means that if you add
69
59
a second request that can use an already existing connection, the
70
60
second request will be "piped" on the same connection.
61
+
As of cURL 7.43.0, the value is a bitmask, and you can also pass 2 to try to multiplex the new
62
+
transfer over an existing HTTP/2 connection if possible.
63
+
Passing 3 instructs cURL to ask for pipelining and multiplexing
64
+
independently of each other.
65
+
As of cURL 7.62.0, setting the pipelining bit has no effect.
66
+
Instead of integer literals, you can also use the CURLPIPE_*
67
+
constants if available.
71
68
</entry>
72
69
</row>
73
70
<row>
74
71
<entry valign="top"><constant>CURLMOPT_MAXCONNECTS</constant></entry>
75
72
<entry valign="top">
76
73
Pass a number that will be used as the maximum amount of
77
-
simultaneously open connections that libcurl may cache. Default is
78
-
10. When the cache is full, curl closes the oldest one in the cache
74
+
simultaneously open connections that libcurl may cache.
75
+
By default the size will be enlarged to fit four times the number
76
+
of handles added via <function>curl_multi_add_handle</function>.
77
+
When the cache is full, curl closes the oldest one in the cache
79
78
to prevent the number of open connections from increasing.
80
79
</entry>
81
80
</row>
81
+
<row>
82
+
<entry valign="top"><constant>CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE</constant></entry>
83
+
<entry valign="top">
84
+
Pass a number that specifies the chunk length threshold for pipelining
85
+
in bytes.
86
+
</entry>
87
+
</row>
88
+
<row>
89
+
<entry valign="top"><constant>CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE</constant></entry>
90
+
<entry valign="top">
91
+
Pass a number that specifies the size threshold for pipelining
92
+
penalty in bytes.
93
+
</entry>
94
+
</row>
95
+
<row>
96
+
<entry valign="top"><constant>CURLMOPT_MAX_CONCURRENT_STREAMS</constant></entry>
97
+
<entry valign="top">
98
+
The set number will be used as the maximum number of concurrent streams for a connections that cURL
99
+
should support on connections done using HTTP/2. Valid values range from
100
+
<literal>1</literal> to <literal>2147483647</literal> (<literal>2^31 - 1</literal>).
101
+
The value passed here would be honored based on other system resources properties.
102
+
Default is <literal>100</literal>.
103
+
</entry>
104
+
</row>
105
+
<row>
106
+
<entry valign="top"><constant>CURLMOPT_MAX_HOST_CONNECTIONS</constant></entry>
107
+
<entry valign="top">
108
+
Pass a number that specifies the maximum number of connections to a
109
+
single host.
110
+
</entry>
111
+
</row>
112
+
<row>
113
+
<entry valign="top"><constant>CURLMOPT_MAX_PIPELINE_LENGTH</constant></entry>
114
+
<entry valign="top">
115
+
Pass a number that specifies the maximum number of requests in a
116
+
pipeline.
117
+
</entry>
118
+
</row>
119
+
<row>
120
+
<entry valign="top"><constant>CURLMOPT_MAX_TOTAL_CONNECTIONS</constant></entry>
121
+
<entry valign="top">
122
+
Pass a number that specifies the maximum number of simultaneously
123
+
open connections.
124
+
</entry>
125
+
</row>
126
+
<row>
127
+
<entry valign="top"><constant>CURLMOPT_PUSHFUNCTION</constant></entry>
128
+
<entry valign="top">
129
+
Pass a <type>callable</type> that will be registered to handle server
130
+
pushes and should have the following signature:
131
+
<methodsynopsis>
132
+
<type>int</type><methodname><replaceable>pushfunction</replaceable></methodname>
133
+
<methodparam><type>resource</type><parameter>parent_ch</parameter></methodparam>
134
+
<methodparam><type>resource</type><parameter>pushed_ch</parameter></methodparam>
135
+
<methodparam><type>array</type><parameter>headers</parameter></methodparam>
136
+
</methodsynopsis>
137
+
<variablelist>
138
+
<varlistentry>
139
+
<term><parameter>parent_ch</parameter></term>
140
+
<listitem>
141
+
<para>
142
+
The parent cURL handle (the request the client made).
143
+
</para>
144
+
</listitem>
145
+
</varlistentry>
146
+
<varlistentry>
147
+
<term><parameter>pushed_ch</parameter></term>
148
+
<listitem>
149
+
<para>
150
+
A new cURL handle for the pushed request.
151
+
</para>
152
+
</listitem>
153
+
</varlistentry>
154
+
<varlistentry>
155
+
<term><parameter>headers</parameter></term>
156
+
<listitem>
157
+
<para>
158
+
The push promise headers.
159
+
</para>
160
+
</listitem>
161
+
</varlistentry>
162
+
</variablelist>
163
+
The push function is supposed to return either
164
+
<constant>CURL_PUSH_OK</constant> if it can handle the push, or
165
+
<constant>CURL_PUSH_DENY</constant> to reject it.
166
+
</entry>
167
+
</row>
82
168
</tbody>
83
169
</tgroup>
84
170
</informaltable>
...
...
@@ -95,9 +181,48 @@
95
181
</para>
96
182
</refsect1>
97
183

184
+
<refsect1 role="changelog">
185
+
&reftitle.changelog;
186
+
<para>
187
+
<informaltable>
188
+
<tgroup cols="2">
189
+
<thead>
190
+
<row>
191
+
<entry>&Version;</entry>
192
+
<entry>&Description;</entry>
193
+
</row>
194
+
</thead>
195
+
<tbody>
196
+
<row>
197
+
<entry>8.2.0</entry>
198
+
<entry>
199
+
Introduced <constant>CURLMOPT_MAX_CONCURRENT_STREAMS</constant>.
200
+
</entry>
201
+
</row>
202
+
&curl.changelog.multi-handle-param;
203
+
<row>
204
+
<entry>7.1.0</entry>
205
+
<entry>
206
+
Introduced <constant>CURLMOPT_PUSHFUNCTION</constant>.
207
+
</entry>
208
+
</row>
209
+
<row>
210
+
<entry>7.0.7</entry>
211
+
<entry>
212
+
Introduced <constant>CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE</constant>,
213
+
<constant>CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE</constant>,
214
+
<constant>CURLMOPT_MAX_HOST_CONNECTIONS</constant>,
215
+
<constant>CURLMOPT_MAX_PIPELINE_LENGTH</constant> and
216
+
<constant>CURLMOPT_MAX_TOTAL_CONNECTIONS</constant>.
217
+
</entry>
218
+
</row>
219
+
</tbody>
220
+
</tgroup>
221
+
</informaltable>
222
+
</para>
223
+
</refsect1>
98
224

99
225
</refentry>
100
-

101
226
<!-- Keep this comment at the end of the file
102
227
Local variables:
103
228
mode: sgml
104
229