summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-05-31 10:17:11 +0200
committerRoland Reichwein <mail@reichwein.it>2020-05-31 10:17:11 +0200
commit358808f9cac094e1d02b467ea61bd2ea915ed5e6 (patch)
tree7dd5432872e67628c75b3fe20345d87dfb3147d4
parentb715de1eb6f937b0a05d91842041a54455946061 (diff)
Compile fix for debian 10
-rw-r--r--http.cpp4
-rw-r--r--https.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/http.cpp b/http.cpp
index 1d3edee..1ea960d 100644
--- a/http.cpp
+++ b/http.cpp
@@ -63,7 +63,11 @@ class session : public std::enable_shared_from_this<session>
void handle_request(::Server& server, request_type&& req)
{
+#ifdef BOOST_LATEST
stream_.expires_after(std::chrono::seconds(300)); // timeout on write by server much longer than read timeout from client
+#else
+ // socket_.expires_after(std::chrono::seconds(300)); // not supported by old boost
+#endif
auto sp = std::make_shared<response_type>(generate_response(req, server));
res_ = sp;
diff --git a/https.cpp b/https.cpp
index 50ea31c..7ba3b74 100644
--- a/https.cpp
+++ b/https.cpp
@@ -98,7 +98,11 @@ class session : public std::enable_shared_from_this<session>
void handle_request(::Server& server, request_type&& req)
{
+#ifdef BOOST_LATEST
beast::get_lowest_layer(stream_).expires_after(std::chrono::seconds(300)); // timeout on write by server much longer than read timeout from client
+#else
+ // beast::get_lowest_layer<tcp::socket>(stream_).expires_after(std::chrono::seconds(300)); // not supported by boost
+#endif
auto sp = std::make_shared<response_type>(generate_response(req, server));
res_ = sp;