Artifactspublic-v0

curl

master
ply4 git calls120 ms288 KiB2 cachedprotocol v2
154 lines3.6 KiBRaw

NAME

curl_multi_setopt - set options for a curl multi handle

SYNOPSIS

c
#include <curl/curl.h>

CURLMcode curl_multi_setopt(CURLM *multi, CURLMoption option, parameter);

DESCRIPTION

curl_multi_setopt(3) is used to tell a libcurl multi handle how to behave. By using the appropriate options to curl_multi_setopt(3), you can change libcurl's behavior when using that multi handle. All options are set with the option followed by the parameter. That parameter can be a long, a function pointer, an object pointer or a curl_off_t type, depending on what the specific option expects. Read this manual carefully as bad input values may cause libcurl to behave badly. You can only set one option in each function call.

OPTIONS

CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE

deprecated See CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE(3)

CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE

deprecated See CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE(3)

CURLMOPT_MAXCONNECTS

Size of connection cache. See CURLMOPT_MAXCONNECTS(3)

CURLMOPT_MAX_CONCURRENT_STREAMS

Max concurrent streams for http2. See CURLMOPT_MAX_CONCURRENT_STREAMS(3)

CURLMOPT_MAX_HOST_CONNECTIONS

Max number of connections to a single host. See CURLMOPT_MAX_HOST_CONNECTIONS(3)

CURLMOPT_MAX_PIPELINE_LENGTH

deprecated. See CURLMOPT_MAX_PIPELINE_LENGTH(3)

CURLMOPT_MAX_TOTAL_CONNECTIONS

Max simultaneously open connections. See CURLMOPT_MAX_TOTAL_CONNECTIONS(3)

CURLMOPT_NETWORK_CHANGED

Signal that the network has changed. See CURLMOPT_NETWORK_CHANGED(3)

CURLMOPT_NOTIFYDATA

Custom pointer passed to the notify callback. See CURLMOPT_NOTIFYDATA(3)

CURLMOPT_NOTIFYFUNCTION

Callback that receives notifications. See CURLMOPT_NOTIFYFUNCTION(3)

CURLMOPT_PIPELINING

Enable HTTP multiplexing. See CURLMOPT_PIPELINING(3)

CURLMOPT_PIPELINING_SERVER_BL

deprecated. See CURLMOPT_PIPELINING_SERVER_BL(3)

CURLMOPT_PIPELINING_SITE_BL

deprecated. See CURLMOPT_PIPELINING_SITE_BL(3)

CURLMOPT_PUSHDATA

Pointer to pass to push callback. See CURLMOPT_PUSHDATA(3)

CURLMOPT_PUSHFUNCTION

Callback that approves or denies server pushes. See CURLMOPT_PUSHFUNCTION(3)

CURLMOPT_QUICK_EXIT

Enable a quicker cleanup of the multi handle. See CURLMOPT_QUICK_EXIT(3)

CURLMOPT_RESOLVE_THREADS_MAX

Max threads used for threaded DNS resolver. See CURLMOPT_RESOLVE_THREADS_MAX(3)

CURLMOPT_SOCKETDATA

Custom pointer passed to the socket callback. See CURLMOPT_SOCKETDATA(3)

CURLMOPT_SOCKETFUNCTION

Callback informed about what to wait for. See CURLMOPT_SOCKETFUNCTION(3)

CURLMOPT_TIMERDATA

Custom pointer to pass to timer callback. See CURLMOPT_TIMERDATA(3)

CURLMOPT_TIMERFUNCTION

Callback to receive timeout values. See CURLMOPT_TIMERFUNCTION(3)

%PROTOCOLS%

EXAMPLE

c

#define MAX_PARALLEL 45

int main(void)
{
  CURLM *multi = curl_multi_init();

  /* Limit the amount of simultaneous connections curl should allow: */
  curl_multi_setopt(multi, CURLMOPT_MAXCONNECTS, (long)MAX_PARALLEL);
}

%AVAILABILITY%

RETURN VALUE

This function returns a CURLMcode indicating success or error.

CURLM_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3).

Note that it returns a CURLM_UNKNOWN_OPTION if you try setting an option that this version of libcurl does not know of.

