MCPcopy Index your code
hub / github.com/RsyncProject/rsync / write_vstring

Function write_vstring

io.c:2297–2315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2295}
2296
2297void write_vstring(int f, const char *str, int len)
2298{
2299 uchar lenbuf[3], *lb = lenbuf;
2300
2301 if (len > 0x7F) {
2302 if (len > 0x7FFF) {
2303 rprintf(FERROR,
2304 "attempting to send over-long vstring (%d > %d)\n",
2305 len, 0x7FFF);
2306 exit_cleanup(RERR_PROTOCOL);
2307 }
2308 *lb++ = len / 0x100 + 0x80;
2309 }
2310 *lb = len;
2311
2312 write_buf(f, (char*)lenbuf, lb - lenbuf + 1);
2313 if (len)
2314 write_buf(f, str, len);
2315}
2316
2317/* Send a file-list index using a byte-reduction method. */
2318void write_ndx(int f, int32 ndx)

Callers 3

write_ndx_and_attrsFunction · 0.85
itemizeFunction · 0.85
send_negotiate_strFunction · 0.85

Calls 2

write_bufFunction · 0.85
rprintfFunction · 0.70

Tested by

no test coverage detected