CURLMOPT_PIPELINING.md (1837B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLMOPT_PIPELINING 5 Section: 3 6 Source: libcurl 7 See-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 Protocol: 15 - HTTP 16 Added-in: 7.16.0 17 --- 18 19 # NAME 20 21 CURLMOPT_PIPELINING - enable HTTP multiplexing 22 23 # SYNOPSIS 24 25 ~~~c 26 #include <curl/curl.h> 27 28 CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_PIPELINING, long bitmask); 29 ~~~ 30 31 # DESCRIPTION 32 33 Pass in the correct value in the **bitmask** parameter to instruct libcurl to 34 enable multiplexing for this multi handle. 35 36 With multiplexing enabled, libcurl attempts to do multiple transfers over the 37 same connection when doing parallel transfers to the same hosts. 38 39 ## CURLPIPE_NOTHING (0) 40 41 Make no attempts at multiplexing. 42 43 ## CURLPIPE_HTTP1 (1) 44 45 This bit is deprecated and has no effect since version 7.62.0. 46 47 ## CURLPIPE_MULTIPLEX (2) 48 49 If this bit is set, libcurl tries to multiplex the new transfer over an 50 existing 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 61 int 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 71 The multiplex support bit was added in 7.43.0. HTTP/1 Pipelining support was 72 disabled in 7.62.0. 73 74 Since 7.62.0, **CURLPIPE_MULTIPLEX** is enabled by default. 75 76 Before that, default was **CURLPIPE_NOTHING**. 77 78 # %AVAILABILITY% 79 80 # RETURN VALUE 81 82 curl_multi_setopt(3) returns a CURLMcode indicating success or error. 83 84 CURLM_OK (0) means everything was OK, non-zero means an error occurred, see 85 libcurl-errors(3).