From 065568e3a84b596ea15f80f67574ea7708d4e111 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 19 Apr 2016 10:39:55 +0300 Subject: [PATCH] Provide a method for the application to cancel connection keep-alive --- source/http/server.cpp | 5 +++++ source/http/server.h | 1 + 2 files changed, 6 insertions(+) diff --git a/source/http/server.cpp b/source/http/server.cpp index 60d37c8..fc6d61f 100644 --- a/source/http/server.cpp +++ b/source/http/server.cpp @@ -66,6 +66,11 @@ void Server::submit_response(Response &resp) send_response(cl, *cl.response); } +void Server::cancel_keepalive(Response &resp) +{ + get_client_by_response(resp).keepalive = false; +} + void Server::data_available() { Net::StreamSocket *csock = sock.accept(); diff --git a/source/http/server.h b/source/http/server.h index 29b2b45..3679013 100644 --- a/source/http/server.h +++ b/source/http/server.h @@ -44,6 +44,7 @@ public: void use_event_dispatcher(IO::EventDispatcher *); void delay_response(Response &); void submit_response(Response &); + void cancel_keepalive(Response &); private: void data_available(); void client_data_available(Client &); -- 2.45.2