tor  0.4.2.0-alpha-dev
Macros | Functions
compress_buf.c File Reference
#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.

Macros

#define BUFFERS_PRIVATE
 
#define check()   STMT_NIL
 

Functions

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.

References buf_add_chunk_with_capacity(), and tor_compress_process().

Referenced by MOCK_IMPL().