diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-08-28 03:16:02 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-08-28 03:16:02 +0000 |
commit | dbe0c6f6ef0770ee5a601313ee5205588c4a2b22 (patch) | |
tree | 02484329db1072619c4ddc2fdda2849765d4252e /src/or/buffers.c | |
parent | 54ca0387a59499f516dae689a34807dad6410b3d (diff) | |
download | tor-dbe0c6f6ef0770ee5a601313ee5205588c4a2b22.tar.gz tor-dbe0c6f6ef0770ee5a601313ee5205588c4a2b22.zip |
r8609@Kushana: nickm | 2006-08-27 17:24:27 -0400
Add some doxygen, concentrated in dns.c
svn:r8256
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index 75ba23712f..2fe99f86fc 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -58,11 +58,15 @@ struct buf_t { char *cur; /**< The first byte used for storing data in the buffer. */ size_t highwater; /**< Largest observed datalen since last buf_shrink */ size_t len; /**< Maximum amount of data that <b>mem</b> can hold. */ - size_t memsize; /**< DOCDOC */ + size_t memsize; /**< How many bytes did we actually allocate? Can be less + * than 'len' if we shortened 'len' by a few bytes to make + * zlib wrap around more easily. */ size_t datalen; /**< Number of bytes currently in <b>mem</b>. */ }; +/** How many bytes, total, are used in all buffers? */ uint64_t buf_total_used = 0; +/** How many bytes, total, are allocated in all buffers? */ uint64_t buf_total_alloc = 0; /** Size, in bytes, for newly allocated buffers. Should be a power of 2. */ @@ -1292,7 +1296,10 @@ fetch_from_buf_line(buf_t *buf, char *data_out, size_t *data_len) return 1; } -/** DOCDOC */ +/** Compress on uncompress the <b>data_len</b> bytes in <b>data</b> using the + * zlib state <b>state</b>, appending the result to <b>buf</b>. If + * <b>done</b> is true, flush the data in the state and finish the + * compression/uncompression. Return -1 on failure, 0 on success. */ int write_to_buf_zlib(buf_t *buf, tor_zlib_state_t *state, const char *data, size_t data_len, |