aboutsummaryrefslogtreecommitdiff
path: root/docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-28 21:23:34 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-02-28 21:23:34 +0000
commit6a9977cde9914ddf75f6debd9810591e5b8f84ef (patch)
tree1b01132e15db02538dcf10922559df5a286d1cd6 /docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md
parente73cfcb7f7f74bf28d5b22092f1fbe4b2e7bfccf (diff)
parent80c3417987dd57711bf1832cc267599b55d1836e (diff)
downloadcurl-6a9977cde9914ddf75f6debd9810591e5b8f84ef.tar.gz
Merge "Snap for 11510257 from 5a7a71055c2c5ea8e7342422964c47f1e2d03970 to simpleperf-release" into simpleperf-releasesimpleperf-release
Diffstat (limited to 'docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md')
-rw-r--r--docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md69
1 files changed, 69 insertions, 0 deletions
diff --git a/docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md b/docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md
new file mode 100644
index 000000000..9a5457fa5
--- /dev/null
+++ b/docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md
@@ -0,0 +1,69 @@
+---
+c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
+SPDX-License-Identifier: curl
+Title: CURLMOPT_MAXCONNECTS
+Section: 3
+Source: libcurl
+See-also:
+ - CURLMOPT_MAX_HOST_CONNECTIONS (3)
+ - CURLOPT_MAXCONNECTS (3)
+---
+
+# NAME
+
+CURLMOPT_MAXCONNECTS - size of connection cache
+
+# SYNOPSIS
+
+~~~c
+#include <curl/curl.h>
+
+CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_MAXCONNECTS, long max);
+~~~
+
+# DESCRIPTION
+
+Pass a long indicating the **max**. The set number is used as the maximum
+amount of simultaneously open connections that libcurl may keep in its
+connection cache after completed use. By default libcurl enlarges the size for
+each added easy handle to make it fit 4 times the number of added easy
+handles.
+
+By setting this option, you can prevent the cache size from growing beyond the
+limit set by you.
+
+When the cache is full, curl closes the oldest one in the cache to prevent the
+number of open connections from increasing.
+
+This option is for the multi handle's use only, when using the easy interface
+you should instead use the CURLOPT_MAXCONNECTS(3) option.
+
+See CURLMOPT_MAX_TOTAL_CONNECTIONS(3) for limiting the number of active
+connections.
+
+# DEFAULT
+
+See DESCRIPTION
+
+# PROTOCOLS
+
+All
+
+# EXAMPLE
+
+~~~c
+int main(void)
+{
+ CURLM *m = curl_multi_init();
+ /* only keep 10 connections in the cache */
+ curl_multi_setopt(m, CURLMOPT_MAXCONNECTS, 10L);
+}
+~~~
+
+# AVAILABILITY
+
+Added in 7.16.3
+
+# RETURN VALUE
+
+Returns CURLM_OK if the option is supported, and CURLM_UNKNOWN_OPTION if not.