Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1 | .\" ************************************************************************** |
| 2 | .\" * _ _ ____ _ |
| 3 | .\" * Project ___| | | | _ \| | |
| 4 | .\" * / __| | | | |_) | | |
| 5 | .\" * | (__| |_| | _ <| |___ |
| 6 | .\" * \___|\___/|_| \_\_____| |
| 7 | .\" * |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 8 | .\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 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 |
Alex Deymo | 8f1a214 | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 12 | .\" * are also available at https://curl.haxx.se/docs/copyright.html. |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 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 | .\" |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 23 | .TH CURLMOPT_PIPELINING 3 "May 27, 2017" "libcurl 7.60.0" "curl_multi_setopt options" |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 24 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 25 | .SH NAME |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 26 | CURLMOPT_PIPELINING \- enable HTTP pipelining and multiplexing |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 27 | .SH SYNOPSIS |
| 28 | #include <curl/curl.h> |
| 29 | |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 30 | CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_PIPELINING, long bitmask); |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 31 | .SH DESCRIPTION |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 32 | Pass in the \fBbitmask\fP parameter to instruct libcurl to enable HTTP |
| 33 | pipelining and/or HTTP/2 multiplexing for this multi handle. |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 34 | |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 35 | When enabled, libcurl will attempt to use those protocol features when doing |
| 36 | parallel requests to the same hosts. |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 37 | |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 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. |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 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 |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 65 | 0 (both pipeline and multiplexing are off) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 66 | .SH PROTOCOLS |
| 67 | HTTP(S) |
| 68 | .SH EXAMPLE |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 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 |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 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), " |