1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.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)
12Protocol:
13 - All
14Added-in: 7.15.4
15---
17# NAME
19curl_multi_setopt - set options for a curl multi handle
21# SYNOPSIS
23~~~c
24#include <curl/curl.h>
26CURLMcode curl_multi_setopt(CURLM *multi, CURLMoption option, parameter);
27~~~
29# DESCRIPTION
31curl_multi_setopt(3) is used to tell a libcurl multi handle how to behave. By
32using the appropriate options to curl_multi_setopt(3), you can change
33libcurl's behavior when using that multi handle. All options are set with the
34*option* followed by the *parameter*. That parameter can be a **long**, a
35**function pointer**, an **object pointer** or a **curl_off_t** type,
36depending on what the specific option expects. Read this manual carefully as
37bad input values may cause libcurl to behave badly. You can only set one
38option in each function call.
40# OPTIONS
42## CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE
44**deprecated** See CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE(3)
46## CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE
48**deprecated** See CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE(3)
50## CURLMOPT_MAXCONNECTS
52Size of connection cache. See CURLMOPT_MAXCONNECTS(3)
54## CURLMOPT_MAX_CONCURRENT_STREAMS
56Max concurrent streams for http2. See CURLMOPT_MAX_CONCURRENT_STREAMS(3)
58## CURLMOPT_MAX_HOST_CONNECTIONS
60Max number of connections to a single host. See
61CURLMOPT_MAX_HOST_CONNECTIONS(3)
63## CURLMOPT_MAX_PIPELINE_LENGTH
65**deprecated**. See CURLMOPT_MAX_PIPELINE_LENGTH(3)
67## CURLMOPT_MAX_TOTAL_CONNECTIONS
69Max simultaneously open connections. See CURLMOPT_MAX_TOTAL_CONNECTIONS(3)
71## CURLMOPT_NETWORK_CHANGED
73Signal that the network has changed. See CURLMOPT_NETWORK_CHANGED(3)
75## CURLMOPT_NOTIFYDATA
77Custom pointer passed to the notify callback. See CURLMOPT_NOTIFYDATA(3)
79## CURLMOPT_NOTIFYFUNCTION
81Callback that receives notifications. See CURLMOPT_NOTIFYFUNCTION(3)
83## CURLMOPT_PIPELINING
85Enable HTTP multiplexing. See CURLMOPT_PIPELINING(3)
87## CURLMOPT_PIPELINING_SERVER_BL
89**deprecated**. See CURLMOPT_PIPELINING_SERVER_BL(3)
91## CURLMOPT_PIPELINING_SITE_BL
93**deprecated**. See CURLMOPT_PIPELINING_SITE_BL(3)
95## CURLMOPT_PUSHDATA
97Pointer to pass to push callback. See CURLMOPT_PUSHDATA(3)
99## CURLMOPT_PUSHFUNCTION
101Callback that approves or denies server pushes. See CURLMOPT_PUSHFUNCTION(3)
103## CURLMOPT_QUICK_EXIT
105Enable a quicker cleanup of the multi handle. See CURLMOPT_QUICK_EXIT(3)
107## CURLMOPT_RESOLVE_THREADS_MAX
109Max threads used for threaded DNS resolver. See CURLMOPT_RESOLVE_THREADS_MAX(3)
111## CURLMOPT_SOCKETDATA
113Custom pointer passed to the socket callback. See CURLMOPT_SOCKETDATA(3)
115## CURLMOPT_SOCKETFUNCTION
117Callback informed about what to wait for. See CURLMOPT_SOCKETFUNCTION(3)
119## CURLMOPT_TIMERDATA
121Custom pointer to pass to timer callback. See CURLMOPT_TIMERDATA(3)
123## CURLMOPT_TIMERFUNCTION
125Callback to receive timeout values. See CURLMOPT_TIMERFUNCTION(3)
127# %PROTOCOLS%
129# EXAMPLE
131~~~c
133#define MAX_PARALLEL 45
135int main(void)
137 CURLM *multi = curl_multi_init();
139 /* Limit the amount of simultaneous connections curl should allow: */
140 curl_multi_setopt(multi, CURLMOPT_MAXCONNECTS, (long)MAX_PARALLEL);
142~~~
144# %AVAILABILITY%
146# RETURN VALUE
148This function returns a CURLMcode indicating success or error.
150CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
151libcurl-errors(3).
153Note that it returns a CURLM_UNKNOWN_OPTION if you try setting an option that
154this version of libcurl does not know of.
Diagnostics4 git calls · 120 ms
CallStatusSizeTime0120 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=115
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2001.5 KiB115 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=1553
git.response.cache=MISS
git.response.duration_ms=115
git.fetch.wants=0bf7438cc89e44bbbbe185d56a911ee80fc60b12
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1553
git.pkt.payload.max=1532
git.sideband.band1.bytes=1531
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e2f619497f3a24
Request
fca4c0d0…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format