Skip to content

Commit

Permalink
Update curl
Browse files Browse the repository at this point in the history
  • Loading branch information
mowangjuanzi committed Sep 24, 2024
1 parent e54c86b commit 33dc84f
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 114 deletions.
102 changes: 2 additions & 100 deletions reference/curl/constants.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 6369333ffbe351e8d072127ff8b42512bd4b8078 Maintainer: daijie Status: ready -->
<!-- EN-Revision: 141b05e576781405f9077abbe89e7a8b2a5eb946 Maintainer: daijie Status: ready -->
<!-- CREDITS: mowangjuanzi, Luffy -->
<appendix xml:id="curl.constants" xmlns="http://docbook.org/ns/docbook">
&reftitle.constants;
Expand Down Expand Up @@ -3295,105 +3295,6 @@
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-pipelining">
<term>
<constant>CURLMOPT_PIPELINING</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
自 cURL 7.16.0 起可用。
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-maxconnects">
<term>
<constant>CURLMOPT_MAXCONNECTS</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
自 cURL 7.16.3 起可用。
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-max-concurrent-streams">
<term>
<constant>CURLMOPT_MAX_CONCURRENT_STREAMS</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
自 PHP 8.2.0 和 cURL 7.67.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-chunk-length-penalty-size">
<term>
<constant>CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
自 PHP 7.0.7 和 cURL 7.30.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-content-length-penalty-size">
<term>
<constant>CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
自 PHP 7.0.7 和 cURL 7.30.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-max-host-connections">
<term>
<constant>CURLMOPT_MAX_HOST_CONNECTIONS</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
自 PHP 7.0.7 和 cURL 7.30.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-max-pipeline-length">
<term>
<constant>CURLMOPT_MAX_PIPELINE_LENGTH</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
自 PHP 7.0.7 和 cURL 7.30.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-max-total-connections">
<term>
<constant>CURLMOPT_MAX_TOTAL_CONNECTIONS</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
自 PHP 7.0.7 和 cURL 7.30.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-pushfunction">
<term>
<constant>CURLMOPT_PUSHFUNCTION</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
自 PHP 7.1.0 和 cURL 7.44.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlssh-auth-agent">
<term>
<constant>CURLSSH_AUTH_AGENT</constant>
Expand Down Expand Up @@ -4211,6 +4112,7 @@
</variablelist>
&reference.curl.constants-curl-share-setopt;
&reference.curl.constants-curl-getinfo;
&reference.curl.constants-curl-multi-setopt;
&reference.curl.constants-curlproto;
&reference.curl.constants-curl-error;
&reference.curl.constants-curl-multi;
Expand Down
2 changes: 1 addition & 1 deletion reference/curl/constants_curl_multi.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 141b05e576781405f9077abbe89e7a8b2a5eb946 Maintainer: mowangjuanzi Status: ready -->
<!-- EN-Revision: 6369333ffbe351e8d072127ff8b42512bd4b8078 Maintainer: mowangjuanzi Status: ready -->
<variablelist xml:id="constant.curl-multi.constants" role="constant_list">
<title>curl_multi_<replaceable>*</replaceable> 状态常量</title>
<varlistentry xml:id="constant.curlm-added-already">
Expand Down
145 changes: 145 additions & 0 deletions reference/curl/constants_curl_multi_setopt.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 141b05e576781405f9077abbe89e7a8b2a5eb946 Maintainer: mowangjuanzi Status: ready -->
<variablelist xml:id="constant.curl-multi-setopt.constants" role="constant_list">
<title><function>curl_multi_setopt</function></title>
<varlistentry xml:id="constant.curlmopt-chunk-length-penalty-size">
<term>
<constant>CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
指定用于管道处理的块长度阈值(以字节为单位)。自 PHP 7.0.7 和 cURL 7.30.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-content-length-penalty-size">
<term>
<constant>CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
指定用于管道惩罚(pipelining penalty)的长度阈值(以字节为单位)。自 PHP 7.0.7 和 cURL 7.30.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-maxconnects">
<term>
<constant>CURLMOPT_MAXCONNECTS</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
指定 libcurl 可以缓存的最大同时打开的连接数。默认情况下,这个大小会自动扩展到通过 <function>curl_multi_add_handle</function>
添加的句柄数的四倍。当缓存已满时,cURL 会关闭缓存中最旧的一个连接,以防止打开的连接数继续增加。自 cURL 7.16.3 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-max-concurrent-streams">
<term>
<constant>CURLMOPT_MAX_CONCURRENT_STREAMS</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
指定 cURL 在使用 HTTP/2 连接中应支持的最大并发流数量。有效值范围是从 <literal>1</literal> 到
<literal>2147483647</literal>(<literal>2^31 - 1</literal>)。这里设置的值将根据其他系统资源属性来确定是否执行。默认值是
<literal>100</literal>。自 PHP 8.2.0 和 cURL 7.67.0 起可用。
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-max-host-connections">
<term>
<constant>CURLMOPT_MAX_HOST_CONNECTIONS</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
指定单个主机的最大连接数。自 PHP 7.0.7 和 cURL 7.30.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-max-pipeline-length">
<term>
<constant>CURLMOPT_MAX_PIPELINE_LENGTH</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
指定管道中的最大请求数。自 PHP 7.0.7 和 cURL 7.30.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-max-total-connections">
<term>
<constant>CURLMOPT_MAX_TOTAL_CONNECTIONS</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
指定同时打开的最大连接数。自 PHP 7.0.7 和 cURL 7.30.0 起可用
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-pipelining">
<term>
<constant>CURLMOPT_PIPELINING</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
传递 1 启用或传递 0 禁用。在多句柄上启用管道将使其尝试对使用此句柄的传输尽可能执行 HTTP
管道操作。这意味着如果添加的第二个请求可以使用已有连接,则第二个请求将在同一连接上使用“管道”。自
cURL 7.43.0 起,该值是位掩码,传递 2 将尝试在现有的 HTTP/2 连接上多路复用新传输。传递
3 指示 cURL 请求彼此独立的管道和多路复用。自 cURL 7.62.0 起,设置管道 bit 没有效果。除了整数文字,还可以使用
CURLPIPE_* 常量。自 cURL 7.16.0 起可用。
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlmopt-pushfunction">
<term>
<constant>CURLMOPT_PUSHFUNCTION</constant>
(<type>int</type>)
</term>
<listitem>
<para>
传递 <type>callable</type> 以注册处理服务器推送且应具有以下签名:
<methodsynopsis>
<type>int</type><methodname><replaceable>pushfunction</replaceable></methodname>
<methodparam><type>resource</type><parameter>parent_ch</parameter></methodparam>
<methodparam><type>resource</type><parameter>pushed_ch</parameter></methodparam>
<methodparam><type>array</type><parameter>headers</parameter></methodparam>
</methodsynopsis>
<variablelist role="function_parameters">
<varlistentry>
<term><parameter>parent_ch</parameter></term>
<listitem>
<simpara>
父级 cURL 句柄(客户端发出的请求)。
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>pushed_ch</parameter></term>
<listitem>
<simpara>
推送请求的新 cURL 句柄。
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>headers</parameter></term>
<listitem>
<simpara>
推送 promise header。
</simpara>
</listitem>
</varlistentry>
</variablelist>
推送函数如果可以处理推送应该返回 <constant>CURL_PUSH_OK</constant>,或者返回
<constant>CURL_PUSH_DENY</constant> 拒绝。自 PHP 7.1.0 和 cURL 7.44.0 起可用。
</para>
</listitem>
</varlistentry>
</variablelist>
23 changes: 10 additions & 13 deletions reference/curl/functions/curl-multi-setopt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
<entry valign="top"><constant>CURLMOPT_PIPELINING</constant></entry>
<entry valign="top">
传递 1 启用或传递 0 禁用。在多句柄上启用管道将使其尝试对使用此句柄的传输尽可能执行 HTTP
管道操作。这意味着如果添加的第二个请求可以使用已有连接,则第二个请求将在同一连接上使用“管道”。
cURL 7.43.0 开始,该值是位掩码,如果可能,您还可以传递 2 以尝试在已有的 HTTP/2 连接上复用多路新传输。传递
3 指示 cURL 请求彼此独立的管道和多路复用。
从 cURL 7.62.0 开始,设置管道位没有效果。除了整数文字,还可以使用 CURLPIPE_* 常量(如果可用)。
管道操作。这意味着如果添加的第二个请求可以使用已有连接,则第二个请求将在同一连接上使用“管道”。
cURL 7.43.0 ,该值是位掩码,如果可能,传递 2 将尝试在现有的 HTTP/2 连接上多路复用新传输。传递
3 指示 cURL 请求彼此独立的管道和多路复用。自 cURL 7.62.0 起,设置管道 bit 没有效果。除了整数文字,还可以使用
CURLPIPE_* 常量(如果可用)。
</entry>
</row>
<row>
Expand All @@ -71,24 +71,21 @@
<row>
<entry valign="top"><constant>CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE</constant></entry>
<entry valign="top">
传递数字,以字节为单位指定管道的块(chunk)长度阈值
传递数字,用于指定用于管道处理的块长度阈值(以字节为单位)
</entry>
</row>
<row>
<entry valign="top"><constant>CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE</constant></entry>
<entry valign="top">
Pass a number that specifies the size threshold for pipelining
penalty in bytes.
传递数字,指定用于管道惩罚(pipelining penalty)的长度阈值(以字节为单位)。
</entry>
</row>
<row>
<entry valign="top"><constant>CURLMOPT_MAX_CONCURRENT_STREAMS</constant></entry>
<entry valign="top">
The set number will be used as the maximum number of concurrent streams for a connections that cURL
should support on connections done using HTTP/2. Valid values range from
<literal>1</literal> to <literal>2147483647</literal> (<literal>2^31 - 1</literal>).
The value passed here would be honored based on other system resources properties.
Default is <literal>100</literal>.
设置的数字将用作 cURL 在使用 HTTP/2 连接中应支持的最大并发流数量。有效值范围是从 <literal>1</literal> 到
<literal>2147483647</literal>(<literal>2^31 - 1</literal>)。这里设置的值将根据其他系统资源属性来确定是否执行。默认值是
<literal>100</literal>。
</entry>
</row>
<row>
Expand Down Expand Up @@ -141,7 +138,7 @@
<term><parameter>headers</parameter></term>
<listitem>
<para>
The push promise headers.
推送 promise header。
</para>
</listitem>
</varlistentry>
Expand Down

0 comments on commit 33dc84f

Please sign in to comment.