unicorn 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +1 -0
- data/DESIGN +14 -10
- data/GNUmakefile +13 -3
- data/README +28 -21
- data/SIGNALS +11 -4
- data/TODO +0 -2
- data/ext/unicorn/http11/http11.c +17 -34
- data/lib/unicorn.rb +38 -37
- data/lib/unicorn/app/old_rails.rb +9 -3
- data/lib/unicorn/cgi_wrapper.rb +2 -4
- data/lib/unicorn/configurator.rb +29 -19
- data/lib/unicorn/const.rb +1 -1
- data/lib/unicorn/http_request.rb +0 -1
- data/lib/unicorn/socket.rb +17 -57
- data/local.mk.sample +1 -0
- data/test/exec/test_exec.rb +76 -6
- data/test/test_helper.rb +3 -2
- data/test/unit/test_configurator.rb +16 -1
- data/test/unit/test_http_parser.rb +1 -1
- data/test/unit/test_request.rb +53 -0
- data/test/unit/test_server.rb +38 -3
- data/test/unit/test_signals.rb +108 -0
- data/test/unit/test_socket_helper.rb +19 -7
- data/unicorn.gemspec +4 -4
- metadata +3 -2
| @@ -49,7 +49,7 @@ class HttpParserTest < Test::Unit::TestCase | |
| 49 49 | 
             
                should_be_good = "GET / HTTP/1.1\r\naaaaaaaaaaaaa:++++++++++\r\n\r\n"
         | 
| 50 50 | 
             
                assert parser.execute(req, should_be_good)
         | 
| 51 51 |  | 
| 52 | 
            -
                # ref: http://thread.gmane.org/gmane.comp.lang.ruby. | 
| 52 | 
            +
                # ref: http://thread.gmane.org/gmane.comp.lang.ruby.mongrel.devel/37/focus=45
         | 
| 53 53 | 
             
                # (note we got 'pen' mixed up with 'pound' in that thread,
         | 
| 54 54 | 
             
                # but the gist of it is still relevant: these nasty headers are irrelevant
         | 
| 55 55 | 
             
                #
         | 
    
        data/test/unit/test_request.rb
    CHANGED
    
    | @@ -33,10 +33,63 @@ class RequestTest < Test::Unit::TestCase | |
| 33 33 | 
             
                @lint = Rack::Lint.new(@app)
         | 
| 34 34 | 
             
              end
         | 
| 35 35 |  | 
| 36 | 
            +
              def test_options
         | 
| 37 | 
            +
                client = MockRequest.new("OPTIONS * HTTP/1.1\r\n" \
         | 
| 38 | 
            +
                                         "Host: foo\r\n\r\n")
         | 
| 39 | 
            +
                res = env = nil
         | 
| 40 | 
            +
                assert_nothing_raised { env = @request.read(client) }
         | 
| 41 | 
            +
                assert_equal '*', env['REQUEST_PATH']
         | 
| 42 | 
            +
                assert_equal '*', env['PATH_INFO']
         | 
| 43 | 
            +
                assert_equal '*', env['REQUEST_URI']
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                # assert_nothing_raised { res = @lint.call(env) } # fails Rack lint
         | 
| 46 | 
            +
              end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
              def test_full_url_path
         | 
| 49 | 
            +
                client = MockRequest.new("GET http://e:3/x?y=z HTTP/1.1\r\n" \
         | 
| 50 | 
            +
                                         "Host: foo\r\n\r\n")
         | 
| 51 | 
            +
                res = env = nil
         | 
| 52 | 
            +
                assert_nothing_raised { env = @request.read(client) }
         | 
| 53 | 
            +
                assert_equal '/x', env['REQUEST_PATH']
         | 
| 54 | 
            +
                assert_equal '/x', env['PATH_INFO']
         | 
| 55 | 
            +
                assert_nothing_raised { res = @lint.call(env) }
         | 
| 56 | 
            +
              end
         | 
| 57 | 
            +
             | 
| 58 | 
            +
              def test_x_forwarded_proto_https
         | 
| 59 | 
            +
                res = env = nil
         | 
| 60 | 
            +
                client = MockRequest.new("GET / HTTP/1.1\r\n" \
         | 
| 61 | 
            +
                                         "X-Forwarded-Proto: https\r\n" \
         | 
| 62 | 
            +
                                         "Host: foo\r\n\r\n")
         | 
| 63 | 
            +
                assert_nothing_raised { env = @request.read(client) }
         | 
| 64 | 
            +
                assert_equal "https", env['rack.url_scheme']
         | 
| 65 | 
            +
                assert_nothing_raised { res = @lint.call(env) }
         | 
| 66 | 
            +
              end
         | 
| 67 | 
            +
             | 
| 68 | 
            +
              def test_x_forwarded_proto_http
         | 
| 69 | 
            +
                res = env = nil
         | 
| 70 | 
            +
                client = MockRequest.new("GET / HTTP/1.1\r\n" \
         | 
| 71 | 
            +
                                         "X-Forwarded-Proto: http\r\n" \
         | 
| 72 | 
            +
                                         "Host: foo\r\n\r\n")
         | 
| 73 | 
            +
                assert_nothing_raised { env = @request.read(client) }
         | 
