puma 2.0.0.b5 → 5.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puma might be problematic. Click here for more details.

Files changed (106) hide show
  1. checksums.yaml +7 -0
  2. data/History.md +1598 -0
  3. data/LICENSE +23 -20
  4. data/README.md +222 -62
  5. data/bin/puma-wild +31 -0
  6. data/bin/pumactl +1 -1
  7. data/docs/architecture.md +37 -0
  8. data/docs/deployment.md +113 -0
  9. data/docs/fork_worker.md +31 -0
  10. data/docs/images/puma-connection-flow-no-reactor.png +0 -0
  11. data/docs/images/puma-connection-flow.png +0 -0
  12. data/docs/images/puma-general-arch.png +0 -0
  13. data/docs/jungle/README.md +13 -0
  14. data/docs/jungle/rc.d/README.md +74 -0
  15. data/docs/jungle/rc.d/puma +61 -0
  16. data/docs/jungle/rc.d/puma.conf +10 -0
  17. data/docs/jungle/upstart/README.md +61 -0
  18. data/docs/jungle/upstart/puma-manager.conf +31 -0
  19. data/docs/jungle/upstart/puma.conf +69 -0
  20. data/docs/nginx.md +5 -10
  21. data/docs/plugins.md +38 -0
  22. data/docs/restart.md +41 -0
  23. data/docs/signals.md +97 -0
  24. data/docs/systemd.md +228 -0
  25. data/ext/puma_http11/PumaHttp11Service.java +2 -2
  26. data/ext/puma_http11/extconf.rb +23 -2
  27. data/ext/puma_http11/http11_parser.c +301 -482
  28. data/ext/puma_http11/http11_parser.h +13 -11
  29. data/ext/puma_http11/http11_parser.java.rl +26 -42
  30. data/ext/puma_http11/http11_parser.rl +22 -21
  31. data/ext/puma_http11/http11_parser_common.rl +5 -5
  32. data/ext/puma_http11/mini_ssl.c +377 -18
  33. data/ext/puma_http11/org/jruby/puma/Http11.java +108 -107
  34. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +137 -170
  35. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +265 -191
  36. data/ext/puma_http11/puma_http11.c +57 -81
  37. data/lib/puma.rb +25 -4
  38. data/lib/puma/accept_nonblock.rb +7 -1
  39. data/lib/puma/app/status.rb +61 -24
  40. data/lib/puma/binder.rb +212 -78
  41. data/lib/puma/cli.rb +149 -644
  42. data/lib/puma/client.rb +316 -65
  43. data/lib/puma/cluster.rb +659 -0
  44. data/lib/puma/commonlogger.rb +108 -0
  45. data/lib/puma/configuration.rb +279 -180
  46. data/lib/puma/const.rb +126 -39
  47. data/lib/puma/control_cli.rb +183 -96
  48. data/lib/puma/detect.rb +20 -1
  49. data/lib/puma/dsl.rb +776 -0
  50. data/lib/puma/events.rb +91 -23
  51. data/lib/puma/io_buffer.rb +9 -5
  52. data/lib/puma/jruby_restart.rb +9 -5
  53. data/lib/puma/launcher.rb +487 -0
  54. data/lib/puma/minissl.rb +239 -93
  55. data/lib/puma/minissl/context_builder.rb +76 -0
  56. data/lib/puma/null_io.rb +22 -12
  57. data/lib/puma/plugin.rb +111 -0
  58. data/lib/puma/plugin/tmp_restart.rb +36 -0
  59. data/lib/puma/rack/builder.rb +297 -0
  60. data/lib/puma/rack/urlmap.rb +93 -0
  61. data/lib/puma/rack_default.rb +9 -0
  62. data/lib/puma/reactor.rb +290 -43
  63. data/lib/puma/runner.rb +163 -0
  64. data/lib/puma/server.rb +493 -126
  65. data/lib/puma/single.rb +66 -0
  66. data/lib/puma/state_file.rb +34 -0
  67. data/lib/puma/thread_pool.rb +228 -47
  68. data/lib/puma/util.rb +115 -0
  69. data/lib/rack/handler/puma.rb +78 -31
  70. data/tools/Dockerfile +16 -0
  71. data/tools/trickletest.rb +44 -0
  72. metadata +60 -155
  73. data/COPYING +0 -55
  74. data/Gemfile +0 -8
  75. data/History.txt +0 -196
  76. data/Manifest.txt +0 -56
  77. data/Rakefile +0 -121
  78. data/TODO +0 -5
  79. data/docs/config.md +0 -0
  80. data/ext/puma_http11/io_buffer.c +0 -154
  81. data/lib/puma/capistrano.rb +0 -26
  82. data/lib/puma/compat.rb +0 -11
  83. data/lib/puma/daemon_ext.rb +0 -20
  84. data/lib/puma/delegation.rb +0 -11
  85. data/lib/puma/java_io_buffer.rb +0 -45
  86. data/lib/puma/rack_patch.rb +0 -25
  87. data/puma.gemspec +0 -45
  88. data/test/test_app_status.rb +0 -88
  89. data/test/test_cli.rb +0 -171
  90. data/test/test_config.rb +0 -16
  91. data/test/test_http10.rb +0 -27
  92. data/test/test_http11.rb +0 -126
  93. data/test/test_integration.rb +0 -150
  94. data/test/test_iobuffer.rb +0 -38
  95. data/test/test_minissl.rb +0 -22
  96. data/test/test_null_io.rb +0 -31
  97. data/test/test_persistent.rb +0 -238
  98. data/test/test_puma_server.rb +0 -128
  99. data/test/test_rack_handler.rb +0 -10
  100. data/test/test_rack_server.rb +0 -141
  101. data/test/test_thread_pool.rb +0 -146
  102. data/test/test_unix_socket.rb +0 -39
  103. data/test/test_ws.rb +0 -89
  104. data/tools/jungle/README.md +0 -54
  105. data/tools/jungle/puma +0 -332
  106. data/tools/jungle/run-puma +0 -3
