MCPcopy Create free account
hub / github.com/git/git / pipe_fixed_length

Function pipe_fixed_length

http-backend.c:458–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458static void pipe_fixed_length(const char *prog_name, int out, size_t req_len)
459{
460 unsigned char buf[8192];
461 size_t remaining_len = req_len;
462
463 while (remaining_len > 0) {
464 size_t chunk_length = remaining_len > sizeof(buf) ? sizeof(buf) : remaining_len;
465 ssize_t n = xread(0, buf, chunk_length);
466 if (n < 0)
467 die_errno("Reading request failed");
468 write_to_child(out, buf, n, prog_name);
469 remaining_len -= n;
470 }
471
472 close(out);
473}
474
475static void run_service(const char **argv, int buffer_input)
476{

Callers 1

run_serviceFunction · 0.85

Calls 3

xreadFunction · 0.85
die_errnoFunction · 0.85
write_to_childFunction · 0.85

Tested by

no test coverage detected