summaryrefslogtreecommitdiff
path: root/rsync/buf.c
Side-by-side diff
Diffstat (limited to 'rsync/buf.c') (more/less context) (ignore whitespace changes)
-rw-r--r--rsync/buf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/rsync/buf.c b/rsync/buf.c
index 2814583..c978fff 100644
--- a/rsync/buf.c
+++ b/rsync/buf.c
@@ -83,32 +83,33 @@ void rs_filebuf_free(rs_filebuf_t *fb)
{
if ( fb->buf )
free ( fb->buf );
rs_bzero(fb, sizeof *fb);
free(fb);
}
/*
* If the stream has no more data available, read some from F into
* BUF, and let the stream use that. On return, SEEN_EOF is true if
* the end of file has passed into the stream.
*/
rs_result rs_infilebuf_fill(rs_job_t *job, rs_buffers_t *buf,
void *opaque)
{
+ job=job;
int len;
rs_filebuf_t *fb = (rs_filebuf_t *) opaque;
FILE *f = fb->f;
/* This is only allowed if either the buf has no input buffer
* yet, or that buffer could possibly be BUF. */
if (buf->next_in != NULL) {
assert(buf->avail_in <= fb->buf_len);
assert(buf->next_in >= fb->buf);
assert(buf->next_in <= fb->buf + fb->buf_len);
} else {
assert(buf->avail_in == 0);
}
if (buf->eof_in || (buf->eof_in = feof(f))) {
rs_trace("seen end of file on input");
@@ -134,32 +135,33 @@ rs_result rs_infilebuf_fill(rs_job_t *job, rs_buffers_t *buf,
}
}
buf->avail_in = len;
buf->next_in = fb->buf;
return RS_DONE;
}
/*
* The buf is already using BUF for an output buffer, and probably
* contains some buffered output now. Write this out to F, and reset
* the buffer cursor.
*/
rs_result rs_outfilebuf_drain(rs_job_t *job, rs_buffers_t *buf, void *opaque)
{
+ job=job;
int present;
rs_filebuf_t *fb = (rs_filebuf_t *) opaque;
FILE *f = fb->f;
/* This is only allowed if either the buf has no output buffer
* yet, or that buffer could possibly be BUF. */
if (buf->next_out == NULL) {
assert(buf->avail_out == 0);
buf->next_out = fb->buf;
buf->avail_out = fb->buf_len;
return RS_DONE;
}
assert(buf->avail_out <= fb->buf_len);