blob: 5df8a6eec817e94335d415d40dbfd111d0617de7 [file] [log] [blame]
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -07001.\" **************************************************************************
2.\" * _ _ ____ _
3.\" * Project ___| | | | _ \| |
4.\" * / __| | | | |_) | |
5.\" * | (__| |_| | _ <| |___
6.\" * \___|\___/|_| \_\_____|
7.\" *
Elliott Hughes82be86d2017-09-20 17:00:17 -07008.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -07009.\" *
10.\" * This software is licensed as described in the file COPYING, which
11.\" * you should have received as part of this distribution. The terms
Alex Deymo8f1a2142016-06-28 14:49:26 -070012.\" * are also available at https://curl.haxx.se/docs/copyright.html.
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070013.\" *
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.\"
Elliott Hughes1ef06ba2018-05-30 15:43:58 -070023.TH CURLMOPT_PIPELINING 3 "May 27, 2017" "libcurl 7.60.0" "curl_multi_setopt options"
Elliott Hughes82be86d2017-09-20 17:00:17 -070024
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070025.SH NAME
Elliott Hughescee03382017-06-23 12:17:18 -070026CURLMOPT_PIPELINING \- enable HTTP pipelining and multiplexing
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070027.SH SYNOPSIS
28#include <curl/curl.h>
29
Elliott Hughescee03382017-06-23 12:17:18 -070030CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_PIPELINING, long bitmask);
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070031.SH DESCRIPTION
Elliott Hughescee03382017-06-23 12:17:18 -070032Pass in the \fBbitmask\fP parameter to instruct libcurl to enable HTTP
33pipelining and/or HTTP/2 multiplexing for this multi handle.
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070034
Elliott Hughescee03382017-06-23 12:17:18 -070035When enabled, libcurl will attempt to use those protocol features when doing
36parallel requests to the same hosts.
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070037
Elliott Hughescee03382017-06-23 12:17:18 -070038For pipelining, this means that if you add a second request that can use an
39already existing connection, the second request will be \&"piped" on the same
40connection rather than being executed in parallel.
41
42For multiplexing, this means that follow-up requests can re-use an existing
43connection and send the new request multiplexed over that at the same time as
44other transfers are already using that single connection.
45
46There are several other related options that are interesting to tweak and
47adjust to alter how libcurl spreads out requests on different connections or
48not etc.
49
50Before 7.43.0, this option was set to 1 and 0 to enable and disable HTTP/1.1
51pipelining.
52
53Starting in 7.43.0, \fBbitmask\fP's second bit also has a meaning, and you can
54ask for pipelining and multiplexing independently of each other by toggling
55the correct bits.
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070056.IP CURLPIPE_NOTHING (0)
57Default, which means doing no attempts at pipelining or multiplexing.
58.IP CURLPIPE_HTTP1 (1)
59If this bit is set, libcurl will try to pipeline HTTP/1.1 requests on
60connections that are already established and in use to hosts.
61.IP CURLPIPE_MULTIPLEX (2)
62If this bit is set, libcurl will try to multiplex the new transfer over an
63existing connection if possible. This requires HTTP/2.
64.SH DEFAULT
Elliott Hughescee03382017-06-23 12:17:18 -0700650 (both pipeline and multiplexing are off)
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070066.SH PROTOCOLS
67HTTP(S)
68.SH EXAMPLE
Elliott Hughes82be86d2017-09-20 17:00:17 -070069.nf
70CURLM *m = curl_multi_init();
71/* try HTTP/1 pipelining and HTTP/2 multiplexing */
72curl_multi_setopt(m, CURLMOPT_PIPELINING, CURLPIPE_HTTP1 |
73 CURLPIPE_MULTIPLEX);
74.fi
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070075.SH AVAILABILITY
76Added in 7.16.0. Multiplex support bit added in 7.43.0.
77.SH RETURN VALUE
78Returns 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), "