• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2c: Copyright (C) Daniel Stenberg, <daniel.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)
14---
15
16# NAME
17
18CURLMOPT_PIPELINING - enable HTTP pipelining and multiplexing
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_PIPELINING, long bitmask);
26~~~
27
28# DESCRIPTION
29
30Pass in the correct value in the **bitmask** parameter to instruct libcurl
31to enable multiplexing for this multi handle.
32
33With multiplexing enabled, libcurl attempts to do multiple transfers over the
34same connection when doing parallel transfers to the same hosts.
35
36## CURLPIPE_NOTHING (0)
37
38Default, which means doing no attempts at multiplexing.
39
40## CURLPIPE_HTTP1 (1)
41
42This bit is deprecated and has no effect since version 7.62.0.
43
44## CURLPIPE_MULTIPLEX (2)
45
46If this bit is set, libcurl tries to multiplex the new transfer over an
47existing connection if possible. This requires HTTP/2 or HTTP/3.
48
49# DEFAULT
50
51Since 7.62.0, **CURLPIPE_MULTIPLEX** is enabled by default.
52
53Before that, default was **CURLPIPE_NOTHING**.
54
55# PROTOCOLS
56
57HTTP(S)
58
59# EXAMPLE
60
61~~~c
62int main(void)
63{
64  CURLM *m = curl_multi_init();
65  /* try HTTP/2 multiplexing */
66  curl_multi_setopt(m, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
67}
68~~~
69
70# AVAILABILITY
71
72Added in 7.16.0. Multiplex support bit added in 7.43.0. HTTP/1 Pipelining
73support was disabled in 7.62.0.
74
75# RETURN VALUE
76
77Returns CURLM_OK if the option is supported, and CURLM_UNKNOWN_OPTION if not.
78