diff options
-rw-r--r-- | lib/rainbows.rb | 18 | ||||
-rw-r--r-- | lib/rainbows/http_server.rb | 3 |
2 files changed, 12 insertions, 9 deletions
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 diff --git a/lib/rainbows/http_server.rb b/lib/rainbows/http_server.rb index acc64b5..cd289b7 100644 --- a/lib/rainbows/http_server.rb +++ b/lib/rainbows/http_server.rb @@ -34,8 +34,7 @@ class Rainbows::HttpServer < Unicorn::HttpServer def load_config! use :Base - Rainbows.keepalive_timeout = 5 - Rainbows.client_max_body_size = 1024 * 1024 + Rainbows.defaults! @worker_connections = nil super @worker_connections ||= @use == :Base ? 1 : 50 |