Skip to content

Commit 9c9f833

Browse files
committed
FIX: http client read response header failed should close socket
1 parent 6c56509 commit 9c9f833

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

net/http/client.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ class ClientImpl : public Client {
263263
resp.reset((char *)buf, kMinimalHeadersSize, true, sock.release(), true, req.verb());
264264
}
265265
if (op->resp.receive_header(tmo.timeout()) != 0) {
266+
sock->close();
266267
req.reset_status();
267268
LOG_ERROR_RETURN(0, ROUNDTRIP_NEED_RETRY, "read response header failed");
268269
}

0 commit comments

Comments
 (0)