修复可能访问空指针的问题

This commit is contained in:
ziyue 2021-08-23 11:00:20 +08:00
parent b3ad0891e6
commit 8b1d1d6e24

View File

@ -236,7 +236,7 @@ static inline void addHttpListener(){
auto &content = parser.Content();
log << "# content:\r\n" << (content.size() > 4 * 1024 ? content.substr(0, 4 * 1024) : content) << "\r\n";
if (size && size < 4 * 1024) {
if (size > 0 && size < 4 * 1024) {
auto response = body->readData(size);
log << "# response:\r\n" << response->data() << "\r\n";
invoker(code, headerOut, response);