|
4442 | 4442 | </para>
|
4443 | 4443 | </listitem>
|
4444 | 4444 | </varlistentry>
|
| 4445 | + <varlistentry xml:id="constant.curlopt-prereqfunction"> |
| 4446 | + <term> |
| 4447 | + <constant>CURLOPT_PREREQFUNCTION</constant> |
| 4448 | + (<type>int</type>) |
| 4449 | + </term> |
| 4450 | + <listitem> |
| 4451 | + <para> |
| 4452 | + A <type>callable</type> with the following signature that gets called after the |
| 4453 | + connection is established, but before the request payload (for example, the |
| 4454 | + GET/POST/DELETE request of an HTTP connection) is sent, and can be used to abort |
| 4455 | + or allow the connection depending on the source and destination IP address and |
| 4456 | + port numbers: |
| 4457 | + <methodsynopsis> |
| 4458 | + <type>int</type><methodname><replaceable>callback</replaceable></methodname> |
| 4459 | + <methodparam><type>CurlHandle</type><parameter>curlHandle</parameter></methodparam> |
| 4460 | + <methodparam><type>string</type><parameter>destination_ip</parameter></methodparam> |
| 4461 | + <methodparam><type>string</type><parameter>local_ip</parameter></methodparam> |
| 4462 | + <methodparam><type>int</type><parameter>destination_port</parameter></methodparam> |
| 4463 | + <methodparam><type>int</type><parameter>local_port</parameter></methodparam> |
| 4464 | + </methodsynopsis> |
| 4465 | + <variablelist role="function_parameters"> |
| 4466 | + <varlistentry> |
| 4467 | + <term><parameter>curlHandle</parameter></term> |
| 4468 | + <listitem> |
| 4469 | + <simpara> |
| 4470 | + The cURL handle. |
| 4471 | + </simpara> |
| 4472 | + </listitem> |
| 4473 | + </varlistentry> |
| 4474 | + <varlistentry> |
| 4475 | + <term><parameter>destination_ip</parameter></term> |
| 4476 | + <listitem> |
| 4477 | + <simpara> |
| 4478 | + The primary IP of the remote server established with this connection. |
| 4479 | + For <acronym>FTP</acronym>, this is the IP for the control connection. |
| 4480 | + IPv6 addresses are represented without surrounding brackets. |
| 4481 | + </simpara> |
| 4482 | + </listitem> |
| 4483 | + </varlistentry> |
| 4484 | + <varlistentry> |
| 4485 | + <term><parameter>local_ip</parameter></term> |
| 4486 | + <listitem> |
| 4487 | + <simpara> |
| 4488 | + The originating IP for this connection. |
| 4489 | + IPv6 addresses are represented without surrounding brackets. |
| 4490 | + </simpara> |
| 4491 | + </listitem> |
| 4492 | + </varlistentry> |
| 4493 | + <varlistentry> |
| 4494 | + <term><parameter>destination_port</parameter></term> |
| 4495 | + <listitem> |
| 4496 | + <simpara> |
| 4497 | + The primary port number on the remote server established with this connection. |
| 4498 | + For <acronym>FTP</acronym>, this is the port for the control connection. |
| 4499 | + This can be a <acronym>TCP</acronym> or a <acronym>UDP</acronym> port number depending on the protocol. |
| 4500 | + </simpara> |
| 4501 | + </listitem> |
| 4502 | + </varlistentry> |
| 4503 | + <varlistentry> |
| 4504 | + <term><parameter>local_port</parameter></term> |
| 4505 | + <listitem> |
| 4506 | + <simpara> |
| 4507 | + The originating port number for this connection. |
| 4508 | + This can be a <acronym>TCP</acronym> or a <acronym>UDP</acronym> port number depending on the protocol. |
| 4509 | + </simpara> |
| 4510 | + </listitem> |
| 4511 | + </varlistentry> |
| 4512 | + </variablelist> |
| 4513 | + Return <constant>CURL_PREREQFUNC_OK</constant> to allow the request, or |
| 4514 | + <constant>CURL_PREREQFUNC_ABORT</constant> to abort the transfer. |
| 4515 | + Available as of PHP 8.4.0 and cURL 7.80.0. |
| 4516 | + </para> |
| 4517 | + </listitem> |
| 4518 | + </varlistentry> |
4445 | 4519 | </variablelist>
|
0 commit comments