Imported Upstream version 7.59.0
[platform/upstream/curl.git] / docs / libcurl / opts / CURLMOPT_PIPELINING.3
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 CURLMOPT_PIPELINING 3 "May 27, 2017" "libcurl 7.59.0" "curl_multi_setopt options"
24
25 .SH NAME
26 CURLMOPT_PIPELINING \- enable HTTP pipelining and multiplexing
27 .SH SYNOPSIS
28 #include <curl/curl.h>
29
30 CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_PIPELINING, long bitmask);
31 .SH DESCRIPTION
32 Pass in the \fBbitmask\fP parameter to instruct libcurl to enable HTTP
33 pipelining and/or HTTP/2 multiplexing for this multi handle.
34
35 When enabled, libcurl will attempt to use those protocol features when doing
36 parallel requests to the same hosts.
37
38 For pipelining, this means that if you add a second request that can use an
39 already existing connection, the second request will be \&"piped" on the same
40 connection rather than being executed in parallel.
41
42 For multiplexing, this means that follow-up requests can re-use an existing
43 connection and send the new request multiplexed over that at the same time as
44 other transfers are already using that single connection.
45
46 There are several other related options that are interesting to tweak and
47 adjust to alter how libcurl spreads out requests on different connections or
48 not etc.
49
50 Before 7.43.0, this option was set to 1 and 0 to enable and disable HTTP/1.1
51 pipelining.
52
53 Starting in 7.43.0, \fBbitmask\fP's second bit also has a meaning, and you can
54 ask for pipelining and multiplexing independently of each other by toggling
55 the correct bits.
56 .IP CURLPIPE_NOTHING (0)
57 Default, which means doing no attempts at pipelining or multiplexing.
58 .IP CURLPIPE_HTTP1 (1)
59 If this bit is set, libcurl will try to pipeline HTTP/1.1 requests on
60 connections that are already established and in use to hosts.
61 .IP CURLPIPE_MULTIPLEX (2)
62 If this bit is set, libcurl will try to multiplex the new transfer over an
63 existing connection if possible. This requires HTTP/2.
64 .SH DEFAULT
65 0 (both pipeline and multiplexing are off)
66 .SH PROTOCOLS
67 HTTP(S)
68 .SH EXAMPLE
69 .nf
70 CURLM *m = curl_multi_init();
71 /* try HTTP/1 pipelining and HTTP/2 multiplexing */
72 curl_multi_setopt(m, CURLMOPT_PIPELINING, CURLPIPE_HTTP1 |
73                                           CURLPIPE_MULTIPLEX);
74 .fi
75 .SH AVAILABILITY
76 Added in 7.16.0. Multiplex support bit added in 7.43.0.
77 .SH RETURN VALUE
78 Returns CURLM_OK if the option is supported, and CURLM_UNKNOWN_OPTION if not.
79 .SH "SEE ALSO"
80 .BR CURLMOPT_MAX_PIPELINE_LENGTH "(3), "
81 .BR CURLMOPT_PIPELINING_SITE_BL "(3), "
82 .BR CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE "(3), "
83 .BR CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE "(3), "
84 .BR CURLMOPT_MAX_HOST_CONNECTIONS "(3), "
85 .BR CURLMOPT_MAXCONNECTS "(3), "
86 .BR CURLMOPT_MAX_HOST_CONNECTIONS "(3), "