File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4389,7 +4389,8 @@ inline bool read_content_without_length(Stream &strm,
43894389 uint64_t r = 0 ;
43904390 for (;;) {
43914391 auto n = strm.read (buf, CPPHTTPLIB_RECV_BUFSIZ);
4392- if (n <= 0 ) { return false ; }
4392+ if (n == 0 ) { return true ; }
4393+ if (n < 0 ) { return false ; }
43934394
43944395 if (!out (buf, static_cast <size_t >(n), r, 0 )) { return false ; }
43954396 r += static_cast <uint64_t >(n);
@@ -10492,4 +10493,4 @@ inline SSL_CTX *Client::ssl_context() const {
1049210493
1049310494} // namespace httplib
1049410495
10495- #endif // CPPHTTPLIB_HTTPLIB_H
10496+ #endif // CPPHTTPLIB_HTTPLIB_H
Original file line number Diff line number Diff line change @@ -5571,6 +5571,9 @@ TEST(StreamingTest, NoContentLengthStreaming) {
55715571 s += std::string (data, len);
55725572 return true ;
55735573 });
5574+
5575+ ASSERT_TRUE (res);
5576+ EXPECT_EQ (StatusCode::OK_200, res->status );
55745577 EXPECT_EQ (" aaabbb" , s);
55755578 });
55765579 auto get_se = detail::scope_exit ([&] { get_thread.join (); });
You can’t perform that action at this time.
0 commit comments