unicorn 5.4.1 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.manifest +7 -5
  3. data/.olddoc.yml +12 -7
  4. data/Application_Timeouts +4 -4
  5. data/Documentation/.gitignore +1 -3
  6. data/Documentation/unicorn.1 +222 -0
  7. data/Documentation/unicorn_rails.1 +207 -0
  8. data/FAQ +1 -1
  9. data/GIT-VERSION-FILE +1 -1
  10. data/GIT-VERSION-GEN +1 -1
  11. data/GNUmakefile +112 -57
  12. data/HACKING +1 -1
  13. data/ISSUES +21 -23
  14. data/KNOWN_ISSUES +2 -2
  15. data/LATEST +22 -28
  16. data/LICENSE +2 -2
  17. data/Links +13 -11
  18. data/NEWS +65 -0
  19. data/README +25 -11
  20. data/SIGNALS +1 -1
  21. data/Sandbox +4 -4
  22. data/archive/slrnpull.conf +1 -1
  23. data/bin/unicorn +3 -1
  24. data/bin/unicorn_rails +2 -2
  25. data/examples/big_app_gc.rb +1 -1
  26. data/examples/logrotate.conf +3 -3
  27. data/examples/nginx.conf +4 -3
  28. data/examples/unicorn.conf.minimal.rb +2 -2
  29. data/examples/unicorn.conf.rb +2 -2
  30. data/examples/unicorn@.service +7 -0
  31. data/ext/unicorn_http/common_field_optimization.h +24 -6
  32. data/ext/unicorn_http/extconf.rb +35 -0
  33. data/ext/unicorn_http/global_variables.h +2 -2
  34. data/ext/unicorn_http/httpdate.c +2 -2
  35. data/ext/unicorn_http/unicorn_http.c +257 -224
  36. data/ext/unicorn_http/unicorn_http.rl +47 -14
  37. data/lib/unicorn/configurator.rb +25 -4
  38. data/lib/unicorn/http_request.rb +12 -3
  39. data/lib/unicorn/http_server.rb +43 -12
  40. data/lib/unicorn/launcher.rb +1 -1
  41. data/lib/unicorn/oob_gc.rb +5 -5
  42. data/lib/unicorn/socket_helper.rb +1 -0
  43. data/lib/unicorn/tmpio.rb +8 -2
  44. data/lib/unicorn/util.rb +1 -1
  45. data/lib/unicorn/version.rb +1 -1
  46. data/lib/unicorn/worker.rb +16 -2
  47. data/lib/unicorn.rb +23 -9
  48. data/man/man1/unicorn.1 +89 -88
  49. data/man/man1/unicorn_rails.1 +78 -83
  50. data/t/GNUmakefile +3 -72
  51. data/t/README +4 -4
  52. data/t/t0301-no-default-middleware-ignored-in-config.sh +25 -0
  53. data/t/t0301.ru +13 -0
  54. data/test/benchmark/README +14 -4
  55. data/test/benchmark/ddstream.ru +50 -0
  56. data/test/benchmark/readinput.ru +40 -0
  57. data/test/benchmark/uconnect.perl +66 -0
  58. data/test/exec/test_exec.rb +14 -12
  59. data/test/test_helper.rb +38 -30
  60. data/test/unit/test_ccc.rb +4 -3
  61. data/test/unit/test_http_parser.rb +16 -0
  62. data/test/unit/test_http_parser_ng.rb +81 -0
  63. data/test/unit/test_server.rb +81 -7
  64. data/test/unit/test_signals.rb +6 -6
  65. data/test/unit/test_socket_helper.rb +1 -1
  66. data/test/unit/test_upload.rb +9 -14
  67. data/test/unit/test_util.rb +25 -0
  68. data/unicorn.gemspec +8 -7
  69. metadata +15 -13
  70. data/Documentation/GNUmakefile +0 -30
  71. data/Documentation/unicorn.1.txt +0 -187
  72. data/Documentation/unicorn_rails.1.txt +0 -175
  73. data/t/hijack.ru +0 -55
  74. data/t/t0200-rack-hijack.sh +0 -51
