From 02245b9ea8a407ac67a9633119140fa2fd2c561e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 18 Nov 2009 00:08:26 -0800 Subject: EventMachine: implement keepalive timeout Fortunately it's easy here. --- lib/rainbows/event_machine.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/rainbows/event_machine.rb') diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb index 76085dc..056bdd5 100644 --- a/lib/rainbows/event_machine.rb +++ b/lib/rainbows/event_machine.rb @@ -51,6 +51,7 @@ module Rainbows end def app_call + set_comm_inactivity_timeout 0 begin (@env[RACK_INPUT] = @input).rewind @env[REMOTE_ADDR] = @remote_addr @@ -73,6 +74,7 @@ module Rainbows @state = :headers # keepalive requests are always body-less, so @input is unchanged @hp.headers(@env, @buf) and next + set_comm_inactivity_timeout 5 end return end while true -- cgit v1.2.3-24-ge0c7