Skip to content

Commit 43c30d9

Browse files
committed
Fixed checking of limit of requests per connection
1 parent 0c86ef7 commit 43c30d9

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set(
2525

2626
### BEGIN Build configuration #################################################
2727
option(USE_LIBC++ "Use libc++ instead of libstdc++" OFF)
28+
option(USE_LTO "Use LTO (link time, interprocedural optimization)" ON)
2829

2930
set(
3031
BUILD_TYPE "RelWithDebInfo" CACHE STRING
@@ -44,6 +45,8 @@ if (NOT CMAKE_BUILD_TYPE)
4445
set(CMAKE_BUILD_TYPE ${BUILD_TYPE})
4546
endif()
4647

48+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ${USE_LTO})
49+
4750
set_property(CACHE SANITIZER PROPERTY STRINGS ${SANITIZERS})
4851
if (NOT SANITIZER IN_LIST SANITIZERS)
4952
message(FATAL_ERROR "Unknown value of SANITIZER: ${SANITIZER}")
@@ -182,5 +185,6 @@ message(
182185
)
183186
message(STATUS "Use libc++: ${USE_LIBC++}")
184187
message(STATUS "Clang-tidy: ${CLANG_TIDY} ${CLANG_TIDY_VERSION}")
188+
message(STATUS "Use LTO: ${USE_LTO}")
185189
message(STATUS "DEBUG: ${ENABLE_TEMPORARY_DEBUG}")
186190
message(STATUS "Sanitizer: ${SANITIZER}")

etc/default_cfg.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
}
1111
},
1212
"http_server": {
13+
"keepalive_requests": 100,
1314
"port": 8080
1415
}
1516
}

src/http_server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ http_server::handle_connection(socket_type conn, endpoint_type client,
256256
stat->data.data_resp += response.body().size();
257257
response.set(boost::beast::http::field::server, header_server);
258258
keepalive = request.keep_alive() &&
259-
(!keepalive_requests || req_n <= *keepalive_requests);
259+
(!keepalive_requests || req_n < *keepalive_requests);
260260
response.keep_alive(keepalive);
261261
// Send the response
262262
stream.expires_never();

0 commit comments

Comments
 (0)