From 09535c1bd412bd66f93723c2c1aa7aacc2e091c3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 5 Oct 2009 20:16:18 -0700 Subject: Thread* models: cleanup timeout management Ensure we reset the per-thread time Thread.current[:t] with each connection so we don't timeout long-lived connections. --- lib/rainbows/base.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/rainbows/base.rb') diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb index 07fb584..11c8c7c 100644 --- a/lib/rainbows/base.rb +++ b/lib/rainbows/base.rb @@ -24,7 +24,8 @@ module Rainbows env = {} remote_addr = TCPSocket === client ? client.peeraddr.last : LOCALHOST - begin + begin # loop + Thread.current[:t] = Time.now while ! hp.headers(env, buf) buf << client.readpartial(CHUNK_SIZE) end -- cgit v1.2.3-24-ge0c7