From 8fb350e00c1421907cbc36cbf29c499b8ad051e4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 3 May 2011 01:18:45 +0000 Subject: Rainbows! defaults more DRY We won't forget to reset defaults on SIGHUP anymore. --- lib/rainbows.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'lib/rainbows.rb') diff --git a/lib/rainbows.rb b/lib/rainbows.rb index e151a32..f731a6a 100644 --- a/lib/rainbows.rb +++ b/lib/rainbows.rb @@ -77,15 +77,19 @@ module Rainbows end # :startdoc: - # the default max body size is 1 megabyte (1024 * 1024 bytes) - @client_max_body_size = 1024 * 1024 + def self.defaults! + # the default max body size is 1 megabyte (1024 * 1024 bytes) + @client_max_body_size = 1024 * 1024 - # the default keepalive_timeout is 5 seconds - @keepalive_timeout = 5 + # the default keepalive_timeout is 5 seconds + @keepalive_timeout = 5 - # 1024 bytes matches nginx, though Rails session cookies will typically - # need >= 1500... - @client_header_buffer_size = 1024 + # 1024 bytes matches nginx, though Rails session cookies will typically + # need >= 1500... + @client_header_buffer_size = 1024 + end + + defaults! # :stopdoc: @alive = true -- cgit v1.2.3-24-ge0c7