| 74 | 
            +
                assert_equal "http", env['rack.url_scheme']
         | 
| 75 | 
            +
                assert_nothing_raised { res = @lint.call(env) }
         | 
| 76 | 
            +
              end
         | 
| 77 | 
            +
             | 
| 78 | 
            +
              def test_x_forwarded_proto_invalid
         | 
| 79 | 
            +
                res = env = nil
         | 
| 80 | 
            +
                client = MockRequest.new("GET / HTTP/1.1\r\n" \
         | 
| 81 | 
            +
                                         "X-Forwarded-Proto: ftp\r\n" \
         | 
| 82 | 
            +
                                         "Host: foo\r\n\r\n")
         | 
| 83 | 
            +
                assert_nothing_raised { env = @request.read(client) }
         | 
| 84 | 
            +
                assert_equal "http", env['rack.url_scheme']
         | 
| 85 | 
            +
                assert_nothing_raised { res = @lint.call(env) }
         | 
| 86 | 
            +
              end
         | 
| 87 | 
            +
             | 
| 36 88 | 
             
              def test_rack_lint_get
         | 
| 37 89 | 
             
                client = MockRequest.new("GET / HTTP/1.1\r\nHost: foo\r\n\r\n")
         | 
| 38 90 | 
             
                res = env = nil
         | 
| 39 91 | 
             
                assert_nothing_raised { env = @request.read(client) }
         | 
| 92 | 
            +
                assert_equal "http", env['rack.url_scheme']
         | 
| 40 93 | 
             
                assert_equal '666.666.666.666', env['REMOTE_ADDR']
         | 
| 41 94 | 
             
                assert_nothing_raised { res = @lint.call(env) }
         | 
| 42 95 | 
             
              end
         | 
    
        data/test/unit/test_server.rb
    CHANGED
    
    | @@ -35,18 +35,53 @@ class WebServerTest < Test::Unit::TestCase | |
| 35 35 | 
             
                end
         | 
| 36 36 | 
             
              end
         | 
| 37 37 |  | 
| 38 | 
            +
              def test_preload_app_config
         | 
| 39 | 
            +
                teardown
         | 
| 40 | 
            +
                tmp = Tempfile.new('test_preload_app_config')
         | 
| 41 | 
            +
                ObjectSpace.undefine_finalizer(tmp)
         | 
| 42 | 
            +
                app = lambda { ||
         | 
| 43 | 
            +
                  tmp.sysseek(0)
         | 
| 44 | 
            +
                  tmp.truncate(0)
         | 
| 45 | 
            +
                  tmp.syswrite($$)
         | 
| 46 | 
            +
                  lambda { |env| [ 200, { 'Content-Type' => 'text/plain' }, [ "#$$\n" ] ] }
         | 
| 47 | 
            +
                }
         | 
| 48 | 
            +
                redirect_test_io do
         | 
| 49 | 
            +
                  @server = HttpServer.new(app, :listeners => [ "127.0.0.1:#@port"] )
         | 
| 50 | 
            +
                  @server.start
         | 
| 51 | 
            +
                end
         | 
| 52 | 
            +
                results = hit(["http://localhost:#@port/"])
         | 
| 53 | 
            +
                worker_pid = results[0].to_i
         | 
| 54 | 
            +
                tmp.sysseek(0)
         | 
| 55 | 
            +
                loader_pid = tmp.sysread(4096).to_i
         | 
| 56 | 
            +
                assert_equal worker_pid, loader_pid
         | 
| 57 | 
            +
                teardown
         | 
| 58 | 
            +
             | 
| 59 | 
            +
                redirect_test_io do
         | 
| 60 | 
            +
                  @server = HttpServer.new(app, :listeners => [ "127.0.0.1:#@port"],
         | 
| 61 | 
            +
                                           :preload_app => true)
         | 
| 62 | 
            +
                  @server.start
         | 
| 63 | 
            +
                end
         | 
| 64 | 
            +
                results = hit(["http://localhost:#@port/"])
         | 
| 65 | 
            +
                worker_pid = results[0].to_i
         | 
| 66 | 
            +
                tmp.sysseek(0)
         | 
| 67 | 
            +
                loader_pid = tmp.sysread(4096).to_i
         | 
| 68 | 
            +
                assert_equal $$, loader_pid
         | 
| 69 | 
            +
                assert worker_pid != loader_pid
         | 
| 70 | 
            +
                ensure
         | 
| 71 | 
            +
                  tmp.close!
         | 
| 72 | 
            +
              end
         | 
| 73 | 
            +
             | 
| 38 74 | 
             
              def test_broken_app
         | 
| 39 75 | 
             
                teardown
         | 
| 40 | 
            -
                port = unused_port
         | 
| 41 76 | 
             
                app = lambda { |env| raise RuntimeError, "hello" }
         | 
| 42 77 | 
             
                # [200, {}, []] }
         | 
| 43 78 | 
             
                redirect_test_io do
         | 
