GNU libmicrohttpd  0.9.29
compression.h File Reference

zlib handling functions More...

#include "platform.h"
Include dependency graph for compression.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SPDYF_ZLIB_CHUNK   16384
 

Functions

int SPDYF_zlib_deflate_init (z_stream *strm)
 
void SPDYF_zlib_deflate_end (z_stream *strm)
 
int SPDYF_zlib_deflate (z_stream *strm, const void *src, size_t src_size, size_t *data_used, void **dest, size_t *dest_size)
 
int SPDYF_zlib_inflate_init (z_stream *strm)
 
void SPDYF_zlib_inflate_end (z_stream *strm)
 
int SPDYF_zlib_inflate (z_stream *strm, const void *src, size_t src_size, void **dest, size_t *dest_size)
 

Detailed Description

zlib handling functions

Author
Andrey Uzunov

Definition in file compression.h.

Macro Definition Documentation

#define SPDYF_ZLIB_CHUNK   16384

Definition at line 31 of file compression.h.

Referenced by SPDYF_zlib_deflate(), and SPDYF_zlib_inflate().

Function Documentation

int SPDYF_zlib_deflate ( z_stream *  strm,
const void *  src,
size_t  src_size,
size_t *  data_used,
void **  dest,
size_t *  dest_size 
)

Compressing stream with zlib.

Parameters
strmZlib stream on which we work
srcstream of the data to be compressed
src_sizesize of the data
data_usedthe number of bytes from src_stream that were used TODO do we need
destthe resulting compressed stream. Should be NULL. Must be freed later manually.
dest_sizesize of the data after compression
Returns
SPDY_NO if malloc or zlib failed. SPDY_YES otherwise

Definition at line 250 of file compression.c.

References NULL, SPDY_NO, SPDY_YES, SPDYF_ASSERT, SPDYF_DEBUG, and SPDYF_ZLIB_CHUNK.

Referenced by SPDYF_handler_write_syn_reply().

Here is the caller graph for this function:

void SPDYF_zlib_deflate_end ( z_stream *  strm)

Deinitializes the zlib stream for compression. Should be called once for a session on cleaning up.

Parameters
strmZlib stream on which we work

Definition at line 244 of file compression.c.

Referenced by SPDYF_session_accept(), and SPDYF_session_destroy().

Here is the caller graph for this function:

int SPDYF_zlib_deflate_init ( z_stream *  strm)

Initializes the zlib stream for compression. Must be called once for a session on initialization.

Parameters
strmZlib stream on which we work
Returns
SPDY_NO if zlib failed. SPDY_YES otherwise

Definition at line 215 of file compression.c.

References SPDY_NO, SPDY_YES, SPDYF_DEBUG, and spdyf_zlib_dictionary.

Referenced by SPDYF_session_accept().

Here is the caller graph for this function:

int SPDYF_zlib_inflate ( z_stream *  strm,
const void *  src,
size_t  src_size,
void **  dest,
size_t *  dest_size 
)

Decompressing stream with zlib.

Parameters
strmZlib stream on which we work
srcstream of the data to be decompressed
src_sizesize of the data
destthe resulting decompressed stream. Should be NULL. Must be freed manually.
dest_sizesize of the data after decompression
Returns
SPDY_NO if malloc or zlib failed. SPDY_YES otherwise. If the function fails, the SPDY session must be closed

Definition at line 350 of file compression.c.

References NULL, SPDY_NO, SPDY_YES, SPDYF_DEBUG, SPDYF_ZLIB_CHUNK, and spdyf_zlib_dictionary.

Referenced by spdyf_handler_read_syn_stream().

Here is the caller graph for this function:

void SPDYF_zlib_inflate_end ( z_stream *  strm)

Deinitializes the zlib stream for decompression. Should be called once for a session on cleaning up.

Parameters
strmZlib stream on which we work

Definition at line 343 of file compression.c.

Referenced by SPDYF_session_destroy().

Here is the caller graph for this function:

int SPDYF_zlib_inflate_init ( z_stream *  strm)

Initializes the zlib stream for decompression. Must be called once for a session.

Parameters
strmZlib stream on which we work
Returns
SPDY_NO if zlib failed. SPDY_YES otherwise

Definition at line 320 of file compression.c.

References SPDY_NO, SPDY_YES, and SPDYF_DEBUG.

Referenced by SPDYF_session_accept().

Here is the caller graph for this function: