master
1/***************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
7 *
8 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9 *
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at https://curl.se/docs/copyright.html.
13 *
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 * SPDX-License-Identifier: curl
22 *
23 ***************************************************************************/
24#include "curl_setup.h"
25#include "urldata.h"
26#include "file.h"
28#ifndef CURL_DISABLE_FILE
30#ifdef HAVE_NETINET_IN_H
31#include <netinet/in.h>
32#endif
33#ifdef HAVE_NETDB_H
34#include <netdb.h>
35#endif
36#ifdef HAVE_ARPA_INET_H
37#include <arpa/inet.h>
38#endif
39#ifdef HAVE_NET_IF_H
40#include <net/if.h>
41#endif
42#ifdef HAVE_SYS_IOCTL_H
43#include <sys/ioctl.h>
44#endif
46#ifdef HAVE_SYS_PARAM_H
47#include <sys/param.h>
48#endif
50#ifdef HAVE_DIRENT_H
51#include <dirent.h>
52#endif
54#include "progress.h"
55#include "sendf.h"
56#include "curl_trc.h"
57#include "escape.h"
58#include "multiif.h"
59#include "transfer.h"
60#include "url.h"
61#include "parsedate.h" /* for the week day and month names */
62#include "curlx/win32-fopen.h"
63#include "curl_range.h"
65#if defined(_WIN32) || defined(MSDOS)
66#define DOS_FILESYSTEM 1
67#elif defined(__amigaos4__)
68#define AMIGA_FILESYSTEM 1
69#endif
71/* meta key for storing protocol meta at easy handle */
72#define CURL_META_FILE_EASY "meta:proto:file:easy"
74struct FILEPROTO {
75 char *path; /* the path we operate on */
76 char *freepath; /* pointer to the allocated block we must free, this might
77 differ from the 'path' pointer */
78 int fd; /* open file descriptor to read from! */
79 bool is_dir;
80};
82static void file_cleanup(struct FILEPROTO *file)
83{
84 curlx_safefree(file->freepath);
85 file->path = NULL;
86 file->is_dir = FALSE;
87 if(file->fd != -1) {
88 curlx_close(file->fd);
89 file->fd = -1;
90 }
91}
93static void file_easy_dtor(const void *key, size_t klen, void *entry)
94{
95 struct FILEPROTO *file = entry;
96 (void)key;
97 (void)klen;
98 file_cleanup(file);
99 curlx_free(file);
100}
102static CURLcode file_setup_connection(struct Curl_easy *data,
103 struct connectdata *conn)
104{
105 struct FILEPROTO *filep;
106 (void)conn;
107 /* allocate the FILE specific struct */
108 filep = curlx_calloc(1, sizeof(*filep));
109 if(filep)
110 filep->fd = -1;
111 if(!filep ||
112 Curl_meta_set(data, CURL_META_FILE_EASY, filep, file_easy_dtor))
113 return CURLE_OUT_OF_MEMORY;
115 return CURLE_OK;
116}
118static CURLcode file_done(struct Curl_easy *data,
119 CURLcode status, bool premature)
120{
121 struct FILEPROTO *file = Curl_meta_get(data, CURL_META_FILE_EASY);
122 (void)status;
123 (void)premature;
125 if(file)
126 file_cleanup(file);
128 return CURLE_OK;
129}
131static int file_stat(const char *path, curlx_struct_stat *statbuf)
132{
133#ifdef _WIN32
134 int result = curlx_stat(path, statbuf);
136 if(result) {
137 size_t pathlen = strlen(path);
139 /* MSVCRT's narrow stat() rejects trailing directory separators. */
140 if((pathlen > 3) &&
141 ((path[pathlen - 1] == '\\') || (path[pathlen - 1] == '/'))) {
142 char *trimmed = curlx_strdup(path);
144 if(trimmed) {
145 do {
146 trimmed[--pathlen] = '\0';
147 } while((pathlen > 3) &&
148 ((trimmed[pathlen - 1] == '\\') ||
149 (trimmed[pathlen - 1] == '/')));
151 result = curlx_stat(trimmed, statbuf);
152 curlx_free(trimmed);
153 }
154 }
155 }
157 return result;
158#else
159 return curlx_stat(path, statbuf);
160#endif
161}
163/*
164 * file_connect() gets called from Curl_protocol_connect() to allow us to
165 * do protocol-specific actions at connect-time. We emulate a
166 * connect-then-transfer protocol and "connect" to the file here
167 */
168static CURLcode file_connect(struct Curl_easy *data, bool *done)
169{
170 char *real_path;
171 struct FILEPROTO *file = Curl_meta_get(data, CURL_META_FILE_EASY);
172#ifdef _WIN32
173 curlx_struct_stat statbuf;
174#endif
175 int fd;
176#ifdef DOS_FILESYSTEM
177 size_t i;
178 char *actual_path;
179#endif
180 size_t real_path_len;
181 CURLcode result;
183 if(!file)
184 return CURLE_FAILED_INIT;
186 if(file->path) {
187 /* already connected.
188 * the handler->connect_it() is normally only called once, but
189 * FILE does a special check on setting up the connection which
190 * calls this explicitly. */
191 *done = TRUE;
192 return CURLE_OK;
193 }
195 result = Curl_urldecode(data->state.up.path, 0, &real_path,
196 &real_path_len, REJECT_ZERO);
197 if(result)
198 return result;
200#ifdef DOS_FILESYSTEM
201 /* If the first character is a slash, and there is
202 something that looks like a drive at the beginning of
203 the path, skip the slash. If we remove the initial
204 slash in all cases, paths without drive letters end up
205 relative to the current directory which is not how
206 browsers work.
208 Some browsers accept | instead of : as the drive letter
209 separator, so we do too.
211 On other platforms, we need the slash to indicate an
212 absolute pathname. On Windows, absolute paths start
213 with a drive letter. */
214 actual_path = real_path;
215 if((actual_path[0] == '/') &&
216 actual_path[1] &&
217 (actual_path[2] == ':' || actual_path[2] == '|')) {
218 actual_path[2] = ':';
219 actual_path++;
220 real_path_len--;
221 }
223 /* change path separators from '/' to '\\' for DOS, Windows and OS/2 */
224 for(i = 0; i < real_path_len; ++i)
225 if(actual_path[i] == '/')
226 actual_path[i] = '\\';
227 else if(!actual_path[i]) { /* binary zero */
228 curlx_safefree(real_path);
229 return CURLE_URL_MALFORMAT;
230 }
232 fd = curlx_open(actual_path, O_RDONLY | CURL_O_BINARY);
233 file->path = actual_path;
234#else
235 if(memchr(real_path, 0, real_path_len)) {
236 /* binary zeroes indicate foul play */
237 curlx_safefree(real_path);
238 return CURLE_URL_MALFORMAT;
239 }
241#ifdef AMIGA_FILESYSTEM
242 /*
243 * A leading slash in an AmigaDOS path denotes the parent
244 * directory, and hence we block this as it is relative.
245 * Absolute paths start with 'volumename:', so we check for
246 * this first. Failing that, we treat the path as a real Unix
247 * path, but only if the application was compiled with -lunix.
248 */
249 fd = -1;
250 file->path = real_path;
252 if(real_path[0] == '/') {
253 extern int __unix_path_semantics;
254 if(strchr(real_path + 1, ':')) {
255 /* Amiga absolute path */
256 fd = curlx_open(real_path + 1, O_RDONLY);
257 file->path++;
258 }
259 else if(__unix_path_semantics) {
260 /* -lunix fallback */
261 fd = curlx_open(real_path, O_RDONLY);
262 }
263 }
264#else
265 fd = curlx_open(real_path, O_RDONLY);
266 file->path = real_path;
267#endif
268#endif
269 curlx_free(file->freepath);
270 file->freepath = real_path; /* free this when done */
272 file->fd = fd;
273#ifdef _WIN32
274 if(!data->state.upload && (fd == -1) &&
275 !file_stat(file->path, &statbuf) && S_ISDIR(statbuf.st_mode))
276 file->is_dir = TRUE;
277#endif
279 if(!data->state.upload && (fd == -1) && !file->is_dir) {
280 failf(data, "Could not open file %s", data->state.up.path);
281 file_done(data, CURLE_FILE_COULDNT_READ_FILE, FALSE);
282 return CURLE_FILE_COULDNT_READ_FILE;
283 }
284 *done = TRUE;
286 return CURLE_OK;
287}
289static CURLcode file_disconnect(struct Curl_easy *data,
290 struct connectdata *conn,
291 bool dead_connection)
292{
293 (void)dead_connection;
294 (void)conn;
295 return file_done(data, CURLE_OK, FALSE);
296}
298#ifdef DOS_FILESYSTEM
299#define DIRSEP '\\'
300#else
301#define DIRSEP '/'
302#endif
304static CURLcode file_upload(struct Curl_easy *data,
305 struct FILEPROTO *file)
306{
307 const char *dir = strchr(file->path, DIRSEP);
308 int fd;
309 int mode;
310 CURLcode result = CURLE_OK;
311 char *xfer_ulbuf;
312 size_t xfer_ulblen;
313 curlx_struct_stat file_stat;
314 const char *sendbuf;
315 bool eos = FALSE;
317 /*
318 * Since FILE: does not do the full init, we need to provide some extra
319 * assignments here.
320 */
322 if(!dir)
323 return CURLE_FILE_COULDNT_READ_FILE; /* fix: better error code */
325 if(!dir[1])
326 return CURLE_FILE_COULDNT_READ_FILE; /* fix: better error code */
328 mode = O_WRONLY | O_CREAT | CURL_O_BINARY;
329 if(data->state.resume_from)
330 mode |= O_APPEND;
331 else
332 mode |= O_TRUNC;
334 fd = curlx_open(file->path, mode,
335#ifdef _WIN32
336 data->set.new_file_perms & (_S_IREAD | _S_IWRITE)
337#else
338 (mode_t)data->set.new_file_perms
339#endif
340 );
341 if(fd < 0) {
342 failf(data, "cannot open %s for writing", file->path);
343 return CURLE_WRITE_ERROR;
344 }
346 if(data->state.infilesize != -1)
347 /* known size of data to "upload" */
348 Curl_pgrsSetUploadSize(data, data->state.infilesize);
350 /* treat the negative resume offset value as the case of "-" */
351 if(data->state.resume_from < 0) {
352 if(curlx_fstat(fd, &file_stat)) {
353 curlx_close(fd);
354 failf(data, "cannot get the size of %s", file->path);
355 return CURLE_WRITE_ERROR;
356 }
357 data->state.resume_from = (curl_off_t)file_stat.st_size;
358 }
360 result = Curl_multi_xfer_ulbuf_borrow(data, &xfer_ulbuf, &xfer_ulblen);
361 if(result)
362 goto out;
364 while(!result && !eos) {
365 size_t nread, nwritten;
366 ssize_t rv;
367 size_t readcount;
369 result = Curl_client_read(data, xfer_ulbuf, xfer_ulblen, &readcount, &eos);
370 if(result)
371 break;
373 if(!readcount)
374 break;
376 nread = readcount;
378 /* skip bytes before resume point */
379 if(data->state.resume_from) {
380 if((curl_off_t)nread <= data->state.resume_from) {
381 data->state.resume_from -= nread;
382 nread = 0;
383 sendbuf = xfer_ulbuf;
384 }
385 else {
386 sendbuf = xfer_ulbuf + data->state.resume_from;
387 nread -= (size_t)data->state.resume_from;
388 data->state.resume_from = 0;
389 }
390 }
391 else
392 sendbuf = xfer_ulbuf;
394 /* write the data to the target */
395 rv = write(fd, sendbuf, nread);
396 if(!curlx_sztouz(rv, &nwritten) || (nwritten != nread)) {
397 result = CURLE_SEND_ERROR;
398 break;
399 }
400 Curl_pgrs_upload_inc(data, nwritten);
402 result = Curl_pgrsCheck(data);
403 }
404 if(!result)
405 result = Curl_pgrsUpdate(data);
407out:
408 curlx_close(fd);
409 Curl_multi_xfer_ulbuf_release(data, xfer_ulbuf);
411 return result;
412}
414#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
415static CURLcode win32_file_list(struct Curl_easy *data, const char *path)
416{
417 WIN32_FIND_DATA entry;
418 HANDLE handle;
419 char *pattern;
420 size_t pathlen = strlen(path);
421 CURLcode result = CURLE_OK;
422 DWORD error;
424 pattern = curl_maprintf("%s%s*", path,
425 pathlen &&
426 (path[pathlen - 1] == '\\' ||
427 path[pathlen - 1] == '/') ? "" : "\\");
428 if(!pattern)
429 return CURLE_OUT_OF_MEMORY;
431 handle = curlx_FindFirstFile(pattern, &entry);
432 curlx_free(pattern);
433 if(handle == INVALID_HANDLE_VALUE)
434 return CURLE_READ_ERROR;
436 do {
437 if(entry.cFileName[0] != TEXT('.')) {
438 char *name = curlx_convert_tchar_to_UTF8(entry.cFileName);
440 if(!name) {
441 result = CURLE_OUT_OF_MEMORY;
442 break;
443 }
445 result = Curl_client_write(data, CLIENTWRITE_BODY,
446 name, strlen(name));
447 curlx_free(name);
448 if(result)
449 break;
451 result = Curl_client_write(data, CLIENTWRITE_BODY, "\n", 1);
452 if(result)
453 break;
454 }
455 } while(FindNextFile(handle, &entry));
457 error = GetLastError();
458 if(!result && error != ERROR_NO_MORE_FILES)
459 result = CURLE_READ_ERROR;
461 FindClose(handle);
462 return result;
463}
464#endif
466/*
467 * file_do() is the protocol-specific function for the do-phase, separated
468 * from the connect-phase above. Other protocols merely setup the transfer in
469 * the do-phase, to have it done in the main transfer loop but since some
470 * platforms we support do not allow select()ing etc on file handles (as
471 * opposed to sockets) we instead perform the whole do-operation in this
472 * function.
473 */
474static CURLcode file_do(struct Curl_easy *data, bool *done)
475{
476 /* This implementation ignores the hostname in conformance with
477 RFC 1738. Only local files (reachable via the standard file system)
478 are supported. This means that files on remotely mounted directories
479 (via NFS, Samba, NT sharing) can be accessed through a file:// URL */
480 struct FILEPROTO *file = Curl_meta_get(data, CURL_META_FILE_EASY);
481 CURLcode result = CURLE_OK;
482 curlx_struct_stat statbuf;
483 curl_off_t expected_size = -1;
484 bool size_known;
485 bool fstated = FALSE;
486 int fd;
487 char *xfer_buf;
488 size_t xfer_blen;
490 *done = TRUE; /* unconditionally */
491 if(!file)
492 return CURLE_FAILED_INIT;
494 if(data->state.upload)
495 return file_upload(data, file);
497 /* get the fd from the connection phase */
498 fd = file->fd;
500 /* VMS: This only works reliable for STREAMLF files */
501 if((file->is_dir ? file_stat(file->path, &statbuf) :
502 curlx_fstat(fd, &statbuf)) != -1) {
503 file->is_dir = (fd == -1) || S_ISDIR(statbuf.st_mode);
504 if(!file->is_dir)
505 expected_size = statbuf.st_size;
506 /* and store the modification time */
507 data->info.filetime = statbuf.st_mtime;
508 fstated = TRUE;
509 }
511 if(fstated && !data->state.range && data->set.timecondition &&
512 !Curl_meets_timecondition(data, data->info.filetime))
513 return CURLE_OK;
515 if(fstated) {
516 time_t filetime;
517 struct tm buffer;
518 const struct tm *tm = &buffer;
519 char header[80];
520 int headerlen;
521 static const char accept_ranges[] = { "Accept-ranges: bytes\r\n" };
522 if(expected_size >= 0) {
523 headerlen =
524 curl_msnprintf(header, sizeof(header),
525 "Content-Length: %" FMT_OFF_T "\r\n", expected_size);
526 result = Curl_client_write(data, CLIENTWRITE_HEADER, header, headerlen);
527 if(result)
528 return result;
530 result = Curl_client_write(data, CLIENTWRITE_HEADER,
531 accept_ranges, CURL_CSTRLEN(accept_ranges));
532 if(result != CURLE_OK)
533 return result;
534 }
536 filetime = (time_t)statbuf.st_mtime;
537 result = curlx_gmtime(filetime, &buffer);
538 if(result)
539 return result;
541 /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
542 headerlen =
543 curl_msnprintf(header, sizeof(header),
544 "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
545 Curl_wkday[tm->tm_wday ? tm->tm_wday - 1 : 6],
546 tm->tm_mday,
547 Curl_month[tm->tm_mon],
548 tm->tm_year + 1900,
549 tm->tm_hour,
550 tm->tm_min,
551 tm->tm_sec);
552 result = Curl_client_write(data, CLIENTWRITE_HEADER, header, headerlen);
553 if(!result)
554 /* end of headers */
555 result = Curl_client_write(data, CLIENTWRITE_HEADER, "\r\n", 2);
556 if(result)
557 return result;
558 /* set the file size to make it available post transfer */
559 Curl_pgrsSetDownloadSize(data, expected_size);
560 if(data->req.no_body)
561 return CURLE_OK;
562 }
564 /* Check whether file range has been specified */
565 result = Curl_range(data);
566 if(result)
567 return result;
569 /* Adjust the start offset in case we want to get the N last bytes
570 * of the stream if the filesize could be determined */
571 if(data->state.resume_from < 0) {
572 if(!fstated) {
573 failf(data, "cannot get the size of file.");
574 return CURLE_READ_ERROR;
575 }
576 if((curl_off_t)statbuf.st_size < -data->state.resume_from) {
577 failf(data, "Offset (%" FMT_OFF_T ") was beyond file size (%"
578 FMT_OFF_T ")", data->state.resume_from,
579 (curl_off_t)statbuf.st_size);
580 return CURLE_BAD_DOWNLOAD_RESUME;
581 }
582 data->state.resume_from += (curl_off_t)statbuf.st_size;
583 }
585 if(data->state.resume_from > 0) {
586 /* We check explicitly if we have a start offset, because
587 * expected_size may be -1 if we do not know how large the file is,
588 * in which case we should not adjust it. */
589 if(data->state.resume_from <= expected_size)
590 expected_size -= data->state.resume_from;
591 else {
592 failf(data, "failed to resume file:// transfer");
593 return CURLE_BAD_DOWNLOAD_RESUME;
594 }
595 }
597 /* A high water mark has been specified so we obey... */
598 if(data->req.maxdownload > 0)
599 expected_size = data->req.maxdownload;
601 if(!fstated || (expected_size <= 0))
602 size_known = FALSE;
603 else
604 size_known = TRUE;
606 /* The following is a shortcut implementation of file reading
607 this is both more efficient than the former call to download() and
608 it avoids problems with select() and recv() on file descriptors
609 in Winsock */
610 if(size_known)
611 Curl_pgrsSetDownloadSize(data, expected_size);
613 if(data->state.resume_from) {
614 if(!file->is_dir) {
615 if(data->state.resume_from !=
616 curl_lseek(fd, data->state.resume_from, SEEK_SET))
617 return CURLE_BAD_DOWNLOAD_RESUME;
618 }
619 else {
620 return CURLE_BAD_DOWNLOAD_RESUME;
621 }
622 }
624 result = Curl_multi_xfer_buf_borrow(data, &xfer_buf, &xfer_blen);
625 if(result)
626 goto out;
628 if(!file->is_dir) {
629 while(!result) {
630 ssize_t nread;
631 /* Do not fill a whole buffer if we want less than all data */
632 size_t bytestoread;
634 if(size_known) {
635 bytestoread = (expected_size < (curl_off_t)(xfer_blen - 1)) ?
636 curlx_sotouz(expected_size) : (xfer_blen - 1);
637 }
638 else
639 bytestoread = xfer_blen - 1;
641 nread = read(fd, xfer_buf, bytestoread);
643 if(nread > 0)
644 xfer_buf[nread] = 0;
646 if(nread <= 0 || (size_known && (expected_size == 0)))
647 break;
649 if(size_known)
650 expected_size -= nread;
652 result = Curl_client_write(data, CLIENTWRITE_BODY, xfer_buf, nread);
653 if(result)
654 goto out;
656 result = Curl_pgrsCheck(data);
657 if(result)
658 goto out;
659 }
660 }
661 else {
662#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
663 result = win32_file_list(data, file->path);
664 if(result)
665 goto out;
666#elif defined(HAVE_OPENDIR)
667 DIR *dir = opendir(file->path);
668 struct dirent *entry;
670 if(!dir) {
671 result = CURLE_READ_ERROR;
672 goto out;
673 }
674 else {
675 while((entry = readdir(dir))) {
676 if(entry->d_name[0] != '.') {
677 result = Curl_client_write(data, CLIENTWRITE_BODY,
678 entry->d_name, strlen(entry->d_name));
679 if(result)
680 break;
681 result = Curl_client_write(data, CLIENTWRITE_BODY, "\n", 1);
682 if(result)
683 break;
684 }
685 }
686 closedir(dir);
687 }
688#else
689 failf(data, "Directory listing not yet implemented on this platform.");
690 result = CURLE_READ_ERROR;
691#endif
692 }
694 if(!result)
695 result = Curl_pgrsUpdate(data);
697out:
698 Curl_multi_xfer_buf_release(data, xfer_buf);
699 return result;
700}
702const struct Curl_protocol Curl_protocol_file = {
703 file_setup_connection, /* setup_connection */
704 ZERO_NULL, /* setup_filters */
705 file_do, /* do_it */
706 file_done, /* done */
707 ZERO_NULL, /* do_more */
708 file_connect, /* connect_it */
709 ZERO_NULL, /* connecting */
710 ZERO_NULL, /* doing */
711 ZERO_NULL, /* proto_pollset */
712 ZERO_NULL, /* doing_pollset */
713 ZERO_NULL, /* domore_pollset */
714 ZERO_NULL, /* perform_pollset */
715 file_disconnect, /* disconnect */
716 ZERO_NULL, /* write_resp */
717 ZERO_NULL, /* write_resp_hd */
718 ZERO_NULL, /* connection_is_dead */
719 ZERO_NULL, /* attach connection */
720 ZERO_NULL, /* follow */
721};
723#endif
Diagnostics4 git calls · 35 ms
CallStatusSizeTime035 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 B2 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=149 git.response.cache=UPDATING git.response.duration_ms=2 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=30 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=86Open pack map
fetch2006.8 KiB · hit30 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=6967 git.response.cache=HIT git.response.duration_ms=30 git.fetch.wants=ba574e9ac28e04fd767fa57fa105590437d7865c 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=6967 git.pkt.payload.max=6946 git.sideband.band1.bytes=6945 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
- a5e2788b7915d806
- Request
- 459b75a6…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format