unicorn 5.4.0 → 5.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.manifest +7 -3
  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 +16 -6
  12. data/HACKING +1 -1
  13. data/ISSUES +17 -22
  14. data/KNOWN_ISSUES +2 -2
  15. data/LATEST +18 -8
  16. data/LICENSE +2 -2
  17. data/Links +13 -11
  18. data/NEWS +94 -0
  19. data/README +18 -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 +30 -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 -2
  39. data/lib/unicorn/http_server.rb +50 -23
  40. data/lib/unicorn/launcher.rb +1 -1
  41. data/lib/unicorn/oob_gc.rb +2 -2
  42. data/lib/unicorn/socket_helper.rb +3 -2
  43. data/lib/unicorn/tmpio.rb +8 -2
  44. data/lib/unicorn/util.rb +3 -3
  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 +88 -85
  49. data/man/man1/unicorn_rails.1 +79 -81
  50. data/t/README +4 -4
  51. data/t/t0301-no-default-middleware-ignored-in-config.sh +25 -0
  52. data/t/t0301.ru +13 -0
  53. data/test/benchmark/README +14 -4
  54. data/test/benchmark/ddstream.ru +50 -0
  55. data/test/benchmark/readinput.ru +40 -0
  56. data/test/benchmark/uconnect.perl +66 -0
  57. data/test/exec/test_exec.rb +15 -14
  58. data/test/test_helper.rb +0 -26
  59. data/test/unit/test_ccc.rb +1 -1
  60. data/test/unit/test_http_parser.rb +16 -0
  61. data/test/unit/test_http_parser_ng.rb +81 -0
  62. data/test/unit/test_server.rb +35 -5
  63. data/test/unit/test_signals.rb +2 -2
  64. data/test/unit/test_socket_helper.rb +4 -4
  65. data/test/unit/test_upload.rb +4 -9
  66. data/test/unit/test_util.rb +25 -0
  67. data/unicorn.gemspec +3 -3
  68. metadata +13 -9
  69. data/Documentation/GNUmakefile +0 -30
  70. data/Documentation/unicorn.1.txt +0 -187
  71. data/Documentation/unicorn_rails.1.txt +0 -175
@@ -8,4 +8,34 @@ have_func("rb_str_set_len", "ruby.h") or abort 'Ruby 1.9.3+ required'
8
8
  have_func("rb_hash_clear", "ruby.h") # Ruby 2.0+
9
9
  have_func("gmtime_r", "time.h")
10
10
 
11
+ message('checking if String#-@ (str_uminus) dedupes... ')
12
+ begin
13
+ a = -(%w(t e s t).join)
14
+ b = -(%w(t e s t).join)
15
+ if a.equal?(b)
16
+ $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=1 '
17
+ message("yes\n")
18
+ else
19
+ $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=0 '
20
+ message("no, needs Ruby 2.5+\n")
21
+ end
22
+ rescue NoMethodError
23
+ $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=0 '
24
+ message("no, String#-@ not available\n")
25
+ end
26
+
27
+ message('checking if Hash#[]= (rb_hash_aset) dedupes... ')
28
+ h = {}
29
+ x = {}
30
+ r = rand.to_s
31
+ h[%W(#{r}).join('')] = :foo
32
+ x[%W(#{r}).join('')] = :foo
33
+ if x.keys[0].equal?(h.keys[0])
34
+ $CPPFLAGS += ' -DHASH_ASET_DEDUPE=1 '
35
+ message("yes\n")
36
+ else
37
+ $CPPFLAGS += ' -DHASH_ASET_DEDUPE=0 '
38
+ message("no, needs Ruby 2.6+\n")
39
+ end
40
+
11
41
  create_makefile("unicorn_http")
@@ -56,7 +56,7 @@ NORETURN(static void parser_raise(VALUE klass, const char *));
56
56
  /** Defines global strings in the init method. */
57
57
  #define DEF_GLOBAL(N, val) do { \
58
58
  g_##N = rb_obj_freeze(rb_str_new(val, sizeof(val) - 1)); \
59
- rb_ary_push(mark_ary, g_##N); \
59
+ rb_gc_register_mark_object(g_##N); \
60
60
  } while (0)
61
61
 
62
62
  /* Defines the maximum allowed lengths for various input elements.*/
@@ -67,7 +67,7 @@ DEF_MAX_LENGTH(FRAGMENT, 1024); /* Don't know if this length is specified somewh
67
67
  DEF_MAX_LENGTH(REQUEST_PATH, 4096); /* common PATH_MAX on modern systems */
68
68
  DEF_MAX_LENGTH(QUERY_STRING, (1024 * 10));
69
69
 
70
- static void init_globals(VALUE mark_ary)
70
+ static void init_globals(void)
71
71
  {
72
72
  DEF_GLOBAL(rack_url_scheme, "rack.url_scheme");
73
73
  DEF_GLOBAL(request_method, "REQUEST_METHOD");
@@ -64,13 +64,13 @@ static VALUE httpdate(VALUE self)
64
64
  return buf;
65
65
  }
66
66
 
67
- void init_unicorn_httpdate(VALUE mark_ary)
67
+ void init_unicorn_httpdate(void)
68
68
  {
69
69
  VALUE mod = rb_define_module("Unicorn");
70
70
  mod = rb_define_module_under(mod, "HttpResponse");
71
71
 
72
72
  buf = rb_str_new(0, buf_capa - 1);
73
- rb_ary_push(mark_ary, buf);
73
+ rb_gc_register_mark_object(buf);
74
74
  buf_ptr = RSTRING_PTR(buf);
75
75
  httpdate(Qnil);
76
76