summaryrefslogtreecommitdiff
path: root/src/journal-remote/journal-remote-parse.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-11 23:20:08 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-15 22:34:42 -0400
commit92b10cbccdeef3896f45dc340eb7779c78577ede (patch)
tree2d608289582584f30aa27f0b3079457fb2ce326e /src/journal-remote/journal-remote-parse.h
parent874bc134ac6504c45e94174e37af13ff21a6bfe2 (diff)
journal-remote: avoid copying input data
Instead of copying fields into new memory allocations, simply keep pointers into the receive buffer. Data in this buffer is only copied when there is not enough space for new data and a large chunk of the buffer contains old data.
Diffstat (limited to 'src/journal-remote/journal-remote-parse.h')
-rw-r--r--src/journal-remote/journal-remote-parse.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/journal-remote/journal-remote-parse.h b/src/journal-remote/journal-remote-parse.h
index 07d6ddb67..8499f4eb8 100644
--- a/src/journal-remote/journal-remote-parse.h
+++ b/src/journal-remote/journal-remote-parse.h
@@ -38,10 +38,11 @@ typedef struct RemoteSource {
bool passive_fd;
char *buf;
- size_t size;
- size_t scanned;
- size_t filled;
- size_t data_size;
+ size_t size; /* total size of the buffer */
+ size_t offset; /* offset to the beginning of live data in the buffer */
+ size_t scanned; /* number of bytes since the beginning of data without a newline */
+ size_t filled; /* total number of bytes in the buffer */
+ size_t data_size; /* size of the binary data chunk being processed */
struct iovec_wrapper iovw;