<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.curl-multi-setopt" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>curl_multi_setopt</refname>
  <refpurpose>Set a cURL multi option</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>bool</type><methodname>curl_multi_setopt</methodname>
   <methodparam><type>CurlMultiHandle</type><parameter>multi_handle</parameter></methodparam>
   <methodparam><type>int</type><parameter>option</parameter></methodparam>
   <methodparam><type>mixed</type><parameter>value</parameter></methodparam>
  </methodsynopsis>
  <para>
   Sets an option on the given cURL multi handle.
  </para>

 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   &curl.mh.description;
   <varlistentry>
    <term><parameter>option</parameter></term>
    <listitem>
     <para>
      One of the <constant>CURLMOPT_*</constant> constants.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>value</parameter></term>
    <listitem>
      <para>
       The value to be set on <parameter>option</parameter>.
      </para>
      <para>
       <parameter>value</parameter> should be an <type>int</type> for the
       following values of the <parameter>option</parameter> parameter:
       <informaltable>
        <tgroup cols="3">
         <thead>
          <row>
           <entry valign="top">Option</entry>
           <entry valign="top">Set <parameter>value</parameter> to</entry>
          </row>
         </thead>
         <tbody>
          <row>
           <entry valign="top"><constant>CURLMOPT_PIPELINING</constant></entry>
           <entry valign="top">
            Pass 1 to enable or 0 to disable. Enabling pipelining on a multi
            handle will make it attempt to perform HTTP Pipelining as far as
            possible for transfers using this handle. This means that if you add
            a second request that can use an already existing connection, the
            second request will be "piped" on the same connection.
            As of cURL 7.43.0, the value is a bitmask, and you can also pass 2 to try to multiplex the new
            transfer over an existing HTTP/2 connection if possible.
            Passing 3 instructs cURL to ask for pipelining and multiplexing
            independently of each other.
            As of cURL 7.62.0, setting the pipelining bit has no effect.
            Instead of integer literals, you can also use the CURLPIPE_*
            constants if available.
           </entry>
          </row>
          <row>
           <entry valign="top"><constant>CURLMOPT_MAXCONNECTS</constant></entry>
           <entry valign="top">
            Pass a number that will be used as the maximum amount of
            simultaneously open connections that libcurl may cache.
            By default the size will be enlarged to fit four times the number
            of handles added via <function>curl_multi_add_handle</function>.
            When the cache is full, curl closes the oldest one in the cache
            to prevent the number of open connections from increasing.
           </entry>
          </row>
          <row>
           <entry valign="top"><constant>CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE</constant></entry>
           <entry valign="top">
            Pass a number that specifies the chunk length threshold for pipelining
            in bytes.
           </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.
           </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>.
           </entry>
          </row>
          <row>
           <entry valign="top"><constant>CURLMOPT_MAX_HOST_CONNECTIONS</constant></entry>
           <entry valign="top">
            Pass a number that specifies the maximum number of connections to a
            single host.
           </entry>
          </row>
          <row>
           <entry valign="top"><constant>CURLMOPT_MAX_PIPELINE_LENGTH</constant></entry>
           <entry valign="top">
            Pass a number that specifies the maximum number of requests in a
            pipeline.
           </entry>
          </row>
          <row>
           <entry valign="top"><constant>CURLMOPT_MAX_TOTAL_CONNECTIONS</constant></entry>
           <entry valign="top">
            Pass a number that specifies the maximum number of simultaneously
            open connections.
           </entry>
          </row>
          <row>
           <entry valign="top"><constant>CURLMOPT_PUSHFUNCTION</constant></entry>
           <entry valign="top">
            Pass a <type>callable</type> that will be registered to handle server
            pushes and should have the following signature:
            <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>
             <varlistentry>
              <term><parameter>parent_ch</parameter></term>
              <listitem>
               <para>
                The parent cURL handle (the request the client made).
               </para>
              </listitem>
             </varlistentry>
             <varlistentry>
              <term><parameter>pushed_ch</parameter></term>
              <listitem>
               <para>
                A new cURL handle for the pushed request.
               </para>
              </listitem>
             </varlistentry>
             <varlistentry>
              <term><parameter>headers</parameter></term>
              <listitem>
               <para>
                The push promise headers.
               </para>
              </listitem>
             </varlistentry>
            </variablelist>
            The push function is supposed to return either
            <constant>CURL_PUSH_OK</constant> if it can handle the push, or
            <constant>CURL_PUSH_DENY</constant> to reject it.
           </entry>
          </row>
         </tbody>
        </tgroup>
       </informaltable>
      </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &return.success;
  </para>
 </refsect1>

 <refsect1 role="changelog">
  &reftitle.changelog;
  <para>
   <informaltable>
    <tgroup cols="2">
     <thead>
      <row>
       <entry>&Version;</entry>
       <entry>&Description;</entry>
      </row>
     </thead>
     <tbody>
      <row>
       <entry>8.2.0</entry>
       <entry>
        Introduced <constant>CURLMOPT_MAX_CONCURRENT_STREAMS</constant>.
       </entry>
      </row>
      &curl.changelog.multi-handle-param;
      <row>
       <entry>7.1.0</entry>
       <entry>
        Introduced <constant>CURLMOPT_PUSHFUNCTION</constant>.
       </entry>
      </row>
      <row>
       <entry>7.0.7</entry>
       <entry>
        Introduced <constant>CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE</constant>,
        <constant>CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE</constant>,
        <constant>CURLMOPT_MAX_HOST_CONNECTIONS</constant>,
        <constant>CURLMOPT_MAX_PIPELINE_LENGTH</constant> and
        <constant>CURLMOPT_MAX_TOTAL_CONNECTIONS</constant>.
       </entry>
      </row>
     </tbody>
    </tgroup>
   </informaltable>
  </para>
 </refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
