CURLMOPT_PIPELINING.3 3.7 KB

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