mirror of
https://github.com/lifegpc/c-utils.git
synced 2026-06-09 14:48:49 +08:00
Fix unexpected inflate failed
This commit is contained in:
@@ -619,14 +619,12 @@ std::string Response::inflate(std::string data) {
|
|||||||
if (res == Z_STREAM_END) {
|
if (res == Z_STREAM_END) {
|
||||||
re += std::string(buf, 10240 - this->zstream.avail_out);
|
re += std::string(buf, 10240 - this->zstream.avail_out);
|
||||||
break;
|
break;
|
||||||
} else if (res == Z_BUF_ERROR) {
|
} else if (res == Z_STREAM_ERROR || res == Z_NEED_DICT || res == Z_DATA_ERROR || res == Z_MEM_ERROR) {
|
||||||
re += std::string(buf, 10240 - this->zstream.avail_out);
|
|
||||||
} else if (res != Z_OK) {
|
|
||||||
throw std::runtime_error("inflate failed");
|
throw std::runtime_error("inflate failed");
|
||||||
} else {
|
} else {
|
||||||
re += std::string(buf, 10240 - this->zstream.avail_out);
|
re += std::string(buf, 10240 - this->zstream.avail_out);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
if (this->zstream.avail_out != 0) break;
|
||||||
}
|
}
|
||||||
return re;
|
return re;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user