src/microspdy/compression.c File Reference

zlib handling functions More...

#include "platform.h"
#include "structures.h"
#include "internal.h"
#include "compression.h"
Include dependency graph for compression.c:

Go to the source code of this file.

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)

Variables

static const unsigned char spdyf_zlib_dictionary []

Detailed Description

zlib handling functions

Author:
Andrey Uzunov

Definition in file compression.c.


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:
strm Zlib stream on which we work
src stream of the data to be compressed
src_size size of the data
data_used the number of bytes from src_stream that were used TODO do we need
dest the resulting compressed stream. Should be NULL. Must be freed later manually.
dest_size size 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:
strm Zlib 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:
strm Zlib 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:
strm Zlib stream on which we work
src stream of the data to be decompressed
src_size size of the data
dest the resulting decompressed stream. Should be NULL. Must be freed manually.
dest_size size 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:
strm Zlib 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:
strm Zlib 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:


Variable Documentation

const unsigned char spdyf_zlib_dictionary[] [static]

Definition at line 32 of file compression.c.

Referenced by SPDYF_zlib_deflate_init(), and SPDYF_zlib_inflate().


Generated on 17 Oct 2014 for GNU libmicrohttpd by  doxygen 1.6.1