Skip to content

Commit 9589519

Browse files
committed
Fix #2130
1 parent caf7c55 commit 9589519

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

httplib.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -7329,8 +7329,9 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
73297329
}
73307330

73317331
// Setup `is_connection_closed` method
7332-
req.is_connection_closed = [&]() {
7333-
return !detail::is_socket_alive(strm.socket());
7332+
auto sock = strm.socket();
7333+
req.is_connection_closed = [sock]() {
7334+
return !detail::is_socket_alive(sock);
73347335
};
73357336

73367337
// Routing

0 commit comments

Comments
 (0)