yhirose 8 tháng trước cách đây
mục cha
commit
9589519d58
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      httplib.h

+ 3 - 2
httplib.h

@@ -7329,8 +7329,9 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
   }
 
   // Setup `is_connection_closed` method
-  req.is_connection_closed = [&]() {
-    return !detail::is_socket_alive(strm.socket());
+  auto sock = strm.socket();
+  req.is_connection_closed = [sock]() {
+    return !detail::is_socket_alive(sock);
   };
 
   // Routing