Permalink
Browse files

Fix FCGI handler with lighttpd [#1854 state:resolved]

  • Loading branch information...
1 parent 2277fbe commit 2316e7dfb16518d4d0d92165bcd53b262080fc37 @josh josh committed Feb 7, 2009
Showing with 6 additions and 4 deletions.
  1. +6 −4 railties/lib/fcgi_handler.rb
@@ -38,6 +38,8 @@ def initialize(log_file_path = nil, gc_request_period = nil)
# Safely install signal handlers.
install_signal_handlers
+ @app = Dispatcher.new
+
# Start error timestamp at 11 seconds ago.
@last_error_on = Time.now - 11
end
@@ -72,8 +74,8 @@ def process_each_request(provider)
cgi = nil
catch :exit do
- provider.each_cgi do |cgi|
- process_request(cgi)
+ provider.each do |request|
+ process_request(request)
case when_ready
when :reload
@@ -92,13 +94,13 @@ def process_each_request(provider)
close_connection(cgi)
end
- def process_request(cgi)
+ def process_request(request)
@processing, @when_ready = true, nil
gc_countdown
with_signal_handler 'USR1' do
begin
- ::Rack::Handler::FastCGI.serve(cgi, Dispatcher.new)
+ ::Rack::Handler::FastCGI.serve(request, @app)
rescue SignalException, SystemExit
raise
rescue Exception => error

0 comments on commit 2316e7d

Please sign in to comment.