master
1#ifndef HEADER_CURL_MULTIIF_H
2#define HEADER_CURL_MULTIIF_H
3/***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
10 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11 *
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at https://curl.se/docs/copyright.html.
15 *
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 * SPDX-License-Identifier: curl
24 *
25 ***************************************************************************/
26/*
27 * Prototypes for library-wide functions provided by multi.c
28 */
30void Curl_expire(struct Curl_easy *data, timediff_t milli, expire_id eid);
31void Curl_expire_set(struct Curl_easy *data,
32 expire_id eid, timediff_t ms,
33 const struct curltime *pnow);
34void Curl_expire_clear(struct Curl_easy *data, expire_id eid);
35void Curl_expire_clear_all(struct Curl_easy *data);
36CURLMcode Curl_update_timer(struct Curl_multi *multi) WARN_UNUSED_RESULT;
37void Curl_attach_connection(struct Curl_easy *data,
38 struct connectdata *conn,
39 bool matched);
40void Curl_detach_connection(struct Curl_easy *data);
41bool Curl_multiplex_wanted(const struct Curl_multi *multi);
42CURLcode Curl_preconnect(struct Curl_easy *data);
43bool Curl_is_connecting(struct Curl_easy *data);
45void Curl_multi_connchanged(struct Curl_multi *multi);
47CURLMcode Curl_multi_add_handle(struct Curl_multi *multi,
48 struct Curl_easy *data);
49CURLMcode Curl_multi_remove_handle(struct Curl_multi *multi,
50 struct Curl_easy *data);
52/* Internal version of curl_multi_init() accepts size parameters for the
53 socket, connection and dns hashes */
54struct Curl_multi *Curl_multi_handle(uint32_t xfer_table_size,
55 size_t ev_hashsize,
56 size_t chashsize,
57 size_t dnssize,
58 size_t sesssize);
60/**
61 * Let the multi handle know that the socket is about to be closed.
62 * The multi will then remove anything it knows about the socket, so
63 * when the OS is using this socket (number) again subsequently,
64 * the internal book keeping will not get confused.
65 */
66void Curl_multi_will_close(struct Curl_easy *data, curl_socket_t s);
68/*
69 * Add a handle and move it into PERFORM state at once. For pushed streams.
70 */
71CURLMcode Curl_multi_add_perform(struct Curl_multi *multi,
72 struct Curl_easy *data,
73 struct connectdata *conn);
75/* Return the value of the CURLMOPT_MAX_CONCURRENT_STREAMS option */
76uint32_t Curl_multi_max_concurrent_streams(struct Curl_multi *multi);
78CURLMcode Curl_multi_pollset(struct Curl_easy *data,
79 struct easy_pollset *ps);
81/**
82 * Borrow the transfer buffer from the multi, suitable
83 * for the given transfer `data`. The buffer may only be used in one
84 * multi processing of the easy handle. It MUST be returned to the
85 * multi before it can be borrowed again.
86 * Pointers into the buffer remain only valid as long as it is borrowed.
87 *
88 * @param data the easy handle
89 * @param pbuf on return, the buffer to use or NULL on error
90 * @param pbuflen on return, the size of *pbuf or 0 on error
91 * @return CURLE_OK when buffer is available and is returned.
92 * CURLE_OUT_OF_MEMORY on failure to allocate the buffer,
93 * CURLE_FAILED_INIT if the easy handle is without multi.
94 * CURLE_AGAIN if the buffer is borrowed already.
95 */
96CURLcode Curl_multi_xfer_buf_borrow(struct Curl_easy *data,
97 char **pbuf, size_t *pbuflen);
98/**
99 * Release the borrowed buffer. All references into the buffer become
100 * invalid after this.
101 * @param buf the buffer pointer borrowed for coding error checks.
102 */
103void Curl_multi_xfer_buf_release(struct Curl_easy *data, char *buf);
105/**
106 * Borrow the upload buffer from the multi, suitable
107 * for the given transfer `data`. The buffer may only be used in one
108 * multi processing of the easy handle. It MUST be returned to the
109 * multi before it can be borrowed again.
110 * Pointers into the buffer remain only valid as long as it is borrowed.
111 *
112 * @param data the easy handle
113 * @param pbuf on return, the buffer to use or NULL on error
114 * @param pbuflen on return, the size of *pbuf or 0 on error
115 * @return CURLE_OK when buffer is available and is returned.
116 * CURLE_OUT_OF_MEMORY on failure to allocate the buffer,
117 * CURLE_FAILED_INIT if the easy handle is without multi.
118 * CURLE_AGAIN if the buffer is borrowed already.
119 */
120CURLcode Curl_multi_xfer_ulbuf_borrow(struct Curl_easy *data,
121 char **pbuf, size_t *pbuflen);
123/**
124 * Release the borrowed upload buffer. All references into the buffer become
125 * invalid after this.
126 * @param buf the upload buffer pointer borrowed for coding error checks.
127 */
128void Curl_multi_xfer_ulbuf_release(struct Curl_easy *data, char *buf);
130/**
131 * Borrow the socket scratch buffer from the multi, suitable
132 * for the given transfer `data`. The buffer may only be used for
133 * direct socket I/O operation by one connection at a time and MUST be
134 * returned to the multi before the I/O call returns.
135 * Pointers into the buffer remain only valid as long as it is borrowed.
136 *
137 * @param data the easy handle
138 * @param blen requested length of the buffer
139 * @param pbuf on return, the buffer to use or NULL on error
140 * @return CURLE_OK when buffer is available and is returned.
141 * CURLE_OUT_OF_MEMORY on failure to allocate the buffer,
142 * CURLE_AGAIN if the buffer is borrowed already.
143 */
144CURLcode Curl_multi_xfer_sockbuf_borrow(struct Curl_easy *data,
145 size_t blen, char **pbuf);
146/**
147 * Release the borrowed buffer. All references into the buffer become
148 * invalid after this.
149 * @param buf the buffer pointer borrowed for coding error checks.
150 */
151void Curl_multi_xfer_sockbuf_release(struct Curl_easy *data, char *buf);
153/**
154 * Get the easy handle for the given mid.
155 * Returns NULL if not found or not a GOOD_EASY_HANDLE()
156 */
157struct Curl_easy *Curl_multi_get_easy(struct Curl_multi *multi,
158 uint32_t mid);
160/* TRUE if multi knows about data via its `mid` */
161bool Curl_multi_knows_easy(struct Curl_multi *multi, struct Curl_easy *data);
163/* Get the # of transfers attached to the multi, without the internal
164 * admin handle. */
165uint32_t Curl_multi_xfers_attached(struct Curl_multi *multi);
167/* Mark a transfer as dirty, e.g. to be rerun at earliest convenience.
168 * A cheap operation, can be done many times repeatedly. */
169void Curl_multi_mark_dirty(struct Curl_easy *data);
170/* Clear transfer from the dirty set. */
171void Curl_multi_clear_dirty(struct Curl_easy *data);
173void Curl_multi_set_now(struct Curl_multi *multi);
175#ifdef ENABLE_INTERNAL_WAKEUP
176void Curl_multi_wakeup_internal(struct Curl_multi *multi);
177#endif
179#endif /* HEADER_CURL_MULTIIF_H */
Diagnostics4 git calls · 34 ms
CallStatusSizeTime034 ms
discover200152 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 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 · hit4 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=4 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=4 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=86Open pack map
fetch2002.2 KiB · hit27 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=27 git.response.bytes=2250 git.response.cache=HIT git.response.duration_ms=27 git.fetch.wants=30b453e7589a14a9208736a378ba0285c3402d41 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=2250 git.pkt.payload.max=2229 git.sideband.band1.bytes=2228 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
- a5e2a338bd951293
- Request
- 8726ee2c…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format