Skip to content

Commit

Permalink
FastCGI Handler should not rebind to host/port if file is set.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stormbrew authored and manveru committed Dec 11, 2010
1 parent 469518f commit b79ea44
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/rack/handler/fastcgi.rb
Expand Up @@ -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 = STDIN.reopen(UNIXServer.new(options[:File]))
elsif options[:Port]
port = STDIN.reopen(TCPServer.new(options[:Host], options[:Port]))
end
FCGI.each { |request|
serve request, app
}
Expand Down

0 comments on commit b79ea44

Please sign in to comment.