Created
December 16, 2012 22:51
-
-
Save cwjenkins/4313869 to your computer and use it in GitHub Desktop.
Creates deadlock recursive locking on rack-1.4.1. MUST RUN IT TWICE!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'thin' | |
require 'rack' | |
success = Rack::URLMap.new("/" => lambda { |env| [200, {"Content-Type" => "text/plain"}, ["bar"]] }) | |
success_app = Rack::Builder.new { | |
use Rack::Lock | |
run success | |
}.to_app | |
error = Rack::URLMap.new("/" => lambda { |env| [404, {"Content-Type" => "text/plain"}, ["foo"]] }) | |
error_app = Rack::Builder.new { | |
use Rack::Lock | |
run error | |
}.to_app | |
Rack::Handler::Thin.run Rack::Cascade.new([ | |
error_app, | |
success_app | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment