From 37c376a9253ed62d134cbb4dbc6eaecc6076c77e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 27 Jun 2011 21:20:42 +0000 Subject: http_server: cap timeout at 32-bit LONG_MAX seconds We can't wait for longer than 68 years. --- lib/rainbows/http_server.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/rainbows/http_server.rb b/lib/rainbows/http_server.rb index 746d534..2573032 100644 --- a/lib/rainbows/http_server.rb +++ b/lib/rainbows/http_server.rb @@ -27,8 +27,9 @@ class Rainbows::HttpServer < Unicorn::HttpServer # connection we accept without wasting cycles. That added to the # fact that we let clients keep idle connections open for long # periods of time means we have to chmod at a fixed interval. - def timeout=(nr) - @timeout = nr + 1 + def timeout=(seconds) + max = 0x7fffffff + @timeout = seconds >= max ? max : seconds + 1 end def load_config! -- cgit v1.2.3-24-ge0c7