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

Function write_packetized_from_buf_no_flush_count

pkt-line.c:317–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317int write_packetized_from_buf_no_flush_count(const char *src_in, size_t len,
318 int fd_out, int *packet_counter)
319{
320 int err = 0;
321 size_t bytes_written = 0;
322 size_t bytes_to_write;
323
324 while (!err) {
325 if ((len - bytes_written) > LARGE_PACKET_DATA_MAX)
326 bytes_to_write = LARGE_PACKET_DATA_MAX;
327 else
328 bytes_to_write = len - bytes_written;
329 if (bytes_to_write == 0)
330 break;
331 err = packet_write_gently(fd_out, src_in + bytes_written, bytes_to_write);
332 bytes_written += bytes_to_write;
333 if (packet_counter)
334 (*packet_counter)++;
335 }
336 return err;
337}
338
339static int get_packet_data(int fd, char **src_buf, size_t *src_size,
340 void *dst, size_t size, int options)

Callers 2

command_loopFunction · 0.85

Calls 1

packet_write_gentlyFunction · 0.85

Tested by 1

command_loopFunction · 0.68