CURLMOPT_PIPELINING.3 3.6 KB

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