From: Mikko Rasa Date: Tue, 19 Apr 2016 07:39:55 +0000 (+0300) Subject: Provide a method for the application to cancel connection keep-alive X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=065568e3a84b596ea15f80f67574ea7708d4e111;p=libs%2Fnet.git Provide a method for the application to cancel connection keep-alive --- 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 &);