I have a server and get data on it from another server. This data must be compressed using zlib and sent by the socket to the third server. The third server uses gzip to decompress the data.
I am using this feature.
std::string compressData(const std::string &data) { using namespace boost::iostreams; using namespace std; using namespace boost::archive::iterators; stringstream zippedOutputStream; filtering_ostream filteringStream; filteringStream.push(gzip_compressor()); filteringStream.push(zippedOutputStream); stringstream stringStream; stringStream << data; boost::iostreams::copy(stringStream, filteringStream); return zippedOutputStream.str(); }
The third server receives two or more parts at once. He tries to unzip the data using gzip, but the result is only the first part. The remaining parts are missing. How do I change the compressData function to fix this problem.
source share