]> git.tdb.fi Git - libs/net.git/commitdiff
Provide a method for the application to cancel connection keep-alive
authorMikko Rasa <tdb@tdb.fi>
Tue, 19 Apr 2016 07:39:55 +0000 (10:39 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 19 Apr 2016 07:53:30 +0000 (10:53 +0300)
source/http/server.cpp
source/http/server.h

index 60d37c8f139b2b3ee3b344eb2220cbf89487b896..fc6d61f14c8c065e43bf951a4cc8f52b5a7eac48 100644 (file)
@@ -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();
index 29b2b45a3d4cb95ad35a529139a64834e2e3c657..3679013dda51c22c9f76438298b870e069bcd6e1 100644 (file)
@@ -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 &);