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

Function read_buf

io.c:1948–1989  ·  view source on GitHub ↗

Debugging note: this will be named read_buf_() when using an external zlib. */

Source from the content-addressed store, hash-verified

1946
1947/* Debugging note: this will be named read_buf_() when using an external zlib. */
1948void read_buf(int f, char *buf, size_t len)
1949{
1950 if (f != iobuf.in_fd) {
1951 if (safe_read(f, buf, len) != len)
1952 whine_about_eof(False); /* Doesn't return. */
1953 goto batch_copy;
1954 }
1955
1956 if (!IN_MULTIPLEXED) {
1957 raw_read_buf(buf, len);
1958 total_data_read += len;
1959 if (forward_flist_data)
1960 write_buf(iobuf.out_fd, buf, len);
1961 batch_copy:
1962 if (f == write_batch_monitor_in)
1963 safe_write(batch_fd, buf, len);
1964 return;
1965 }
1966
1967 while (1) {
1968 size_t siz;
1969
1970 while (!iobuf.raw_input_ends_before)
1971 read_a_msg();
1972
1973 siz = MIN(len, iobuf.raw_input_ends_before - iobuf.in.pos);
1974 if (siz >= iobuf.in.size)
1975 siz = iobuf.in.size;
1976 raw_read_buf(buf, siz);
1977 total_data_read += siz;
1978
1979 if (forward_flist_data)
1980 write_buf(iobuf.out_fd, buf, siz);
1981
1982 if (f == write_batch_monitor_in)
1983 safe_write(batch_fd, buf, siz);
1984
1985 if ((len -= siz) == 0)
1986 break;
1987 buf += siz;
1988 }
1989}
1990
1991void read_sbuf(int f, char *buf, size_t len)
1992{

Callers 15

receive_sumsFunction · 0.70
simple_recv_tokenFunction · 0.70
recv_deflated_tokenFunction · 0.70
recv_zstd_tokenFunction · 0.70
recv_compressed_tokenFunction · 0.70
noop_io_until_deathFunction · 0.70
read_shortintFunction · 0.70
read_intFunction · 0.70
read_uintFunction · 0.70
read_varintFunction · 0.70
read_varlongFunction · 0.70
read_longintFunction · 0.70

Calls 6

whine_about_eofFunction · 0.85
raw_read_bufFunction · 0.85
write_bufFunction · 0.85
safe_writeFunction · 0.85
read_a_msgFunction · 0.85
safe_readFunction · 0.70

Tested by

no test coverage detected