From b4748a226cf8a2d8846d7c2c2319d1bb5c643623 Mon Sep 17 00:00:00 2001 From: yhirose Date: Thu, 21 Dec 2023 13:33:52 -0500 Subject: [PATCH] Fix #1738 --- httplib.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/httplib.h b/httplib.h index 43c8a3b..2f6df1c 100644 --- a/httplib.h +++ b/httplib.h @@ -3860,11 +3860,7 @@ inline bool read_content_without_length(Stream &strm, uint64_t r = 0; for (;;) { auto n = strm.read(buf, CPPHTTPLIB_RECV_BUFSIZ); - if (n < 0) { - return false; - } else if (n == 0) { - return true; - } + if (n <= 0) { return true; } if (!out(buf, static_cast(n), r, 0)) { return false; } r += static_cast(n);