Skip to content

Commit

Permalink
Use Swiftiply backend when -y option is specified
Browse files Browse the repository at this point in the history
[macournoyer#63 state:resolved]
[macournoyer#64 state:resolved]
  • Loading branch information
macournoyer committed Apr 19, 2008
1 parent 06439cf commit 79f2a32
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
== 0.8.1 Rebel Porpoise release
* [bug] Use Swiftiply backend when -y option is specified, fixes #63 and #64
* Allow passing port as a string in Server.new
* Define deferred?(env) in your Rack application to set if a request is handled in a
thread (return true) or not (return false).

== 0.8.0 Dodgy Dentist release
* Fix server crash when header too large.
* [bug] Fix server crash when header too large.
* Add --require (-r) option to require a library, before executing your script.
* Rename --rackup short option to -R, warn and load as rackup when file ends with .ru.
* List supported adapters in command usage.
* Add file adapter to built-in adapter, serve static files in current directory.
* Allow disabling signal handling in Server with :signals => false
* Make Server.new arguments more flexible, can now specify any of host, port, app or hash options.
* Add --backend option to specified which backend to use, closes #55
* Serve static file only on GET and HEAD requests in Rails adapter, fixes #58
* [bug] Serve static file only on GET and HEAD requests in Rails adapter, fixes #58
* Add threaded option to run server in threaded mode, calling the application in a
thread allowing for concurrency in the Rack adapter, closes #46
* Guess which adapter to use from directory (chdir option)
Expand Down
15 changes: 6 additions & 9 deletions lib/thin/controllers/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ def initialize(options)
end

def start
# Select proper backend
server = case
when @options.has_key?(:backend)
Server.new(@options[:address], @options[:port], :backend => eval(@options[:backend], TOPLEVEL_BINDING))
when @options.has_key?(:socket)
Server.new(@options[:socket])
else
Server.new(@options[:address], @options[:port])
end
# Constantize backend class
@options[:backend] = eval(@options[:backend], TOPLEVEL_BINDING) if @options[:backend]

server = Server.new(@options[:socket] || @options[:address], # Server detects kind of socket
@options[:port], # Port ignored on UNIX socket
@options)

# Set options
server.pid_file = @options[:pid]
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@server = OpenStruct.new
@adapter = OpenStruct.new

Server.should_receive(:new).with('0.0.0.0', 3000).and_return(@server)
Server.should_receive(:new).with('0.0.0.0', 3000, @controller.options).and_return(@server)
@server.should_receive(:config)
Rack::Adapter::Rails.stub!(:new).and_return(@adapter)
end
Expand Down

0 comments on commit 79f2a32

Please sign in to comment.