1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLMOPT_PIPELINING
5Section: 3
6Source: libcurl
7See-also:
8  - CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE (3)
9  - CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE (3)
10  - CURLMOPT_MAXCONNECTS (3)
11  - CURLMOPT_MAX_HOST_CONNECTIONS (3)
12  - CURLMOPT_MAX_PIPELINE_LENGTH (3)
13  - CURLMOPT_PIPELINING_SITE_BL (3)
14Protocol:
15  - HTTP
16Added-in: 7.16.0
17---
18
19# NAME
20
21CURLMOPT_PIPELINING - enable HTTP multiplexing
22
23# SYNOPSIS
24
25~~~c
26#include <curl/curl.h>
27
28CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_PIPELINING, long bitmask);
29~~~
30
31# DESCRIPTION
32
33Pass in the correct value in the **bitmask** parameter to instruct libcurl to
34enable multiplexing for this multi handle.
35
36With multiplexing enabled, libcurl attempts to do multiple transfers over the
37same connection when doing parallel transfers to the same hosts.
38
39## CURLPIPE_NOTHING (0)
40
41Make no attempts at multiplexing.
42
43## CURLPIPE_HTTP1 (1)
44
45This bit is deprecated and has no effect since version 7.62.0.
46
47## CURLPIPE_MULTIPLEX (2)
48
49If this bit is set, libcurl tries to multiplex the new transfer over an
50existing connection if possible. This requires HTTP/2 or HTTP/3.
51
52# DEFAULT
53
54**CURLPIPE_MULTIPLEX**
55
56# %PROTOCOLS%
57
58# EXAMPLE
59
60~~~c
61int main(void)
62{
63  CURLM *m = curl_multi_init();
64  /* try HTTP/2 multiplexing */
65  curl_multi_setopt(m, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
66}
67~~~
68
69# HISTORY
70
71The multiplex support bit was added in 7.43.0. HTTP/1 Pipelining support was
72disabled in 7.62.0.
73
74Since 7.62.0, **CURLPIPE_MULTIPLEX** is enabled by default.
75
76Before that, default was **CURLPIPE_NOTHING**.
77
78# %AVAILABILITY%
79
80# RETURN VALUE
81
82Returns CURLM_OK if the option is supported, and CURLM_UNKNOWN_OPTION if not.
83