CURLMOPT_PIPELINING.3 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  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
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  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. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLMOPT_PIPELINING 3 "17 Jun 2014" libcurl libcurl
  26. .SH NAME
  27. CURLMOPT_PIPELINING \- enable HTTP pipelining and multiplexing
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_PIPELINING, long bitmask);
  32. .fi
  33. .SH DESCRIPTION
  34. Pass in the \fBbitmask\fP parameter to instruct libcurl to enable HTTP
  35. pipelining and/or HTTP/2 multiplexing for this multi handle.
  36. When enabled, libcurl will attempt to use those protocol features when doing
  37. parallel requests to the same hosts.
  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. For multiplexing, this means that follow-up requests can re-use an existing
  42. connection and send the new request multiplexed over that at the same time as
  43. other transfers are already using that single connection.
  44. There are several other related options that are interesting to tweak and
  45. adjust to alter how libcurl spreads out requests on different connections or
  46. not etc.
  47. Before 7.43.0, this option was set to 1 and 0 to enable and disable HTTP/1.1
  48. pipelining.
  49. Starting in 7.43.0, \fBbitmask\fP's second bit also has a meaning, and you can
  50. ask for pipelining and multiplexing independently of each other by toggling
  51. the correct bits.
  52. .IP CURLPIPE_NOTHING (0)
  53. Default, which means doing no attempts at pipelining or multiplexing.
  54. .IP CURLPIPE_HTTP1 (1)
  55. If this bit is set, libcurl will try to pipeline HTTP/1.1 requests on
  56. connections that are already established and in use to hosts.
  57. This bit is deprecated and has no effect since version 7.62.0.
  58. .IP CURLPIPE_MULTIPLEX (2)
  59. If this bit is set, libcurl will try to multiplex the new transfer over an
  60. existing connection if possible. This requires HTTP/2.
  61. .SH DEFAULT
  62. Since 7.62.0, \fBCURLPIPE_MULTIPLEX\fP is enabled by default.
  63. Before that, default was \fBCURLPIPE_NOTHING\fP.
  64. .SH PROTOCOLS
  65. HTTP(S)
  66. .SH EXAMPLE
  67. .nf
  68. CURLM *m = curl_multi_init();
  69. /* try HTTP/2 multiplexing */
  70. curl_multi_setopt(m, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
  71. .fi
  72. .SH AVAILABILITY
  73. Added in 7.16.0. Multiplex support bit added in 7.43.0. HTTP/1 Pipelining
  74. support was disabled in 7.62.0.
  75. .SH RETURN VALUE
  76. Returns CURLM_OK if the option is supported, and CURLM_UNKNOWN_OPTION if not.
  77. .SH "SEE ALSO"
  78. .BR CURLMOPT_MAX_PIPELINE_LENGTH "(3), "
  79. .BR CURLMOPT_PIPELINING_SITE_BL "(3), "
  80. .BR CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE "(3), "
  81. .BR CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE "(3), "
  82. .BR CURLMOPT_MAXCONNECTS "(3), "
  83. .BR CURLMOPT_MAX_HOST_CONNECTIONS "(3), "