WebSocketPerMessageDeflateCompressor can work with vector or std::string
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
#include "zlib.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace ix
|
||||
{
|
||||
@ -20,9 +21,13 @@ namespace ix
|
||||
|
||||
bool init(uint8_t deflateBits, bool clientNoContextTakeOver);
|
||||
bool compress(const std::string& in, std::string& out);
|
||||
bool compress(const std::string& in, std::vector<uint8_t>& out);
|
||||
bool compress(const std::vector<uint8_t>& in, std::string& out);
|
||||
bool compress(const std::vector<uint8_t>& in, std::vector<uint8_t>& out);
|
||||
|
||||
private:
|
||||
static bool endsWith(const std::string& value, const std::string& ending);
|
||||
template<typename T, typename S> bool compressData(const T& in, S& out);
|
||||
template<typename T> bool endsWithEmptyUnCompressedBlock(const T& value);
|
||||
|
||||
int _flush;
|
||||
size_t _compressBufferSize;
|
||||
|
Reference in New Issue
Block a user