| 44 | 
            -
                  @server = HttpServer.new(app, :listeners => [ "127.0.0.1 | 
| 79 | 
            +
                  @server = HttpServer.new(app, :listeners => [ "127.0.0.1:#@port"] )
         | 
| 45 80 | 
             
                  @server.start
         | 
| 46 81 | 
             
                end
         | 
| 47 82 | 
             
                sock = nil
         | 
| 48 83 | 
             
                assert_nothing_raised do
         | 
| 49 | 
            -
                  sock = TCPSocket.new('127.0.0.1', port)
         | 
| 84 | 
            +
                  sock = TCPSocket.new('127.0.0.1', @port)
         | 
| 50 85 | 
             
                  sock.syswrite("GET / HTTP/1.0\r\n\r\n")
         | 
| 51 86 | 
             
                end
         | 
| 52 87 |  | 
| @@ -0,0 +1,108 @@ | |
| 1 | 
            +
            # Copyright (c) 2009 Eric Wong
         | 
| 2 | 
            +
            # You can redistribute it and/or modify it under the same terms as Ruby.
         | 
| 3 | 
            +
            #
         | 
| 4 | 
            +
            # Ensure we stay sane in the face of signals being sent to us
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            require 'test/test_helper'
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            include Unicorn
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            class Dd
         | 
| 11 | 
            +
              def initialize(bs, count)
         | 
| 12 | 
            +
                @count = count
         | 
| 13 | 
            +
                @buf = ' ' * bs
         | 
| 14 | 
            +
              end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
              def each(&block)
         | 
| 17 | 
            +
                @count.times { yield @buf }
         | 
| 18 | 
            +
              end
         | 
| 19 | 
            +
            end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            class SignalsTest < Test::Unit::TestCase
         | 
| 22 | 
            +
             | 
| 23 | 
            +
              def setup
         | 
| 24 | 
            +
                @bs = 1 * 1024 * 1024
         | 
| 25 | 
            +
                @count = 100
         | 
| 26 | 
            +
                @port = unused_port
         | 
| 27 | 
            +
                tmp = @tmp = Tempfile.new('unicorn.sock')
         | 
| 28 | 
            +
                File.unlink(@tmp.path)
         | 
| 29 | 
            +
                n = 0
         | 
| 30 | 
            +
                tmp.chmod(0)
         | 
| 31 | 
            +
                @server_opts = {
         | 
| 32 | 
            +
                  :listeners => [ "127.0.0.1:#@port", @tmp.path ],
         | 
| 33 | 
            +
                  :after_fork => lambda { |server,worker|
         | 
| 34 | 
            +
                    trap(:HUP) { tmp.chmod(n += 1) }
         | 
| 35 | 
            +
                  },
         | 
| 36 | 
            +
                }
         | 
| 37 | 
            +
                @server = nil
         | 
| 38 | 
            +
              end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
              def test_response_write
         | 
| 41 | 
            +
                app = lambda { |env|
         | 
| 42 | 
            +
                  [ 200, { 'Content-Type' => 'text/plain', 'X-Pid' => Process.pid.to_s },
         | 
| 43 | 
            +
                    Dd.new(@bs, @count) ]
         | 
| 44 | 
            +
                }
         | 
| 45 | 
            +
                redirect_test_io { @server = HttpServer.new(app, @server_opts).start }
         | 
| 46 | 
            +
                sock = nil
         | 
| 47 | 
            +
                assert_nothing_raised do
         | 
| 48 | 
            +
                  sock = TCPSocket.new('127.0.0.1', @port)
         | 
| 49 | 
            +
                  sock.syswrite("GET / HTTP/1.0\r\n\r\n")
         | 
| 50 | 
            +
                end
         | 
| 51 | 
            +
                buf = ''
         | 
| 52 | 
            +
                header_len = pid = nil
         | 
| 53 | 
            +
                assert_nothing_raised do
         | 
| 54 | 
            +
                  buf = sock.sysread(16384, buf)
         | 
| 55 | 
            +
                  pid = buf[/\r\nX-Pid: (\d+)\r\n/, 1].to_i
         | 
| 56 | 
            +
                  header_len = buf[/\A(.+?\r\n\r\n)/m, 1].size
         | 
| 57 | 
            +
                end
         | 
| 58 | 
            +
                read = buf.size
         | 
| 59 | 
            +
                mode_before = @tmp.stat.mode
         | 
| 60 | 
            +
                assert_raises(EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,
         | 
| 61 | 
            +
                              Errno::EBADF) do
         | 
| 62 | 
            +
                  loop do
         | 
| 63 | 
            +
                    3.times { Process.kill(:HUP, pid) }
         | 
| 64 | 
            +
                    sock.sysread(16384, buf)
         | 
| 65 | 
            +
                    read += buf.size
         | 
| 66 | 
            +
                    3.times { Process.kill(:HUP, pid) }
         | 
| 67 | 
            +
                  end
         | 
| 68 | 
            +
                end
         | 
| 69 | 
            +
             | 
| 70 | 
            +
                redirect_test_io { @server.stop(true) }
         | 
| 71 | 
            +
                # can't check for == since pending signals get merged
         | 
| 72 | 
            +
                assert mode_before < @tmp.stat.mode
         | 
| 73 | 
            +
                assert_equal(read - header_len, @bs * @count)
         | 
| 74 | 
            +
                assert_nothing_raised { sock.close }
         | 
| 75 | 
            +
              end
         | 
| 76 | 
            +
             | 
| 77 | 
            +
              def test_request_read
         | 
| 78 | 
            +
                app = lambda { |env|
         | 
| 79 | 
            +
                  [ 200, {'Content-Type'=>'text/plain', 'X-Pid'=>Process.pid.to_s}, [] ]
         | 
| 80 | 
            +
                }
         | 
| 81 | 
            +
                redirect_test_io { @server = HttpServer.new(app, @server_opts).start }
         | 
| 82 | 
            +
                pid = nil
         | 
| 83 | 
            +
             | 
| 84 | 
            +
                assert_nothing_raised do
         | 
| 85 | 
            +
                  sock = TCPSocket.new('127.0.0.1', @port)
         | 
| 86 | 
            +
                  sock.syswrite("GET / HTTP/1.0\r\n\r\n")
         | 
| 87 | 
            +
                  pid = sock.sysread(4096)[/\r\nX-Pid: (\d+)\r\n/, 1].to_i
         | 
| 88 | 
            +
                  sock.close
         | 
| 89 | 
            +
                end
         | 
| 90 | 
            +
             | 
| 91 | 
            +
                sock = TCPSocket.new('127.0.0.1', @port)
         | 
| 92 | 
            +
                sock.syswrite("PUT / HTTP/1.0\r\n")
         | 
| 93 | 
            +
                sock.syswrite("Content-Length: #{@bs * @count}\r\n\r\n")
         | 
| 94 | 
            +
                1000.times { Process.kill(:HUP, pid) }
         | 
| 95 | 
            +
                mode_before = @tmp.stat.mode
         | 
| 96 | 
            +
                killer = fork { loop { Process.kill(:HUP, pid); sleep(0.0001) } }
         | 
| 97 | 
            +
                buf = ' ' * @bs
         | 
| 98 | 
            +
                @count.times { sock.syswrite(buf) }
         | 
| 99 | 
            +
                Process.kill(:TERM, killer)
         | 
| 100 | 
            +
                Process.waitpid2(killer)
         | 
| 101 | 
            +
                redirect_test_io { @server.stop(true) }
         | 
| 102 | 
            +
                # can't check for == since pending signals get merged
         | 
| 103 | 
            +
                assert mode_before < @tmp.stat.mode
         | 
| 104 | 
            +
                assert_equal pid, sock.sysread(4096)[/\r\nX-Pid: (\d+)\r\n/, 1].to_i
         | 
| 105 | 
            +
                sock.close
         | 
| 106 | 
            +
              end
         | 
| 107 | 
            +
             | 
| 108 | 
            +
            end
         | 
| @@ -16,7 +16,7 @@ class TestSocketHelper < Test::Unit::TestCase | |
| 16 16 | 
             
                port = unused_port @test_addr
         | 
| 17 17 | 
             
                @tcp_listener_name = "#@test_addr:#{port}"
         | 
| 18 18 | 
             
                @tcp_listener = bind_listen(@tcp_listener_name)
         | 
| 19 | 
            -
                assert  | 
| 19 | 
            +
                assert TCPServer === @tcp_listener
         | 
| 20 20 | 
             
                assert_equal @tcp_listener_name, sock_name(@tcp_listener)
         | 
| 21 21 | 
             
              end
         | 
| 22 22 |  | 
| @@ -31,10 +31,10 @@ class TestSocketHelper < Test::Unit::TestCase | |
| 31 31 | 
             
                ].each do |opts|
         | 
| 32 32 | 
             
                  assert_nothing_raised do
         | 
| 33 33 | 
             
                    tcp_listener = bind_listen(tcp_listener_name, opts)
         | 
| 34 | 
            -
                    assert  | 
| 34 | 
            +
                    assert TCPServer === tcp_listener
         | 
| 35 35 | 
             
                    tcp_listener.close
         | 
| 36 36 | 
             
                    unix_listener = bind_listen(unix_listener_name, opts)
         | 
| 37 | 
            -
                    assert  | 
| 37 | 
            +
                    assert UNIXServer === unix_listener
         | 
| 38 38 | 
             
                    unix_listener.close
         | 
| 39 39 | 
             
                  end
         | 
| 40 40 | 
             
                end
         | 
| @@ -42,12 +42,18 @@ class TestSocketHelper < Test::Unit::TestCase | |
| 42 42 | 
             
              end
         | 
| 43 43 |  | 
| 44 44 | 
             
              def test_bind_listen_unix
         | 
| 45 | 
            +
                old_umask = File.umask(0777)
         | 
| 45 46 | 
             
                tmp = Tempfile.new 'unix.sock'
         | 
| 46 47 | 
             
                @unix_listener_path = tmp.path
         | 
| 47 48 | 
             
                File.unlink(@unix_listener_path)
         | 
| 48 49 | 
             
                @unix_listener = bind_listen(@unix_listener_path)
         | 
| 49 | 
            -
                assert  | 
| 50 | 
            +
                assert UNIXServer === @unix_listener
         | 
| 50 51 | 
             
                assert_equal @unix_listener_path, sock_name(@unix_listener)
         | 
| 52 | 
            +
                assert File.readable?(@unix_listener_path), "not readable"
         | 
| 53 | 
            +
                assert File.writable?(@unix_listener_path), "not writable"
         | 
| 54 | 
            +
                assert_equal 0777, File.umask
         | 
| 55 | 
            +
                ensure
         | 
| 56 | 
            +
                  File.umask(old_umask)
         | 
| 51 57 | 
             
              end
         | 
| 52 58 |  | 
| 53 59 | 
             
              def test_bind_listen_unix_idempotent
         | 
| @@ -55,6 +61,7 @@ class TestSocketHelper < Test::Unit::TestCase | |
| 55 61 | 
             
                a = bind_listen(@unix_listener)
         | 
| 56 62 | 
             
                assert_equal a.fileno, @unix_listener.fileno
         | 
| 57 63 | 
             
                unix_server = server_cast(@unix_listener)
         | 
| 64 | 
            +
                assert UNIXServer === unix_server
         | 
| 58 65 | 
             
                a = bind_listen(unix_server)
         | 
| 59 66 | 
             
                assert_equal a.fileno, unix_server.fileno
         | 
| 60 67 | 
             
                assert_equal a.fileno, @unix_listener.fileno
         | 
| @@ -65,6 +72,7 @@ class TestSocketHelper < Test::Unit::TestCase | |
| 65 72 | 
             
                a = bind_listen(@tcp_listener)
         | 
| 66 73 | 
             
                assert_equal a.fileno, @tcp_listener.fileno
         | 
| 67 74 | 
             
                tcp_server = server_cast(@tcp_listener)
         | 
| 75 | 
            +
                assert TCPServer === tcp_server
         | 
| 68 76 | 
             
                a = bind_listen(tcp_server)
         | 
| 69 77 | 
             
                assert_equal a.fileno, tcp_server.fileno
         | 
| 70 78 | 
             
                assert_equal a.fileno, @tcp_listener.fileno
         | 
| @@ -73,7 +81,7 @@ class TestSocketHelper < Test::Unit::TestCase | |
| 73 81 | 
             
              def test_bind_listen_unix_rebind
         | 
| 74 82 | 
             
                test_bind_listen_unix
         | 
| 75 83 | 
             
                new_listener = bind_listen(@unix_listener_path)
         | 
| 76 | 
            -
                assert  | 
| 84 | 
            +
                assert UNIXServer === new_listener
         | 
| 77 85 | 
             
                assert new_listener.fileno != @unix_listener.fileno
         | 
| 78 86 | 
             
                assert_equal sock_name(new_listener), sock_name(@unix_listener)
         | 
| 79 87 | 
             
                assert_equal @unix_listener_path, sock_name(new_listener)
         | 
| @@ -94,13 +102,17 @@ class TestSocketHelper < Test::Unit::TestCase | |
| 94 102 | 
             
                  test_bind_listen_unix
         | 
| 95 103 | 
             
                  test_bind_listen_tcp
         | 
| 96 104 | 
             
                end
         | 
| 97 | 
            -
                 | 
| 105 | 
            +
                unix_listener_socket = Socket.for_fd(@unix_listener.fileno)
         | 
| 106 | 
            +
                assert Socket === unix_listener_socket
         | 
| 107 | 
            +
                @unix_server = server_cast(unix_listener_socket)
         | 
| 98 108 | 
             
                assert_equal @unix_listener.fileno, @unix_server.fileno
         | 
| 99 109 | 
             
                assert UNIXServer === @unix_server
         | 
| 100 110 | 
             
                assert File.socket?(@unix_server.path)
         | 
| 101 111 | 
             
                assert_equal @unix_listener_path, sock_name(@unix_server)
         | 
| 102 112 |  | 
| 103 | 
            -
                 | 
| 113 | 
            +
                tcp_listener_socket = Socket.for_fd(@tcp_listener.fileno)
         | 
| 114 | 
            +
                assert Socket === tcp_listener_socket
         | 
| 115 | 
            +
                @tcp_server = server_cast(tcp_listener_socket)
         | 
| 104 116 | 
             
                assert_equal @tcp_listener.fileno, @tcp_server.fileno
         | 
| 105 117 | 
             
                assert TCPServer === @tcp_server
         | 
| 106 118 | 
             
                assert_equal @tcp_listener_name, sock_name(@tcp_server)
         | 
    
        data/unicorn.gemspec
    CHANGED
    
    | @@ -2,17 +2,17 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            Gem::Specification.new do |s|
         | 
| 4 4 | 
             
              s.name = %q{unicorn}
         | 
| 5 | 
            -
              s.version = "0. | 
| 5 | 
            +
              s.version = "0.5.0"
         | 
| 6 6 |  | 
| 7 7 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
         | 
| 8 8 | 
             
              s.authors = ["Eric Wong"]
         | 
| 9 | 
            -
              s.date = %q{2009-04- | 
| 9 | 
            +
              s.date = %q{2009-04-13}
         | 
| 10 10 | 
             
              s.description = %q{A small fast HTTP library and server for Rack applications.}
         | 
| 11 11 | 
             
              s.email = %q{normalperson@yhbt.net}
         | 
| 12 12 | 
             
              s.executables = ["unicorn", "unicorn_rails"]
         | 
| 13 13 | 
             
              s.extensions = ["ext/unicorn/http11/extconf.rb"]
         | 
| 14 14 | 
             
              s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "TODO", "bin/unicorn", "bin/unicorn_rails", "ext/unicorn/http11/ext_help.h", "ext/unicorn/http11/extconf.rb", "ext/unicorn/http11/http11.c", "ext/unicorn/http11/http11_parser.c", "ext/unicorn/http11/http11_parser.h", "ext/unicorn/http11/http11_parser.rl", "ext/unicorn/http11/http11_parser_common.rl", "lib/unicorn.rb", "lib/unicorn/app/exec_cgi.rb", "lib/unicorn/app/old_rails.rb", "lib/unicorn/app/old_rails/static.rb", "lib/unicorn/cgi_wrapper.rb", "lib/unicorn/configurator.rb", "lib/unicorn/const.rb", "lib/unicorn/http_request.rb", "lib/unicorn/http_response.rb", "lib/unicorn/launcher.rb", "lib/unicorn/socket.rb", "lib/unicorn/util.rb"]
         | 
| 15 | 
            -
              s.files = [".document", ".gitignore", "CHANGELOG", "CONTRIBUTORS", "DESIGN", "GNUmakefile", "LICENSE", "Manifest", "PHILOSOPHY", "README", "Rakefile", "SIGNALS", "TODO", "bin/unicorn", "bin/unicorn_rails", "ext/unicorn/http11/ext_help.h", "ext/unicorn/http11/extconf.rb", "ext/unicorn/http11/http11.c", "ext/unicorn/http11/http11_parser.c", "ext/unicorn/http11/http11_parser.h", "ext/unicorn/http11/http11_parser.rl", "ext/unicorn/http11/http11_parser_common.rl", "lib/unicorn.rb", "lib/unicorn/app/exec_cgi.rb", "lib/unicorn/app/old_rails.rb", "lib/unicorn/app/old_rails/static.rb", "lib/unicorn/cgi_wrapper.rb", "lib/unicorn/configurator.rb", "lib/unicorn/const.rb", "lib/unicorn/http_request.rb", "lib/unicorn/http_response.rb", "lib/unicorn/launcher.rb", "lib/unicorn/socket.rb", "lib/unicorn/util.rb", "local.mk.sample", "setup.rb", "test/aggregate.rb", "test/benchmark/README", "test/benchmark/big_request.rb", "test/benchmark/dd.ru", "test/benchmark/request.rb", "test/benchmark/response.rb", "test/exec/README", "test/exec/test_exec.rb", "test/rails/app-1.2.3/.gitignore", "test/rails/app-1.2.3/Rakefile", "test/rails/app-1.2.3/app/controllers/application.rb", "test/rails/app-1.2.3/app/controllers/foo_controller.rb", "test/rails/app-1.2.3/app/helpers/application_helper.rb", "test/rails/app-1.2.3/config/boot.rb", "test/rails/app-1.2.3/config/database.yml", "test/rails/app-1.2.3/config/environment.rb", "test/rails/app-1.2.3/config/environments/development.rb", "test/rails/app-1.2.3/config/environments/production.rb", "test/rails/app-1.2.3/config/routes.rb", "test/rails/app-1.2.3/db/.gitignore", "test/rails/app-1.2.3/log/.gitignore", "test/rails/app-1.2.3/public/404.html", "test/rails/app-1.2.3/public/500.html", "test/rails/app-2.0.2/.gitignore", "test/rails/app-2.0.2/Rakefile", "test/rails/app-2.0.2/app/controllers/application.rb", "test/rails/app-2.0.2/app/controllers/foo_controller.rb", "test/rails/app-2.0.2/app/helpers/application_helper.rb", "test/rails/app-2.0.2/config/boot.rb", "test/rails/app-2.0.2/config/database.yml", "test/rails/app-2.0.2/config/environment.rb", "test/rails/app-2.0.2/config/environments/development.rb", "test/rails/app-2.0.2/config/environments/production.rb", "test/rails/app-2.0.2/config/routes.rb", "test/rails/app-2.0.2/db/.gitignore", "test/rails/app-2.0.2/log/.gitignore", "test/rails/app-2.0.2/public/404.html", "test/rails/app-2.0.2/public/500.html", "test/rails/app-2.1.2/.gitignore", "test/rails/app-2.1.2/Rakefile", "test/rails/app-2.1.2/app/controllers/application.rb", "test/rails/app-2.1.2/app/controllers/foo_controller.rb", "test/rails/app-2.1.2/app/helpers/application_helper.rb", "test/rails/app-2.1.2/config/boot.rb", "test/rails/app-2.1.2/config/database.yml", "test/rails/app-2.1.2/config/environment.rb", "test/rails/app-2.1.2/config/environments/development.rb", "test/rails/app-2.1.2/config/environments/production.rb", "test/rails/app-2.1.2/config/routes.rb", "test/rails/app-2.1.2/db/.gitignore", "test/rails/app-2.1.2/log/.gitignore", "test/rails/app-2.1.2/public/404.html", "test/rails/app-2.1.2/public/500.html", "test/rails/app-2.2.2/.gitignore", "test/rails/app-2.2.2/Rakefile", "test/rails/app-2.2.2/app/controllers/application.rb", "test/rails/app-2.2.2/app/controllers/foo_controller.rb", "test/rails/app-2.2.2/app/helpers/application_helper.rb", "test/rails/app-2.2.2/config/boot.rb", "test/rails/app-2.2.2/config/database.yml", "test/rails/app-2.2.2/config/environment.rb", "test/rails/app-2.2.2/config/environments/development.rb", "test/rails/app-2.2.2/config/environments/production.rb", "test/rails/app-2.2.2/config/routes.rb", "test/rails/app-2.2.2/db/.gitignore", "test/rails/app-2.2.2/log/.gitignore", "test/rails/app-2.2.2/public/404.html", "test/rails/app-2.2.2/public/500.html", "test/rails/app-2.3.2.1/.gitignore", "test/rails/app-2.3.2.1/Rakefile", "test/rails/app-2.3.2.1/app/controllers/application_controller.rb", "test/rails/app-2.3.2.1/app/controllers/foo_controller.rb", "test/rails/app-2.3.2.1/app/helpers/application_helper.rb", "test/rails/app-2.3.2.1/config/boot.rb", "test/rails/app-2.3.2.1/config/database.yml", "test/rails/app-2.3.2.1/config/environment.rb", "test/rails/app-2.3.2.1/config/environments/development.rb", "test/rails/app-2.3.2.1/config/environments/production.rb", "test/rails/app-2.3.2.1/config/routes.rb", "test/rails/app-2.3.2.1/db/.gitignore", "test/rails/app-2.3.2.1/log/.gitignore", "test/rails/app-2.3.2.1/public/404.html", "test/rails/app-2.3.2.1/public/500.html", "test/rails/test_rails.rb", "test/test_helper.rb", "test/tools/trickletest.rb", "test/unit/test_configurator.rb", "test/unit/test_http_parser.rb", "test/unit/test_request.rb", "test/unit/test_response.rb", "test/unit/test_server.rb", "test/unit/test_socket_helper.rb", "test/unit/test_upload.rb", "unicorn.gemspec"]
         | 
| 15 | 
            +
              s.files = [".document", ".gitignore", "CHANGELOG", "CONTRIBUTORS", "DESIGN", "GNUmakefile", "LICENSE", "Manifest", "PHILOSOPHY", "README", "Rakefile", "SIGNALS", "TODO", "bin/unicorn", "bin/unicorn_rails", "ext/unicorn/http11/ext_help.h", "ext/unicorn/http11/extconf.rb", "ext/unicorn/http11/http11.c", "ext/unicorn/http11/http11_parser.c", "ext/unicorn/http11/http11_parser.h", "ext/unicorn/http11/http11_parser.rl", "ext/unicorn/http11/http11_parser_common.rl", "lib/unicorn.rb", "lib/unicorn/app/exec_cgi.rb", "lib/unicorn/app/old_rails.rb", "lib/unicorn/app/old_rails/static.rb", "lib/unicorn/cgi_wrapper.rb", "lib/unicorn/configurator.rb", "lib/unicorn/const.rb", "lib/unicorn/http_request.rb", "lib/unicorn/http_response.rb", "lib/unicorn/launcher.rb", "lib/unicorn/socket.rb", "lib/unicorn/util.rb", "local.mk.sample", "setup.rb", "test/aggregate.rb", "test/benchmark/README", "test/benchmark/big_request.rb", "test/benchmark/dd.ru", "test/benchmark/request.rb", "test/benchmark/response.rb", "test/exec/README", "test/exec/test_exec.rb", "test/rails/app-1.2.3/.gitignore", "test/rails/app-1.2.3/Rakefile", "test/rails/app-1.2.3/app/controllers/application.rb", "test/rails/app-1.2.3/app/controllers/foo_controller.rb", "test/rails/app-1.2.3/app/helpers/application_helper.rb", "test/rails/app-1.2.3/config/boot.rb", "test/rails/app-1.2.3/config/database.yml", "test/rails/app-1.2.3/config/environment.rb", "test/rails/app-1.2.3/config/environments/development.rb", "test/rails/app-1.2.3/config/environments/production.rb", "test/rails/app-1.2.3/config/routes.rb", "test/rails/app-1.2.3/db/.gitignore", "test/rails/app-1.2.3/log/.gitignore", "test/rails/app-1.2.3/public/404.html", "test/rails/app-1.2.3/public/500.html", "test/rails/app-2.0.2/.gitignore", "test/rails/app-2.0.2/Rakefile", "test/rails/app-2.0.2/app/controllers/application.rb", "test/rails/app-2.0.2/app/controllers/foo_controller.rb", "test/rails/app-2.0.2/app/helpers/application_helper.rb", "test/rails/app-2.0.2/config/boot.rb", "test/rails/app-2.0.2/config/database.yml", "test/rails/app-2.0.2/config/environment.rb", "test/rails/app-2.0.2/config/environments/development.rb", "test/rails/app-2.0.2/config/environments/production.rb", "test/rails/app-2.0.2/config/routes.rb", "test/rails/app-2.0.2/db/.gitignore", "test/rails/app-2.0.2/log/.gitignore", "test/rails/app-2.0.2/public/404.html", "test/rails/app-2.0.2/public/500.html", "test/rails/app-2.1.2/.gitignore", "test/rails/app-2.1.2/Rakefile", "test/rails/app-2.1.2/app/controllers/application.rb", "test/rails/app-2.1.2/app/controllers/foo_controller.rb", "test/rails/app-2.1.2/app/helpers/application_helper.rb", "test/rails/app-2.1.2/config/boot.rb", "test/rails/app-2.1.2/config/database.yml", "test/rails/app-2.1.2/config/environment.rb", "test/rails/app-2.1.2/config/environments/development.rb", "test/rails/app-2.1.2/config/environments/production.rb", "test/rails/app-2.1.2/config/routes.rb", "test/rails/app-2.1.2/db/.gitignore", "test/rails/app-2.1.2/log/.gitignore", "test/rails/app-2.1.2/public/404.html", "test/rails/app-2.1.2/public/500.html", "test/rails/app-2.2.2/.gitignore", "test/rails/app-2.2.2/Rakefile", "test/rails/app-2.2.2/app/controllers/application.rb", "test/rails/app-2.2.2/app/controllers/foo_controller.rb", "test/rails/app-2.2.2/app/helpers/application_helper.rb", "test/rails/app-2.2.2/config/boot.rb", "test/rails/app-2.2.2/config/database.yml", "test/rails/app-2.2.2/config/environment.rb", "test/rails/app-2.2.2/config/environments/development.rb", "test/rails/app-2.2.2/config/environments/production.rb", "test/rails/app-2.2.2/config/routes.rb", "test/rails/app-2.2.2/db/.gitignore", "test/rails/app-2.2.2/log/.gitignore", "test/rails/app-2.2.2/public/404.html", "test/rails/app-2.2.2/public/500.html", "test/rails/app-2.3.2.1/.gitignore", "test/rails/app-2.3.2.1/Rakefile", "test/rails/app-2.3.2.1/app/controllers/application_controller.rb", "test/rails/app-2.3.2.1/app/controllers/foo_controller.rb", "test/rails/app-2.3.2.1/app/helpers/application_helper.rb", "test/rails/app-2.3.2.1/config/boot.rb", "test/rails/app-2.3.2.1/config/database.yml", "test/rails/app-2.3.2.1/config/environment.rb", "test/rails/app-2.3.2.1/config/environments/development.rb", "test/rails/app-2.3.2.1/config/environments/production.rb", "test/rails/app-2.3.2.1/config/routes.rb", "test/rails/app-2.3.2.1/db/.gitignore", "test/rails/app-2.3.2.1/log/.gitignore", "test/rails/app-2.3.2.1/public/404.html", "test/rails/app-2.3.2.1/public/500.html", "test/rails/test_rails.rb", "test/test_helper.rb", "test/tools/trickletest.rb", "test/unit/test_configurator.rb", "test/unit/test_http_parser.rb", "test/unit/test_request.rb", "test/unit/test_response.rb", "test/unit/test_server.rb", "test/unit/test_socket_helper.rb", "test/unit/test_upload.rb", "unicorn.gemspec", "test/unit/test_signals.rb"]
         | 
| 16 16 | 
             
              s.has_rdoc = true
         | 
| 17 17 | 
             
              s.homepage = %q{http://unicorn.bogomips.org}
         | 
| 18 18 | 
             
              s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Unicorn", "--main", "README"]
         | 
| @@ -20,7 +20,7 @@ Gem::Specification.new do |s| | |
| 20 20 | 
             
              s.rubyforge_project = %q{unicorn}
         | 
| 21 21 | 
             
              s.rubygems_version = %q{1.3.1}
         | 
| 22 22 | 
             
              s.summary = %q{A small fast HTTP library and server for Rack applications.}
         | 
| 23 | 
            -
              s.test_files = ["test/unit/test_configurator.rb", "test/unit/test_response.rb", "test/unit/test_request.rb", "test/unit/test_upload.rb", "test/unit/test_http_parser.rb", "test/unit/test_socket_helper.rb", "test/unit/test_server.rb"]
         | 
| 23 | 
            +
              s.test_files = ["test/unit/test_configurator.rb", "test/unit/test_response.rb", "test/unit/test_request.rb", "test/unit/test_signals.rb", "test/unit/test_upload.rb", "test/unit/test_http_parser.rb", "test/unit/test_socket_helper.rb", "test/unit/test_server.rb"]
         | 
| 24 24 |  | 
| 25 25 | 
             
              if s.respond_to? :specification_version then
         | 
| 26 26 | 
             
                current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: unicorn
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.5.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors: 
         | 
| 7 7 | 
             
            - Eric Wong
         | 
| @@ -9,7 +9,7 @@ autorequire: | |
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 11 |  | 
| 12 | 
            -
            date: 2009-04- | 
| 12 | 
            +
            date: 2009-04-13 00:00:00 -07:00
         | 
| 13 13 | 
             
            default_executable: 
         | 
| 14 14 | 
             
            dependencies: []
         | 
| 15 15 |  | 
| @@ -213,6 +213,7 @@ test_files: | |
| 213 213 | 
             
            - test/unit/test_configurator.rb
         | 
| 214 214 | 
             
            - test/unit/test_response.rb
         | 
| 215 215 | 
             
            - test/unit/test_request.rb
         | 
| 216 | 
            +
            - test/unit/test_signals.rb
         | 
| 216 217 | 
             
            - test/unit/test_upload.rb
         | 
| 217 218 | 
             
            - test/unit/test_http_parser.rb
         | 
| 218 219 | 
             
            - test/unit/test_socket_helper.rb
         |