data/t/hijack.ru DELETED
@@ -1,55 +0,0 @@
1
- use Rack::Lint
2
- use Rack::ContentLength
3
- use Rack::ContentType, "text/plain"
4
- class DieIfUsed
5
- @@n = 0
6
- def each
7
- abort "body.each called after response hijack\n"
8
- end
9
-
10
- def close
11
- warn "closed DieIfUsed #{@@n += 1}\n"
12
- end
13
- end
14
-
15
- envs = []
16
-
17
- run lambda { |env|
18
- case env["PATH_INFO"]
19
- when "/hijack_req"
20
- if env["rack.hijack?"]
21
- io = env["rack.hijack"].call
22
- envs << env
23
- if io.respond_to?(:read_nonblock) &&
24
- env["rack.hijack_io"].respond_to?(:read_nonblock)
25
-
26
- # exercise both, since we Rack::Lint may use different objects
27
- env["rack.hijack_io"].write("HTTP/1.0 200 OK\r\n\r\n")
28
- io.write("request.hijacked")
29
- io.close
30
- return [ 500, {}, DieIfUsed.new ]
31
- end
32
- end
33
- [ 500, {}, [ "hijack BAD\n" ] ]
34
- when "/hijack_res"
35
- r = "response.hijacked"
36
- [ 200,
37
- {
38
- "Content-Length" => r.bytesize.to_s,
39
- "rack.hijack" => proc do |io|
40
- envs << env
41
- io.write(r)
42
- io.close
43
- end
44
- },
45
- DieIfUsed.new
46
- ]
47
- when "/normal_env_id"
48
- b = "#{env.object_id}\n"
49
- h = {
50
- 'Content-Type' => 'text/plain',
51
- 'Content-Length' => b.bytesize.to_s,
52
- }
53
- [ 200, h, [ b ] ]
54
- end
55
- }
@@ -1,51 +0,0 @@
1
- #!/bin/sh
2
- . ./test-lib.sh
3
- t_plan 9 "rack.hijack tests (Rack 1.5+ (Rack::VERSION >= [ 1,2]))"
4
-
5
- t_begin "setup and start" && {
6
- unicorn_setup
7
- unicorn -D -c $unicorn_config hijack.ru
8
- unicorn_wait_start
9
- }
10
-
11
- t_begin "normal env reused between requests" && {
12
- env_a="$(curl -sSf http://$listen/normal_env_id)"
13
- b="$(curl -sSf http://$listen/normal_env_id)"
14
- test x"$env_a" = x"$b"
15
- }
16
-
17
- t_begin "check request hijack" && {
18
- test "xrequest.hijacked" = x"$(curl -sSfv http://$listen/hijack_req)"
19
- }
20
-
21
- t_begin "env changed after request hijack" && {
22
- env_b="$(curl -sSf http://$listen/normal_env_id)"
23
- test x"$env_a" != x"$env_b"
24
- }
25
-
26
- t_begin "check response hijack" && {
27
- test "xresponse.hijacked" = x"$(curl -sSfv http://$listen/hijack_res)"
28
- }
29
-
30
- t_begin "env changed after response hijack" && {
31
- env_c="$(curl -sSf http://$listen/normal_env_id)"
32
- test x"$env_b" != x"$env_c"
33
- }
34
-
35
- t_begin "env continues to be reused between requests" && {
36
- b="$(curl -sSf http://$listen/normal_env_id)"
37
- test x"$env_c" = x"$b"
38
- }
39
-
40
- t_begin "killing succeeds after hijack" && {
41
- kill $unicorn_pid
42
- }
43
-
44
- t_begin "check stderr for hijacked body close" && {
45
- check_stderr
46
- grep 'closed DieIfUsed 1\>' $r_err
47
- grep 'closed DieIfUsed 2\>' $r_err
48
- ! grep 'closed DieIfUsed 3\>' $r_err
49
- }
50
-
51
- t_done