Skip to content

Commit 8793eb7

Browse files
committed
client: check drain_body error code
1 parent f81f89d commit 8793eb7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/client.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,7 @@ client::execute_impl(
326326
auto [dec] = co_await capy::timeout(
327327
detail::drain_body(parser, capy::any_stream(&conn), 1024 * 1024),
328328
std::chrono::seconds(2));
329-
330-
if(detail::can_reuse_conn(parser))
329+
if(!dec && detail::can_reuse_conn(parser))
331330
conn.return_to_pool();
332331

333332
if(maxredirs-- == 0)

0 commit comments

Comments
 (0)