data/COPYING DELETED
@@ -1,55 +0,0 @@
1
- Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw
2
- <zedshaw at zedshaw dot com> You can redistribute it and/or modify it under
3
- either the terms of the GPL or the conditions below:
4
-
5
- 1. You may make and give away verbatim copies of the source form of the
6
- software without restriction, provided that you duplicate all of the
7
- original copyright notices and associated disclaimers.
8
-
9
- 2. You may modify your copy of the software in any way, provided that
10
- you do at least ONE of the following:
11
-
12
- a) place your modifications in the Public Domain or otherwise make them
13
- Freely Available, such as by posting said modifications to Usenet or an
14
- equivalent medium, or by allowing the author to include your
15
- modifications in the software.
16
-
17
- b) use the modified software only within your corporation or
18
- organization.
19
-
20
- c) rename any non-standard executables so the names do not conflict with
21
- standard executables, which must also be provided.
22
-
23
- d) make other distribution arrangements with the author.
24
-
25
- 3. You may distribute the software in object code or executable
26
- form, provided that you do at least ONE of the following:
27
-
28
- a) distribute the executables and library files of the software,
29
- together with instructions (in the manual page or equivalent) on where
30
- to get the original distribution.
31
-
32
- b) accompany the distribution with the machine-readable source of the
33
- software.
34
-
35
- c) give non-standard executables non-standard names, with
36
- instructions on where to get the original software distribution.
37
-
38
- d) make other distribution arrangements with the author.
39
-
40
- 4. You may modify and include the part of the software into any other
41
- software (possibly commercial). But some files in the distribution
42
- are not written by the author, so that they are not under this terms.
43
-
44
- 5. The scripts and library files supplied as input to or produced as
45
- output from the software do not automatically fall under the
46
- copyright of the software, but belong to whomever generated them,
47
- and may be sold commercially, and may be aggregated with this
48
- software.
49
-
50
- 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
51
- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
52
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
53
- PURPOSE.
54
-
55
-
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- gem "hoe"
4
- gem "rdoc"
5
- gem "rake-compiler"
6
- gem "rack"
7
-
8
- gem "jruby-openssl", :platform => "jruby"
@@ -1,196 +0,0 @@
1
- === 2.0.0.b5 / 2013-02-05
2
-
3
- * 2 major features:
4
- * Add phased worker upgrade
5
- * Add support for the rack hijack protocol
6
-
7
- * 2 minor features:
8
- * Add -R to specify the restart command
9
- * Add config file option to specify the restart command
10
-
11
- * 5 bug fixes:
12
- * Cleanup pipes properly. Fixes #182
13
- * Daemonize earlier so that we don't lose app threads. Fixes #183
14
- * Drain the notification pipe. Fixes #176, thanks @cryo28
15
- * Move write_pid to after we daemonize. Fixes #180
16
- * Redirect IO properly and emit message for checkpointing
17
-
18
- === 2.0.0.b4 / 2012-12-12
19
-
20
- * 4 bug fixes:
21
- * Properly check #syswrite's value for variable sized buffers. Fixes #170
22
- * Shutdown status server properly
23
- * Handle char vs byte and mixing syswrite with write properly
24
- * made MiniSSL validate key/cert file existence
25
-
26
- === 2.0.0.b3 / 2012-11-22
27
-
28
- * 1 bug fix:
29
- * Package right files in gem
30
-
31
- === 2.0.0.b2 / 2012-11-18
32
- * 5 minor feature:
33
- * Now Puma is bundled with an capistrano recipe. Just require
34
- 'puma/capistrano' in you deploy.rb
35
- * Only inject CommonLogger in development mode
36
- * Add -p option to pumactl
37
- * Add ability to use pumactl to start a server
38
- * Add options to daemonize puma
39
-
40
- * 7 bug fixes:
41
- * Reset the IOBuffer properly. Fixes #148
42
- * Shutdown gracefully on JRuby with Ctrl-C
43
- * Various methods to get newrelic to start. Fixes #128
44
- * fixing syntax error at capistrano recipe
45
- * Force ECONNRESET when read returns nil
46
- * Be sure to empty the drain the todo before shutting down. Fixes #155
47
- * allow for alternate locations for status app
48
-
49
- === 2.0.0.b1 / 2012-09-11
50
-
51
- * 1 major feature:
52
- * Optional worker process mode (-w) to allow for process scaling in
53
- addition to thread scaling
54
-
55
- * 1 bug fix:
56
- * Introduce Puma::MiniSSL to be able to properly control doing
57
- nonblocking SSL
58
-
59
- NOTE: SSL support in JRuby is not supported at present. Support will
60
- be added back in a future date when a java Puma::MiniSSL is added.
61
-
62
- === 1.6.3 / 2012-09-04
63
-
64
- * 1 bug fix:
65
- * Close sockets waiting in the reactor when a hot restart is performed
66
- so that browsers reconnect on the next request
67
-
68
- === 1.6.2 / 2012-08-27
69
-
70
- * 1 bug fix:
71
- * Rescue StandardError instead of IOError to handle SystemCallErrors
72
- as well as other application exceptions inside the reactor.
73
-
74
- === 1.6.1 / 2012-07-23
75
-
76
- * 1 packaging bug fixed:
77
- * Include missing files
78
-
79
- === 1.6.0 / 2012-07-23
80
-
81
- * 1 major bug fix:
82
- * Prevent slow clients from starving the server by introducing a
83
- dedicated IO reactor thread. Credit for reporting goes to @meh.
84
-
85
- === 1.5.0 / 2012-07-19
86
-
87
- * 7 contributers to this release:
88
- * Christian Mayer
89
- * Darío Javier Cravero
90
- * Dirkjan Bussink
91
- * Gianluca Padovani
92
- * Santiago Pastorino
93
- * Thibault Jouan
94
- * tomykaira
95
-
96
- * 6 bug fixes:
97
- * Define RSTRING_NOT_MODIFIED for Rubinius
98
- * Convert status to integer. Fixes #123
99
- * Delete pidfile when stopping the server
100
- * Allow compilation with -Werror=format-security option
101
- * Fix wrong HTTP version for a HTTP/1.0 request
102
- * Use String#bytesize instead of String#length
103
-
104
- * 3 minor features:
105
- * Added support for setting RACK_ENV via the CLI, config file, and rack app
106
- * Allow Server#run to run sync. Fixes #111
107
- * Puma can now run on windows
108
-
109
- === 1.4.0 / 2012-06-04
110
-
111
- * 1 bug fix:
112
- * SCRIPT_NAME should be passed from env to allow mounting apps
113
-
114
- * 1 experimental feature:
115
- * Add puma.socket key for direct socket access
116
-
117
- === 1.3.1 / 2012-05-15
118
-
119
- * 2 bug fixes:
120
- * use #bytesize instead of #length for Content-Length header
121
- * Use StringIO properly. Fixes #98
122
-
123
- === 1.3.0 / 2012-05-08
124
-
125
- * 2 minor features:
126
- * Return valid Rack responses (passes Lint) from status server
127
- * Add -I option to specify $LOAD_PATH directories
128
-
129
- * 4 bug fixes:
130
- * Don't join the server thread inside the signal handle. Fixes #94
131
- * Make NullIO#read mimic IO#read
132
- * Only stop the status server if it's started. Fixes #84
133
- * Set RACK_ENV early in cli also. Fixes #78
134
-
135
- * 1 new contributer:
136
- * Jesse Cooke
137
-
138
- === 1.2.2 / 2012-04-28
139
-
140
- * 4 bug fixes:
141
-
142
- * Report a lowlevel error to stderr
143
- * Set a fallback SERVER_NAME and SERVER_PORT
144
- * Keep the encoding of the body correct. Fixes #79
145
- * show error.to_s along with backtrace for low-level error
146
-
147
- === 1.2.1 / 2012-04-11
148
-
149
- 1 bug fix:
150
-
151
- * Fix rack.url_scheme for SSL servers. Fixes #65
152
-
153
- === 1.2.0 / 2012-04-11
154
-
155
- 1 major feature:
156
-
157
- * When possible, the internal restart does a "hot restart" meaning
158
- the server sockets remains open, so no connections are lost.
159
-
160
- 1 minor feature:
161
-
162
- * More helpful fallback error message
163
-
164
- 6 bug fixes:
165
-
166
- * Pass the proper args to unknown_error. Fixes #54, #58
167
- * Stop the control server before restarting. Fixes #61
168
- * Fix reporting https only on a true SSL connection
169
- * Set the default content type to 'text/plain'. Fixes #63
170
- * Use REUSEADDR. Fixes #60
171
- * Shutdown gracefull on SIGTERM. Fixes #53
172
-
173
- 2 new contributers:
174
-
175
- * Seamus Abshere
176
- * Steve Richert
177
-
178
- === 1.1.1 / 2012-03-30
179
-
180
- 1 bugfix:
181
-
182
- * Include puma/compat.rb in the gem (oops!)
183
-
184
- === 1.1.0 / 2012-03-30
185
-
186
- 1 bugfix:
187
-
188
- * Make sure that the unix socket has the perms 0777 by default
189
-
190
- 1 minor feature:
191
-
192
- * Add umask param to the unix:// bind to set the umask
193
-
194
- === 1.0.0 / 2012-03-29
195
-
196
- * Released!
@@ -1,56 +0,0 @@
1
- COPYING
2
- Gemfile
3
- History.txt
4
- LICENSE
5
- Manifest.txt
6
- README.md
7
- Rakefile
8
- TODO
9
- bin/puma
10
- bin/pumactl
11
- docs/config.md
12
- docs/nginx.md
13
- ext/puma_http11/PumaHttp11Service.java
14
- ext/puma_http11/ext_help.h
15
- ext/puma_http11/extconf.rb
16
- ext/puma_http11/http11_parser.c
17
- ext/puma_http11/http11_parser.h
18
- ext/puma_http11/http11_parser.java.rl
19
- ext/puma_http11/http11_parser.rl
20
- ext/puma_http11/http11_parser_common.rl
21
- ext/puma_http11/io_buffer.c
22
- ext/puma_http11/mini_ssl.c
23
- ext/puma_http11/org/jruby/puma/Http11.java
24
- ext/puma_http11/org/jruby/puma/Http11Parser.java
25
- ext/puma_http11/org/jruby/puma/MiniSSL.java
26
- ext/puma_http11/puma_http11.c
27
- lib/puma.rb
28
- lib/puma/accept_nonblock.rb
29
- lib/puma/app/status.rb
30
- lib/puma/binder.rb
31
- lib/puma/capistrano.rb
32
- lib/puma/cli.rb
33
- lib/puma/client.rb
34
- lib/puma/compat.rb
35
- lib/puma/configuration.rb
36
- lib/puma/const.rb
37
- lib/puma/control_cli.rb
38
- lib/puma/daemon_ext.rb
39
- lib/puma/delegation.rb
40
- lib/puma/detect.rb
41
- lib/puma/events.rb
42
- lib/puma/io_buffer.rb
43
- lib/puma/java_io_buffer.rb
44
- lib/puma/jruby_restart.rb
45
- lib/puma/minissl.rb
46
- lib/puma/null_io.rb
47
- lib/puma/rack_patch.rb
48
- lib/puma/reactor.rb
49
- lib/puma/server.rb
50
- lib/puma/thread_pool.rb
51
- lib/puma/util.rb
52
- lib/rack/handler/puma.rb
53
- puma.gemspec
54
- tools/jungle/README.md
55
- tools/jungle/puma
56
- tools/jungle/run-puma
data/Rakefile DELETED
@@ -1,121 +0,0 @@
1
- require "hoe"
2
- require "rake/extensiontask"
3
- require "rake/javaextensiontask"
4
-
5
- IS_JRUBY = defined?(RUBY_ENGINE) ? RUBY_ENGINE == "jruby" : false
6
-
7
- Hoe.plugin :git
8
-
9
- HOE = Hoe.spec "puma" do
10
- self.rubyforge_name = 'puma'
11
- self.readme_file = "README.md"
12
- self.urls = %w!http://puma.io https://github.com/puma/puma!
13
-
14
- developer 'Evan Phoenix', 'evan@phx.io'
15
-
16
- spec_extras[:extensions] = ["ext/puma_http11/extconf.rb"]
17
- spec_extras[:executables] = ['puma', 'pumactl']
18
- spec_extras[:homepage] = self.urls.first
19
-
20
- require_ruby_version ">= 1.8.7"
21
-
22
- dependency "rack", [">= 1.1", "< 2.0"]
23
-
24
- extra_dev_deps << ["rake-compiler", "~> 0.8.0"]
25
- end
26
-
27
- # hoe/test and rake-compiler don't seem to play well together, so disable
28
- # hoe/test's .gemtest touch file thingy for now
29
- HOE.spec.files -= [".gemtest"]
30
-
31
- # puma.gemspec
32
-
33
- file "#{HOE.spec.name}.gemspec" => ['Rakefile', "lib/puma/const.rb"] do |t|
34
- puts "Generating #{t.name}"
35
- File.open(t.name, 'wb') { |f| f.write HOE.spec.to_ruby }
36
- end
37
-
38
- desc "Generate or update the standalone gemspec file for the project"
39
- task :gemspec => ["#{HOE.spec.name}.gemspec"]
40
-
41
- # generate extension code using Ragel (C and Java)
42
- desc "Generate extension code (C and Java) using Ragel"
43
- task :ragel
44
-
45
- file 'ext/puma_http11/http11_parser.c' => ['ext/puma_http11/http11_parser.rl'] do |t|
46
- begin
47
- sh "ragel #{t.prerequisites.last} -C -G2 -I ext/puma_http11 -o #{t.name}"
48
- rescue
49
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
50
- end
51
- end
52
- task :ragel => ['ext/puma_http11/http11_parser.c']
53
-
54
- file 'ext/puma_http11/org/jruby/puma/Http11Parser.java' => ['ext/puma_http11/http11_parser.java.rl'] do |t|
55
- begin
56
- sh "ragel #{t.prerequisites.last} -J -G2 -I ext/puma_http11 -o #{t.name}"
57
- rescue
58
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
59
- end
60
- end
61
- task :ragel => ['ext/puma_http11/org/jruby/puma/Http11Parser.java']
62
-
63
- if !IS_JRUBY
64
-
65
- # compile extensions using rake-compiler
66
- # C (MRI, Rubinius)
67
- Rake::ExtensionTask.new("puma_http11", HOE.spec) do |ext|
68
- # place extension inside namespace
69
- ext.lib_dir = "lib/puma"
70
-
71
- ext.cross_compile = true
72
- ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32']
73
- ext.cross_compiling do |spec|
74
- # add fat-binary stub only when cross compiling
75
- spec.files << "lib/puma/puma_http11.rb"
76
- end
77
-
78
- CLEAN.include "lib/puma/{1.8,1.9}"
79
- CLEAN.include "lib/puma/puma_http11.rb"
80
- end
81
-
82
- else
83
-
84
- # Java (JRuby)
85
- Rake::JavaExtensionTask.new("puma_http11", HOE.spec) do |ext|
86
- ext.lib_dir = "lib/puma"
87
- end
88
-
89
- end
90
-
91
- # the following is a fat-binary stub that will be used when
92
- # require 'puma/puma_http11' and will use either 1.8 or 1.9 version depending
93
- # on RUBY_VERSION
94
- file "lib/puma/puma_http11.rb" do |t|
95
- File.open(t.name, "w") do |f|
96
- f.puts "RUBY_VERSION =~ /(\d+.\d+)/"
97
- f.puts 'require "puma/#{$1}/puma_http11"'
98
- end
99
- end
100
-
101
- # tests require extension be compiled, but depend on the platform
102
- if IS_JRUBY
103
- task :test => [:java]
104
- else
105
- task :test => [:compile]
106
- end
107
-
108
- namespace :test do
109
- desc "Run the integration tests"
110
- task :integration do
111
- sh "cd test/shell; sh run.sh"
112
- end
113
-
114
- desc "Run all tests"
115
- if defined?(JRUBY_VERSION) and ENV['TRAVIS']
116
- task :all => :test
117
- else
118
- task :all => [:test, "test:integration"]
119
- end
120
- end
121
-
data/TODO DELETED
@@ -1,5 +0,0 @@
1
-
2
- v1.2. Rewrite and merge mongrel cluster and mongrel_rails into something small and maintainable. Remove gem_plugin entirely.
3
-
4
- v1.1.1. See if Java is setting the server version string in the request properly.
5
-
File without changes