• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: curl_multi_setopt
5Section: 3
6Source: libcurl
7See-also:
8  - curl_multi_cleanup (3)
9  - curl_multi_info_read (3)
10  - curl_multi_init (3)
11  - curl_multi_socket (3)
12---
13
14# NAME
15
16curl_multi_setopt - set options for a curl multi handle
17
18# SYNOPSIS
19
20~~~c
21#include <curl/curl.h>
22
23CURLMcode curl_multi_setopt(CURLM *multi_handle, CURLMoption option, parameter);
24~~~
25
26# DESCRIPTION
27
28curl_multi_setopt(3) is used to tell a libcurl multi handle how to
29behave. By using the appropriate options to curl_multi_setopt(3), you
30can change libcurl's behavior when using that multi handle. All options are
31set with the *option* followed by the *parameter*. That parameter can
32be a **long**, a **function pointer**, an **object pointer** or a
33**curl_off_t** type, depending on what the specific option expects. Read
34this manual carefully as bad input values may cause libcurl to behave
35badly. You can only set one option in each function call.
36
37# OPTIONS
38
39## CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE
40
41See CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE(3)
42
43## CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE
44
45See CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE(3)
46
47## CURLMOPT_MAX_HOST_CONNECTIONS
48
49See CURLMOPT_MAX_HOST_CONNECTIONS(3)
50
51## CURLMOPT_MAX_PIPELINE_LENGTH
52
53See CURLMOPT_MAX_PIPELINE_LENGTH(3)
54
55## CURLMOPT_MAX_TOTAL_CONNECTIONS
56
57See CURLMOPT_MAX_TOTAL_CONNECTIONS(3)
58
59## CURLMOPT_MAXCONNECTS
60
61See CURLMOPT_MAXCONNECTS(3)
62
63## CURLMOPT_PIPELINING
64
65See CURLMOPT_PIPELINING(3)
66
67## CURLMOPT_PIPELINING_SITE_BL
68
69See CURLMOPT_PIPELINING_SITE_BL(3)
70
71## CURLMOPT_PIPELINING_SERVER_BL
72
73See CURLMOPT_PIPELINING_SERVER_BL(3)
74
75## CURLMOPT_PUSHFUNCTION
76
77See CURLMOPT_PUSHFUNCTION(3)
78
79## CURLMOPT_PUSHDATA
80
81See CURLMOPT_PUSHDATA(3)
82
83## CURLMOPT_SOCKETFUNCTION
84
85See CURLMOPT_SOCKETFUNCTION(3)
86
87## CURLMOPT_SOCKETDATA
88
89See CURLMOPT_SOCKETDATA(3)
90
91## CURLMOPT_TIMERFUNCTION
92
93See CURLMOPT_TIMERFUNCTION(3)
94
95## CURLMOPT_TIMERDATA
96
97See CURLMOPT_TIMERDATA(3)
98
99## CURLMOPT_MAX_CONCURRENT_STREAMS
100
101See CURLMOPT_MAX_CONCURRENT_STREAMS(3)
102
103# EXAMPLE
104
105~~~c
106
107#define MAX_PARALLEL 45
108
109int main(void)
110{
111  CURLM *multi;
112  /* Limit the amount of simultaneous connections curl should allow: */
113  curl_multi_setopt(multi, CURLMOPT_MAXCONNECTS, (long)MAX_PARALLEL);
114}
115~~~
116
117# AVAILABILITY
118
119Added in 7.15.4
120
121# RETURN VALUE
122
123The standard CURLMcode for multi interface error codes. Note that it returns a
124CURLM_UNKNOWN_OPTION if you try setting an option that this version of libcurl
125does not know of.
126