decompressor.hpp
// ---------------------------------------------------------------------
// pion: a Boost C++ framework for building lightweight HTTP interfaces
// ---------------------------------------------------------------------
// Copyright (C) 2007-2014 Splunk Inc. (https://github.com/splunk/pion)
//
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
//
#ifndef __PION_SPDYDECOMPRESSOR_HEADER__
#define __PION_SPDYDECOMPRESSOR_HEADER__
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <pion/config.hpp>
#include <pion/spdy/types.hpp>
#include <zlib.h>
namespace pion { // begin namespace pion
namespace spdy { // begin namespace spdy
class PION_API decompressor
{
public:
enum data_size_t {
MAX_UNCOMPRESSED_DATA_BUF_SIZE = 16384
};
decompressor();
~decompressor();
char* decompress(const char *compressed_data_ptr,
boost::uint32_t stream_id,
const spdy_control_frame_info& frame,
boost::uint32_t header_block_length);
protected:
bool spdy_decompress_header(const char *compressed_data_ptr,
z_streamp decomp,
boost::uint32_t length,
boost::uint32_t& uncomp_length);
private:
z_streamp m_request_zstream;
z_streamp m_response_zstream;
boost::uint32_t m_dictionary_id;
boost::uint8_t m_uncompressed_header[MAX_UNCOMPRESSED_DATA_BUF_SIZE];
// SPDY Dictionary used for zlib decompression
static const char SPDY_ZLIB_DICTIONARY[];
};
typedef boost::shared_ptr<decompressor> decompressor_ptr;
} // end namespace spdy
} // end namespace pion
#endif
pion::spdy::decompressor
Definition: decompressor.hpp:29
pion::spdy::decompressor::data_size_t
data_size_t
data size constants
Definition: decompressor.hpp:34
pion
Definition: admin_rights.hpp:19
pion::spdy::spdy_control_frame_info
This structure will be tied to each SPDY frame.
Definition: types.hpp:48