librsync
2.3.4
|
A somewhat elastic but fairly small buffer for data passing through a stream. More...
Go to the source code of this file.
Functions | |
static void | rs_tube_catchup_write (rs_job_t *job) |
static void | rs_tube_catchup_copy (rs_job_t *job) |
Catch up on an outstanding copy command. More... | |
rs_result | rs_tube_catchup (rs_job_t *job) |
Put whatever will fit from the tube into the output of the stream. More... | |
int | rs_tube_is_idle (rs_job_t const *job) |
void | rs_tube_copy (rs_job_t *job, size_t len) |
Queue up a request to copy through len bytes from the input to the output of the stream. More... | |
void | rs_tube_write (rs_job_t *job, const void *buf, size_t len) |
Push some data into the tube for storage. More... | |
A somewhat elastic but fairly small buffer for data passing through a stream.
In most cases the iter can adjust to send just as much data will fit. In some cases that would be too complicated, because it has to transmit an integer or something similar. So in that case we stick whatever won't fit into a small buffer.
A tube can contain some literal data to go out (typically command bytes), and also an instruction to copy data from the stream's input or from some other location. Both literal data and a copy command can be queued at the same time, but only in that order and at most one of each.
Definition in file tube.c.
|
static |
void rs_tube_copy | ( | rs_job_t * | job, |
size_t | len | ||
) |
Queue up a request to copy through len
bytes from the input to the output of the stream.
The data is copied from the scoop (if there is anything there) or from the input, on the next call to rs_tube_write().
We can only accept this request if there is no copy command already pending.
void rs_tube_write | ( | rs_job_t * | job, |
const void * | buf, | ||
size_t | len | ||
) |