Macros | Functions
compress_buf.c File Reference

Working with compressed data in buffers. More...

#include "lib/cc/compat_compiler.h"
#include "lib/buf/buffers.h"
#include "lib/compress/compress.h"
#include "lib/log/util_bug.h"

Go to the source code of this file.


#define check()   STMT_NIL


int buf_add_compress (buf_t *buf, tor_compress_state_t *state, const char *data, size_t data_len, const int done)

Detailed Description

Working with compressed data in buffers.

Definition in file compress_buf.c.

Function Documentation

◆ buf_add_compress()

int buf_add_compress ( buf_t *  buf,
tor_compress_state_t state,
const char *  data,
size_t  data_len,
const int  done 

Compress or uncompress the data_len bytes in data using the compression state state, appending the result to buf. If done is true, flush the data in the state and finish the compression/uncompression. Return -1 on failure, 0 on success.

Definition at line 31 of file compress_buf.c.

Referenced by connection_write_to_buf_impl_().