curl_multi_setopt.3 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. .\" generated by cd2nroff 0.1 from curl_multi_setopt.md
  2. .TH curl_multi_setopt 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_multi_setopt \- set options for a curl multi handle
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLMcode curl_multi_setopt(CURLM *multi, CURLMoption option, parameter);
  9. .fi
  10. .SH DESCRIPTION
  11. \fIcurl_multi_setopt(3)\fP is used to tell a libcurl multi handle how to behave. By
  12. using the appropriate options to \fIcurl_multi_setopt(3)\fP, you can change
  13. libcurl\(aqs behavior when using that multi handle. All options are set with the
  14. \fIoption\fP followed by the \fIparameter\fP. That parameter can be a \fBlong\fP, a
  15. \fBfunction pointer\fP, an \fBobject pointer\fP or a \fBcurl_off_t\fP type,
  16. depending on what the specific option expects. Read this manual carefully as
  17. bad input values may cause libcurl to behave badly. You can only set one
  18. option in each function call.
  19. .SH OPTIONS
  20. .IP CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE
  21. \fBdeprecated\fP See \fICURLMOPT_CHUNK_LENGTH_PENALTY_SIZE(3)\fP
  22. .IP CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE
  23. \fBdeprecated\fP See \fICURLMOPT_CONTENT_LENGTH_PENALTY_SIZE(3)\fP
  24. .IP CURLMOPT_MAXCONNECTS
  25. Size of connection cache. See \fICURLMOPT_MAXCONNECTS(3)\fP
  26. .IP CURLMOPT_MAX_CONCURRENT_STREAMS
  27. Max concurrent streams for http2. See \fICURLMOPT_MAX_CONCURRENT_STREAMS(3)\fP
  28. .IP CURLMOPT_MAX_HOST_CONNECTIONS
  29. Max number of connections to a single host. See
  30. \fICURLMOPT_MAX_HOST_CONNECTIONS(3)\fP
  31. .IP CURLMOPT_MAX_PIPELINE_LENGTH
  32. \fBdeprecated\fP. See \fICURLMOPT_MAX_PIPELINE_LENGTH(3)\fP
  33. .IP CURLMOPT_MAX_TOTAL_CONNECTIONS
  34. Max simultaneously open connections. See \fICURLMOPT_MAX_TOTAL_CONNECTIONS(3)\fP
  35. .IP CURLMOPT_PIPELINING
  36. Enable HTTP multiplexing. See \fICURLMOPT_PIPELINING(3)\fP
  37. .IP CURLMOPT_PIPELINING_SERVER_BL
  38. \fBdeprecated\fP. See \fICURLMOPT_PIPELINING_SERVER_BL(3)\fP
  39. .IP CURLMOPT_PIPELINING_SITE_BL
  40. \fBdeprecated\fP. See \fICURLMOPT_PIPELINING_SITE_BL(3)\fP
  41. .IP CURLMOPT_PUSHDATA
  42. Pointer to pass to push callback. See \fICURLMOPT_PUSHDATA(3)\fP
  43. .IP CURLMOPT_PUSHFUNCTION
  44. Callback that approves or denies server pushes. See \fICURLMOPT_PUSHFUNCTION(3)\fP
  45. .IP CURLMOPT_SOCKETDATA
  46. Custom pointer passed to the socket callback. See \fICURLMOPT_SOCKETDATA(3)\fP
  47. .IP CURLMOPT_SOCKETFUNCTION
  48. Callback informed about what to wait for. See \fICURLMOPT_SOCKETFUNCTION(3)\fP
  49. .IP CURLMOPT_TIMERDATA
  50. Custom pointer to pass to timer callback. See \fICURLMOPT_TIMERDATA(3)\fP
  51. .IP CURLMOPT_TIMERFUNCTION
  52. Callback to receive timeout values. See \fICURLMOPT_TIMERFUNCTION(3)\fP
  53. .SH PROTOCOLS
  54. This functionality affects all supported protocols
  55. .SH EXAMPLE
  56. .nf
  57. #define MAX_PARALLEL 45
  58. int main(void)
  59. {
  60. CURLM *multi;
  61. /* Limit the amount of simultaneous connections curl should allow: */
  62. curl_multi_setopt(multi, CURLMOPT_MAXCONNECTS, (long)MAX_PARALLEL);
  63. }
  64. .fi
  65. .SH AVAILABILITY
  66. Added in curl 7.15.4
  67. .SH RETURN VALUE
  68. The standard CURLMcode for multi interface error codes. Note that it returns a
  69. CURLM_UNKNOWN_OPTION if you try setting an option that this version of libcurl
  70. does not know of.
  71. .SH SEE ALSO
  72. .BR curl_multi_cleanup (3),
  73. .BR curl_multi_info_read (3),
  74. .BR curl_multi_init (3),
  75. .BR curl_multi_socket (3)