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

Function send_sideband

sideband.c:439–462  ·  view source on GitHub ↗

* fd is connected to the remote side; send the sideband data * over multiplexed packet stream. */

Source from the content-addressed store, hash-verified

437 * over multiplexed packet stream.
438 */
439void send_sideband(int fd, int band, const char *data, ssize_t sz, int packet_max)
440{
441 const char *p = data;
442
443 while (sz) {
444 unsigned n;
445 char hdr[5];
446
447 n = sz;
448 if (packet_max - 5 < n)
449 n = packet_max - 5;
450 if (0 <= band) {
451 xsnprintf(hdr, sizeof(hdr), "%04x", n + 5);
452 hdr[4] = band;
453 write_or_die(fd, hdr, 5);
454 } else {
455 xsnprintf(hdr, sizeof(hdr), "%04x", n + 4);
456 write_or_die(fd, hdr, 4);
457 }
458 write_or_die(fd, p, n);
459 p += n;
460 sz -= n;
461 }
462}

Callers 11

send_requestFunction · 0.85
send_client_dataFunction · 0.85
pack_objectsFunction · 0.85
send_packFunction · 0.85
send_split_sidebandFunction · 0.85
error_clntFunction · 0.85
process_inputFunction · 0.85
report_messageFunction · 0.85
copy_to_sidebandFunction · 0.85
reportFunction · 0.85
report_v2Function · 0.85

Calls 2

xsnprintfFunction · 0.85
write_or_dieFunction · 0.85

Tested by 1

send_split_sidebandFunction · 0.68