Artifactspublic-v0

curl

master
ply4 git calls29 ms289 KiB3 cachedprotocol v2
154 lines5.8 KiBRaw
1#ifndef HEADER_CURL_TRANSFER_H
2#define HEADER_CURL_TRANSFER_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#define Curl_headersep(x) ((((x) == ':') || ((x) == ';')))
28char *Curl_checkheaders(const struct Curl_easy *data,
29 const char *thisheader,
30 const size_t thislen);
32void Curl_init_CONNECT(struct Curl_easy *data);
34CURLcode Curl_pretransfer(struct Curl_easy *data);
36CURLcode Curl_sendrecv(struct Curl_easy *data);
37CURLcode Curl_retry_request(struct Curl_easy *data, char **url);
38bool Curl_meets_timecondition(struct Curl_easy *data, time_t timeofdoc);
40/**
41 * Write the transfer raw response bytes, as received from the connection.
42 * Handle all passed bytes or return an error. By default, this writes
43 * the bytes as BODY to the client. Protocols may provide a
44 * "write_resp" callback in their handler to add specific treatment. E.g.
45 * HTTP parses response headers and passes them differently to the client.
46 * @param data the transfer
47 * @param buf the raw response bytes
48 * @param blen the amount of bytes in `buf`
49 * @param is_eos TRUE iff the connection indicates this to be the last
50 * bytes of the response
51 */
52CURLcode Curl_xfer_write_resp(struct Curl_easy *data,
53 const char *buf, size_t blen,
54 bool is_eos);
56bool Curl_xfer_write_is_paused(struct Curl_easy *data);
58/**
59 * Write a single "header" line from a server response.
60 * @param hd0 the null-terminated, single header line
61 * @param hdlen the length of the header line
62 * @param is_eos TRUE iff this is the end of the response
63 */
64CURLcode Curl_xfer_write_resp_hd(struct Curl_easy *data,
65 const char *hd0, size_t hdlen, bool is_eos);
67/* The transfer is neither receiving nor sending. */
68void Curl_xfer_setup_nop(struct Curl_easy *data);
70/* The transfer sends data on the given socket index */
71void Curl_xfer_setup_send(struct Curl_easy *data,
72 int8_t sockindex);
74/* The transfer receives data on the given socket index, the
75 * amount to receive (or -1 if unknown). */
76void Curl_xfer_setup_recv(struct Curl_easy *data,
77 int8_t sockindex,
78 curl_off_t recv_size);
80/* *After* Curl_xfer_setup_xxx(), tell the transfer to shutdown the
81 * connection at the end. Let the transfer either fail or ignore any
82 * errors during shutdown. */
83void Curl_xfer_set_shutdown(struct Curl_easy *data,
84 bool shutdown,
85 bool ignore_errors);
87/**
88 * The transfer will use socket 1 to send/recv. `recv_size` is
89 * the amount to receive or -1 if unknown.
90 */
91void Curl_xfer_setup_sendrecv(struct Curl_easy *data,
92 int8_t sockindex,
93 curl_off_t recv_size);
95/**
96 * Multi has set transfer to DONE. Last chance to trigger
97 * missing response things like writing an EOS to the client.
98 */
99CURLcode Curl_xfer_write_done(struct Curl_easy *data, bool premature);
101/**
102 * Return TRUE iff transfer has pending data to send. Checks involved
103 * connection filters.
104 */
105bool Curl_xfer_needs_flush(struct Curl_easy *data);
107/**
108 * Flush any pending send data on the transfer connection.
109 */
110CURLcode Curl_xfer_flush(struct Curl_easy *data);
112/**
113 * Send data on the socket/connection filter designated
114 * for transfer's outgoing data.
115 * Return CURLE_OK on blocking with (*pnwritten == 0).
116 */
117CURLcode Curl_xfer_send(struct Curl_easy *data,
118 const void *buf, size_t blen, bool eos,
119 size_t *pnwritten);
121/**
122 * Receive data on the socket/connection filter designated
123 * for transfer's incoming data.
124 * Return CURLE_AGAIN on blocking with (*pnrcvd == 0).
125 */
126CURLcode Curl_xfer_recv(struct Curl_easy *data,
127 char *buf, size_t blen,
128 size_t *pnrcvd);
130CURLcode Curl_xfer_send_close(struct Curl_easy *data);
131CURLcode Curl_xfer_send_shutdown(struct Curl_easy *data, bool *done);
133/* Return TRUE if the transfer is not done, but further progress
134 * is blocked. For example when it is only receiving and its writer
135 * is PAUSED. */
136bool Curl_xfer_is_blocked(struct Curl_easy *data);
138/* Query if send/recv for transfer is paused. */
139bool Curl_xfer_send_is_paused(struct Curl_easy *data);
140bool Curl_xfer_recv_is_paused(struct Curl_easy *data);
142/* Enable/Disable pausing of send/recv for the transfer. */
143CURLcode Curl_xfer_pause_send(struct Curl_easy *data, bool enable);
144CURLcode Curl_xfer_pause_recv(struct Curl_easy *data, bool enable);
146/* TRUE if the transfer is secure, e.g. uses TLS and does not
147 * use a forward proxy. */
148bool Curl_xfer_is_secure(struct Curl_easy *data);
150/* Internal variant of the API function */
151CURLcode Curl_easy_recv(struct Curl_easy *data,
152 void *buffer, size_t buflen, size_t *n);
154#endif /* HEADER_CURL_TRANSFER_H */
Diagnostics4 git calls · 29 ms
CallStatusSizeTime029 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 · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=3
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
fetch2002.0 KiB · hit23 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=23
git.response.bytes=2059
git.response.cache=HIT
git.response.duration_ms=23
git.fetch.wants=0ad0d549edd8bd558a487def0ee51d1d8c395a95
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=2059
git.pkt.payload.max=2038
git.sideband.band1.bytes=2037
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
a5e247a24a25ee28
Request
135a2baf…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format