From 996e8cbf24db14b9a83eaa5f353dd8db3c1cf100 Mon Sep 17 00:00:00 2001 From: Graham Date: Wed, 1 Dec 2010 18:48:13 -0700 Subject: [PATCH 1/2] FastCGI Handler should not rebind to host/port if file is set. File should override Port/Host so that things like Rackup that *always* pass in a host/port combination can be overriden by the File parameter. This change makes that happen. --- lib/rack/handler/fastcgi.rb | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/rack/handler/fastcgi.rb b/lib/rack/handler/fastcgi.rb index 8fa24d7..c0be5b4 100644 --- a/lib/rack/handler/fastcgi.rb +++ b/lib/rack/handler/fastcgi.rb @@ -19,8 +19,11 @@ module Rack module Handler class FastCGI def self.run(app, options={}) - file = options[:File] and STDIN.reopen(UNIXServer.new(file)) - port = options[:Port] and STDIN.reopen(TCPServer.new(options[:Host], port)) + if (options[:File]) + file = options[:File] and STDIN.reopen(UNIXServer.new(file)) + else + port = options[:Port] and STDIN.reopen(TCPServer.new(options[:Host], port)) + end FCGI.each { |request| serve request, app } -- 1.6.1.2