passenger 2.2.4 → 2.2.5

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

Potentially problematic release.


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

Files changed (105) hide show
  1. data/NEWS +137 -0
  2. data/Rakefile +101 -19
  3. data/bin/passenger-install-nginx-module +10 -3
  4. data/bin/passenger-make-enterprisey +1 -1
  5. data/doc/Users guide Apache.html +227 -92
  6. data/doc/Users guide Apache.txt +169 -75
  7. data/doc/Users guide Nginx.html +1 -1
  8. data/doc/cxxapi/Bucket_8h-source.html +1 -1
  9. data/doc/cxxapi/Configuration_8h-source.html +373 -338
  10. data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
  11. data/doc/cxxapi/Hooks_8h-source.html +1 -1
  12. data/doc/cxxapi/annotated.html +1 -1
  13. data/doc/cxxapi/classHooks-members.html +1 -1
  14. data/doc/cxxapi/classHooks.html +2 -2
  15. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
  16. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
  17. data/doc/cxxapi/classes.html +1 -1
  18. data/doc/cxxapi/definitions_8h-source.html +1 -1
  19. data/doc/cxxapi/files.html +1 -1
  20. data/doc/cxxapi/functions.html +1 -1
  21. data/doc/cxxapi/functions_func.html +1 -1
  22. data/doc/cxxapi/graph_legend.html +1 -1
  23. data/doc/cxxapi/group__Configuration.html +1 -1
  24. data/doc/cxxapi/group__Core.html +1 -1
  25. data/doc/cxxapi/group__Hooks.html +1 -1
  26. data/doc/cxxapi/group__Support.html +1 -1
  27. data/doc/cxxapi/main.html +1 -1
  28. data/doc/cxxapi/modules.html +1 -1
  29. data/doc/rdoc/classes/ConditionVariable.html +59 -59
  30. data/doc/rdoc/classes/Exception.html +11 -11
  31. data/doc/rdoc/classes/GC.html +4 -4
  32. data/doc/rdoc/classes/IO.html +14 -14
  33. data/doc/rdoc/classes/PhusionPassenger.html +1 -1
  34. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +8 -8
  35. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +136 -136
  36. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +254 -254
  37. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +61 -61
  38. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +4 -4
  39. data/doc/rdoc/classes/PhusionPassenger/Application.html +14 -14
  40. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +12 -12
  41. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +4 -4
  42. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +12 -12
  43. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +5 -5
  44. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +139 -139
  45. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +61 -56
  46. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +3 -3
  47. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +7 -7
  48. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +15 -15
  49. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +119 -119
  50. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +4 -4
  51. data/doc/rdoc/classes/PhusionPassenger/Utils.html +310 -312
  52. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +169 -0
  53. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +4 -4
  54. data/doc/rdoc/classes/PlatformInfo.html +165 -164
  55. data/doc/rdoc/classes/Signal.html +23 -23
  56. data/doc/rdoc/created.rid +1 -1
  57. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
  58. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +26 -28
  59. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +26 -28
  60. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +1 -1
  61. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +1 -1
  62. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +26 -28
  63. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +1 -1
  64. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +1 -1
  65. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +26 -28
  66. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +1 -2
  67. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +1 -1
  68. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +26 -28
  69. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +26 -28
  70. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +34 -36
  71. data/doc/rdoc/fr_class_index.html +1 -0
  72. data/doc/rdoc/fr_method_index.html +72 -68
  73. data/ext/apache2/Configuration.cpp +69 -15
  74. data/ext/apache2/Configuration.h +37 -2
  75. data/ext/apache2/Hooks.cpp +167 -59
  76. data/ext/common/ApplicationPoolServerExecutable.cpp +1 -1
  77. data/ext/common/MessageChannel.h +4 -4
  78. data/ext/common/StandardApplicationPool.h +1 -1
  79. data/ext/common/Timer.h +2 -0
  80. data/ext/common/Version.h +1 -1
  81. data/ext/nginx/Configuration.c +3 -3
  82. data/ext/nginx/ContentHandler.c +16 -4
  83. data/ext/nginx/HelperServer.cpp +1 -1
  84. data/ext/oxt/system_calls.cpp +6 -1
  85. data/ext/oxt/thread.hpp +17 -2
  86. data/ext/phusion_passenger/native_support.c +4 -4
  87. data/lib/phusion_passenger/abstract_request_handler.rb +3 -3
  88. data/lib/phusion_passenger/abstract_server.rb +1 -0
  89. data/lib/phusion_passenger/constants.rb +1 -1
  90. data/lib/phusion_passenger/message_channel.rb +1 -0
  91. data/lib/phusion_passenger/platform_info.rb +3 -2
  92. data/lib/phusion_passenger/rack/request_handler.rb +11 -7
  93. data/lib/phusion_passenger/railz/application_spawner.rb +7 -4
  94. data/lib/phusion_passenger/railz/request_handler.rb +1 -0
  95. data/lib/phusion_passenger/spawn_manager.rb +1 -0
  96. data/lib/phusion_passenger/utils.rb +38 -20
  97. data/test/integration_tests/apache2_tests.rb +162 -100
  98. data/test/integration_tests/mycook_spec.rb +63 -62
  99. data/test/integration_tests/nginx_tests.rb +12 -5
  100. data/test/ruby/utils_spec.rb +98 -14
  101. data/test/stub/apache2/httpd.conf.erb +2 -1
  102. data/test/stub/rails_apps/mycook/app/controllers/welcome_controller.rb +8 -0
  103. data/test/support/apache2_controller.rb +5 -1
  104. data/test/support/test_helper.rb +42 -13
  105. metadata +7 -137
@@ -107,11 +107,11 @@ A request handler for <a href="../Rack.html">Rack</a> applications.
107
107
  <p class="source-link">[ <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show source</a> ]</p>
108
108
  <div id="M000056_source" class="dyn-source">
109
109
  <pre>
110
- <span class="ruby-comment cmt"># File lib/phusion_passenger/rack/request_handler.rb, line 60</span>
111
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">app</span>, <span class="ruby-identifier">options</span> = {})
112
- 61: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span>)
113
- 62: <span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span>
114
- 63: <span class="ruby-keyword kw">end</span>
110
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/rack/request_handler.rb, line 59</span>
111
+ 59: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">app</span>, <span class="ruby-identifier">options</span> = {})
112
+ 60: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span>)
113
+ 61: <span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span>
114
+ 62: <span class="ruby-keyword kw">end</span>
115
115
  </pre>
116
116
  </div>
117
117
  </div>
@@ -130,58 +130,63 @@ Overrided method.
130
130
  <p class="source-link">[ <a href="javascript:toggleSource('M000057_source')" id="l_M000057_source">show source</a> ]</p>
131
131
  <div id="M000057_source" class="dyn-source">
132
132
  <pre>
133
- <span class="ruby-comment cmt"># File lib/phusion_passenger/rack/request_handler.rb, line 67</span>
134
- 67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_request</span>(<span class="ruby-identifier">env</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>)
135
- 68: <span class="ruby-identifier">rewindable_input</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">RewindableInput</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">input</span>)
136
- 69: <span class="ruby-keyword kw">begin</span>
137
- 70: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_VERSION</span>] = <span class="ruby-constant">RACK_VERSION_VALUE</span>
138
- 71: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_INPUT</span>] = <span class="ruby-identifier">rewindable_input</span>
139
- 72: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_ERRORS</span>] = <span class="ruby-constant">STDERR</span>
140
- 73: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_MULTITHREAD</span>] = <span class="ruby-keyword kw">false</span>
141
- 74: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_MULTIPROCESS</span>] = <span class="ruby-keyword kw">true</span>
142
- 75: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_RUN_ONCE</span>] = <span class="ruby-keyword kw">false</span>
143
- 76: <span class="ruby-identifier">env</span>[<span class="ruby-constant">QUERY_STRING</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;&quot;</span>
144
- 77: <span class="ruby-identifier">env</span>[<span class="ruby-constant">PATH_INFO</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">REQUEST_URI</span>].<span class="ruby-identifier">split</span>(<span class="ruby-constant">QUESTION_MARK</span>, <span class="ruby-value">2</span>).<span class="ruby-identifier">first</span>
145
- 78: <span class="ruby-identifier">env</span>[<span class="ruby-constant">PATH_INFO</span>].<span class="ruby-identifier">sub!</span>(<span class="ruby-node">/^#{Regexp.escape(env[SCRIPT_NAME])}/</span>, <span class="ruby-value str">&quot;&quot;</span>)
146
- 79: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_LENGTH</span>]
133
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/rack/request_handler.rb, line 66</span>
134
+ 66: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_request</span>(<span class="ruby-identifier">env</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>)
135
+ 67: <span class="ruby-identifier">rewindable_input</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">RewindableInput</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">input</span>)
136
+ 68: <span class="ruby-keyword kw">begin</span>
137
+ 69: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_VERSION</span>] = <span class="ruby-constant">RACK_VERSION_VALUE</span>
138
+ 70: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_INPUT</span>] = <span class="ruby-identifier">rewindable_input</span>
139
+ 71: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_ERRORS</span>] = <span class="ruby-constant">STDERR</span>
140
+ 72: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_MULTITHREAD</span>] = <span class="ruby-keyword kw">false</span>
141
+ 73: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_MULTIPROCESS</span>] = <span class="ruby-keyword kw">true</span>
142
+ 74: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_RUN_ONCE</span>] = <span class="ruby-keyword kw">false</span>
143
+ 75:
144
+ 76: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_LENGTH</span>]
145
+ 77: <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>)
146
+ 78: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_LENGTH</span>]
147
+ 79: <span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_LENGTH</span>] = <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>]
147
148
  80: <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>)
148
- 81: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_LENGTH</span>]
149
- 82: <span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_LENGTH</span>] = <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>]
150
- 83: <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>)
151
- 84: <span class="ruby-keyword kw">end</span>
152
- 85: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTPS</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">YES</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTPS</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">ON</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTPS</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">ONE</span>
153
- 86: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_URL_SCHEME</span>] = <span class="ruby-constant">HTTPS_DOWNCASE</span>
154
- 87: <span class="ruby-keyword kw">else</span>
155
- 88: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_URL_SCHEME</span>] = <span class="ruby-constant">HTTP</span>
156
- 89: <span class="ruby-keyword kw">end</span>
157
- 90:
158
- 91: <span class="ruby-identifier">status</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">body</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
159
- 92: <span class="ruby-keyword kw">begin</span>
160
- 93: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;Status: #{status.to_i}#{CRLF}&quot;</span>)
161
- 94: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;X-Powered-By: #{PASSENGER_HEADER}#{CRLF}&quot;</span>)
162
- 95: <span class="ruby-identifier">headers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">values</span><span class="ruby-operator">|</span>
163
- 96: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
164
- 97: <span class="ruby-identifier">values</span> = <span class="ruby-identifier">values</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
165
- 98: <span class="ruby-keyword kw">end</span>
166
- 99: <span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
167
- 100: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;#{key}: #{value}#{CRLF}&quot;</span>)
168
- 101: <span class="ruby-keyword kw">end</span>
169
- 102: <span class="ruby-keyword kw">end</span>
170
- 103: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">CRLF</span>)
171
- 104: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
172
- 105: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">body</span>)
173
- 106: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">body</span>
174
- 107: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
175
- 108: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">s</span>)
176
- 109: <span class="ruby-keyword kw">end</span>
177
- 110: <span class="ruby-keyword kw">end</span>
178
- 111: <span class="ruby-keyword kw">ensure</span>
179
- 112: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:close</span>)
180
- 113: <span class="ruby-keyword kw">end</span>
181
- 114: <span class="ruby-keyword kw">ensure</span>
182
- 115: <span class="ruby-identifier">rewindable_input</span>.<span class="ruby-identifier">close</span>
183
- 116: <span class="ruby-keyword kw">end</span>
184
- 117: <span class="ruby-keyword kw">end</span>
149
+ 81: <span class="ruby-keyword kw">end</span>
150
+ 82: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_TYPE</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_TYPE</span>]
151
+ 83: <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">HTTP_CONTENT_TYPE</span>)
152
+ 84: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_TYPE</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_TYPE</span>]
153
+ 85: <span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_TYPE</span>] = <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_TYPE</span>]
154
+ 86: <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">HTTP_CONTENT_TYPE</span>)
155
+ 87: <span class="ruby-keyword kw">end</span>
156
+ 88:
157
+ 89: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTPS</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">YES</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTPS</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">ON</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTPS</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">ONE</span>
158
+ 90: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_URL_SCHEME</span>] = <span class="ruby-constant">HTTPS_DOWNCASE</span>
159
+ 91: <span class="ruby-keyword kw">else</span>
160
+ 92: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_URL_SCHEME</span>] = <span class="ruby-constant">HTTP</span>
161
+ 93: <span class="ruby-keyword kw">end</span>
162
+ 94:
163
+ 95: <span class="ruby-identifier">status</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">body</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
164
+ 96: <span class="ruby-keyword kw">begin</span>
165
+ 97: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;Status: #{status.to_i}#{CRLF}&quot;</span>)
166
+ 98: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;X-Powered-By: #{PASSENGER_HEADER}#{CRLF}&quot;</span>)
167
+ 99: <span class="ruby-identifier">headers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">values</span><span class="ruby-operator">|</span>
168
+ 100: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
169
+ 101: <span class="ruby-identifier">values</span> = <span class="ruby-identifier">values</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
170
+ 102: <span class="ruby-keyword kw">end</span>
171
+ 103: <span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
172
+ 104: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;#{key}: #{value}#{CRLF}&quot;</span>)
173
+ 105: <span class="ruby-keyword kw">end</span>
174
+ 106: <span class="ruby-keyword kw">end</span>
175
+ 107: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">CRLF</span>)
176
+ 108: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
177
+ 109: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">body</span>)
178
+ 110: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">body</span>
179
+ 111: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
180
+ 112: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">s</span>)
181
+ 113: <span class="ruby-keyword kw">end</span>
182
+ 114: <span class="ruby-keyword kw">end</span>
183
+ 115: <span class="ruby-keyword kw">ensure</span>
184
+ 116: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:close</span>)
185
+ 117: <span class="ruby-keyword kw">end</span>
186
+ 118: <span class="ruby-keyword kw">ensure</span>
187
+ 119: <span class="ruby-identifier">rewindable_input</span>.<span class="ruby-identifier">close</span>
188
+ 120: <span class="ruby-keyword kw">end</span>
189
+ 121: <span class="ruby-keyword kw">end</span>
185
190
  </pre>
186
191
  </div>
187
192
  </div>
@@ -90,9 +90,9 @@ multiple different Ruby on Rails applications.
90
90
  <p>
91
91
  <b>Note</b>: <a href="ApplicationSpawner.html">ApplicationSpawner</a> may
92
92
  only be started asynchronously with <a
93
- href="../AbstractServer.html#M000130">AbstractServer#start</a>. Starting it
93
+ href="../AbstractServer.html#M000134">AbstractServer#start</a>. Starting it
94
94
  synchronously with <a
95
- href="../AbstractServer.html#M000131">AbstractServer#start_synchronously</a>
95
+ href="../AbstractServer.html#M000135">AbstractServer#start_synchronously</a>
96
96
  has not been tested.
97
97
  </p>
98
98
  </div>
@@ -396,7 +396,7 @@ application raised an exception or called exit() during startup.
396
396
  <div class="description">
397
397
  <p>
398
398
  Overrided from <a
399
- href="../AbstractServer.html#M000130">AbstractServer#start</a>.
399
+ href="../AbstractServer.html#M000134">AbstractServer#start</a>.
400
400
  </p>
401
401
  <p>
402
402
  May raise these additional exceptions:
@@ -95,9 +95,9 @@ href="ApplicationSpawner.html">ApplicationSpawner</a> internally.
95
95
  <p>
96
96
  <b>Note</b>: <a href="FrameworkSpawner.html">FrameworkSpawner</a> may only
97
97
  be started asynchronously with <a
98
- href="../AbstractServer.html#M000130">AbstractServer#start</a>. Starting it
98
+ href="../AbstractServer.html#M000134">AbstractServer#start</a>. Starting it
99
99
  synchronously with <a
100
- href="../AbstractServer.html#M000131">AbstractServer#start_synchronously</a>
100
+ href="../AbstractServer.html#M000135">AbstractServer#start_synchronously</a>
101
101
  has not been tested.
102
102
  </p>
103
103
  </div>
@@ -165,8 +165,8 @@ Note that the specified Rails framework will be loaded during the entire
165
165
  life time of the <a href="FrameworkSpawner.html">FrameworkSpawner</a>
166
166
  server. If you wish to <a href="FrameworkSpawner.html#M000042">reload</a>
167
167
  the Rails framework&#8216;s code, then restart the server by calling <a
168
- href="../AbstractServer.html#M000132">AbstractServer#stop</a> and <a
169
- href="../AbstractServer.html#M000130">AbstractServer#start</a>.
168
+ href="../AbstractServer.html#M000136">AbstractServer#stop</a> and <a
169
+ href="../AbstractServer.html#M000134">AbstractServer#start</a>.
170
170
  </p>
171
171
  </div>
172
172
  <div class="sourcecode">
@@ -279,8 +279,8 @@ you must do one of these things:
279
279
  </p>
280
280
  <ul>
281
281
  <li>Restart this <a href="FrameworkSpawner.html">FrameworkSpawner</a> by
282
- calling <a href="../AbstractServer.html#M000132">AbstractServer#stop</a>,
283
- then <a href="../AbstractServer.html#M000130">AbstractServer#start</a>.
282
+ calling <a href="../AbstractServer.html#M000136">AbstractServer#stop</a>,
283
+ then <a href="../AbstractServer.html#M000134">AbstractServer#start</a>.
284
284
 
285
285
  </li>
286
286
  <li>Reload the application by calling <a
@@ -372,7 +372,7 @@ unexpectedly.
372
372
  <div class="description">
373
373
  <p>
374
374
  Overrided from <a
375
- href="../AbstractServer.html#M000130">AbstractServer#start</a>.
375
+ href="../AbstractServer.html#M000134">AbstractServer#start</a>.
376
376
  </p>
377
377
  <p>
378
378
  May raise these additional exceptions:
@@ -110,13 +110,13 @@ A request handler for Ruby on Rails applications.
110
110
  <p class="source-link">[ <a href="javascript:toggleSource('M000052_source')" id="l_M000052_source">show source</a> ]</p>
111
111
  <div id="M000052_source" class="dyn-source">
112
112
  <pre>
113
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/request_handler.rb, line 37</span>
114
- 37: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span> = {})
115
- 38: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span>)
116
- 39: <span class="ruby-constant">NINJA_PATCHING_LOCK</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
117
- 40: <span class="ruby-identifier">ninja_patch_action_controller</span>
118
- 41: <span class="ruby-keyword kw">end</span>
119
- 42: <span class="ruby-keyword kw">end</span>
113
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/request_handler.rb, line 38</span>
114
+ 38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span> = {})
115
+ 39: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span>)
116
+ 40: <span class="ruby-constant">NINJA_PATCHING_LOCK</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
117
+ 41: <span class="ruby-identifier">ninja_patch_action_controller</span>
118
+ 42: <span class="ruby-keyword kw">end</span>
119
+ 43: <span class="ruby-keyword kw">end</span>
120
120
  </pre>
121
121
  </div>
122
122
  </div>
@@ -135,14 +135,14 @@ Overrided method.
135
135
  <p class="source-link">[ <a href="javascript:toggleSource('M000053_source')" id="l_M000053_source">show source</a> ]</p>
136
136
  <div id="M000053_source" class="dyn-source">
137
137
  <pre>
138
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/request_handler.rb, line 46</span>
139
- 46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_request</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>)
140
- 47: <span class="ruby-identifier">headers</span>[<span class="ruby-constant">CONTENT_LENGTH</span>] = <span class="ruby-identifier">headers</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>]
141
- 48: <span class="ruby-identifier">cgi</span> = <span class="ruby-constant">CGIFixed</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>)
142
- 49: <span class="ruby-operator">::</span><span class="ruby-constant">Dispatcher</span>.<span class="ruby-identifier">dispatch</span>(<span class="ruby-identifier">cgi</span>,
143
- 50: <span class="ruby-operator">::</span><span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">CgiRequest</span><span class="ruby-operator">::</span><span class="ruby-constant">DEFAULT_SESSION_OPTIONS</span>,
144
- 51: <span class="ruby-identifier">cgi</span>.<span class="ruby-identifier">stdoutput</span>)
145
- 52: <span class="ruby-keyword kw">end</span>
138
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/request_handler.rb, line 47</span>
139
+ 47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_request</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>)
140
+ 48: <span class="ruby-identifier">headers</span>[<span class="ruby-constant">CONTENT_LENGTH</span>] = <span class="ruby-identifier">headers</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>]
141
+ 49: <span class="ruby-identifier">cgi</span> = <span class="ruby-constant">CGIFixed</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>)
142
+ 50: <span class="ruby-operator">::</span><span class="ruby-constant">Dispatcher</span>.<span class="ruby-identifier">dispatch</span>(<span class="ruby-identifier">cgi</span>,
143
+ 51: <span class="ruby-operator">::</span><span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">CgiRequest</span><span class="ruby-operator">::</span><span class="ruby-constant">DEFAULT_SESSION_OPTIONS</span>,
144
+ 52: <span class="ruby-identifier">cgi</span>.<span class="ruby-identifier">stdoutput</span>)
145
+ 53: <span class="ruby-keyword kw">end</span>
146
146
  </pre>
147
147
  </div>
148
148
  </div>
@@ -85,9 +85,9 @@ fascade for the rest of the spawn manager system.
85
85
  <p>
86
86
  <b>Note</b>: <a href="SpawnManager.html">SpawnManager</a> may only be
87
87
  started synchronously with <a
88
- href="AbstractServer.html#M000131">AbstractServer#start_synchronously</a>.
88
+ href="AbstractServer.html#M000135">AbstractServer#start_synchronously</a>.
89
89
  Starting asynchronously has not been tested. Don&#8216;t forget to call <a
90
- href="SpawnManager.html#M000119">cleanup</a> after the server&#8216;s main
90
+ href="SpawnManager.html#M000123">cleanup</a> after the server&#8216;s main
91
91
  loop has finished.
92
92
  </p>
93
93
  <h2>Ruby on Rails optimizations</h2>
@@ -116,10 +116,10 @@ work around an obscure bug in ActiveSupport&#8216;s Dispatcher.
116
116
 
117
117
  <div class="sectiontitle">Methods</div>
118
118
  <ul>
119
- <li><a href="#M000119">cleanup</a></li>
120
- <li><a href="#M000116">new</a></li>
121
- <li><a href="#M000118">reload</a></li>
122
- <li><a href="#M000117">spawn_application</a></li>
119
+ <li><a href="#M000123">cleanup</a></li>
120
+ <li><a href="#M000120">new</a></li>
121
+ <li><a href="#M000122">reload</a></li>
122
+ <li><a href="#M000121">spawn_application</a></li>
123
123
  </ul>
124
124
 
125
125
  <div class="sectiontitle">Included Modules</div>
@@ -134,45 +134,45 @@ work around an obscure bug in ActiveSupport&#8216;s Dispatcher.
134
134
  <div class="sectiontitle">Public Class methods</div>
135
135
  <div class="method">
136
136
  <div class="title">
137
- <a name="M000116"></a><b>new</b>()
137
+ <a name="M000120"></a><b>new</b>()
138
138
  </div>
139
139
  <div class="sourcecode">
140
- <p class="source-link">[ <a href="javascript:toggleSource('M000116_source')" id="l_M000116_source">show source</a> ]</p>
141
- <div id="M000116_source" class="dyn-source">
140
+ <p class="source-link">[ <a href="javascript:toggleSource('M000120_source')" id="l_M000120_source">show source</a> ]</p>
141
+ <div id="M000120_source" class="dyn-source">
142
142
  <pre>
143
- <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 60</span>
144
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
145
- 61: <span class="ruby-keyword kw">super</span>()
146
- 62: <span class="ruby-ivar">@spawners</span> = <span class="ruby-constant">AbstractServerCollection</span>.<span class="ruby-identifier">new</span>
147
- 63: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:spawn_application</span>, <span class="ruby-identifier">:handle_spawn_application</span>)
148
- 64: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:reload</span>, <span class="ruby-identifier">:handle_reload</span>)
149
- 65: <span class="ruby-identifier">define_signal_handler</span>(<span class="ruby-value str">'SIGHUP'</span>, <span class="ruby-identifier">:reload</span>)
150
- 66:
151
- 67: <span class="ruby-comment cmt"># Start garbage collector in order to free up some existing</span>
152
- 68: <span class="ruby-comment cmt"># heap slots. This prevents the heap from growing unnecessarily</span>
153
- 69: <span class="ruby-comment cmt"># during the startup phase.</span>
154
- 70: <span class="ruby-constant">GC</span>.<span class="ruby-identifier">start</span>
155
- 71: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">GC</span>.<span class="ruby-identifier">copy_on_write_friendly?</span>
156
- 72: <span class="ruby-comment cmt"># Preload libraries for copy-on-write semantics.</span>
157
- 73: <span class="ruby-identifier">require</span> <span class="ruby-value str">'base64'</span>
158
- 74: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/application'</span>
159
- 75: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/framework_spawner'</span>
160
- 76: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/application_spawner'</span>
161
- 77: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/rack/application_spawner'</span>
162
- 78: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/html_template'</span>
163
- 79: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/platform_info'</span>
164
- 80: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/exceptions'</span>
165
- 81:
166
- 82: <span class="ruby-comment cmt"># Commonly used libraries.</span>
167
- 83: [<span class="ruby-value str">'mysql'</span>, <span class="ruby-value str">'sqlite3'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lib</span><span class="ruby-operator">|</span>
168
- 84: <span class="ruby-keyword kw">begin</span>
169
- 85: <span class="ruby-identifier">require</span> <span class="ruby-identifier">lib</span>
170
- 86: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">LoadError</span>
171
- 87: <span class="ruby-comment cmt"># Do nothing; ignore if not present.</span>
172
- 88: <span class="ruby-keyword kw">end</span>
173
- 89: <span class="ruby-keyword kw">end</span>
174
- 90: <span class="ruby-keyword kw">end</span>
175
- 91: <span class="ruby-keyword kw">end</span>
143
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 61</span>
144
+ 61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
145
+ 62: <span class="ruby-keyword kw">super</span>()
146
+ 63: <span class="ruby-ivar">@spawners</span> = <span class="ruby-constant">AbstractServerCollection</span>.<span class="ruby-identifier">new</span>
147
+ 64: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:spawn_application</span>, <span class="ruby-identifier">:handle_spawn_application</span>)
148
+ 65: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:reload</span>, <span class="ruby-identifier">:handle_reload</span>)
149
+ 66: <span class="ruby-identifier">define_signal_handler</span>(<span class="ruby-value str">'SIGHUP'</span>, <span class="ruby-identifier">:reload</span>)
150
+ 67:
151
+ 68: <span class="ruby-comment cmt"># Start garbage collector in order to free up some existing</span>
152
+ 69: <span class="ruby-comment cmt"># heap slots. This prevents the heap from growing unnecessarily</span>
153
+ 70: <span class="ruby-comment cmt"># during the startup phase.</span>
154
+ 71: <span class="ruby-constant">GC</span>.<span class="ruby-identifier">start</span>
155
+ 72: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">GC</span>.<span class="ruby-identifier">copy_on_write_friendly?</span>
156
+ 73: <span class="ruby-comment cmt"># Preload libraries for copy-on-write semantics.</span>
157
+ 74: <span class="ruby-identifier">require</span> <span class="ruby-value str">'base64'</span>
158
+ 75: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/application'</span>
159
+ 76: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/framework_spawner'</span>
160
+ 77: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/application_spawner'</span>
161
+ 78: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/rack/application_spawner'</span>
162
+ 79: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/html_template'</span>
163
+ 80: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/platform_info'</span>
164
+ 81: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/exceptions'</span>
165
+ 82:
166
+ 83: <span class="ruby-comment cmt"># Commonly used libraries.</span>
167
+ 84: [<span class="ruby-value str">'mysql'</span>, <span class="ruby-value str">'sqlite3'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lib</span><span class="ruby-operator">|</span>
168
+ 85: <span class="ruby-keyword kw">begin</span>
169
+ 86: <span class="ruby-identifier">require</span> <span class="ruby-identifier">lib</span>
170
+ 87: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">LoadError</span>
171
+ 88: <span class="ruby-comment cmt"># Do nothing; ignore if not present.</span>
172
+ 89: <span class="ruby-keyword kw">end</span>
173
+ 90: <span class="ruby-keyword kw">end</span>
174
+ 91: <span class="ruby-keyword kw">end</span>
175
+ 92: <span class="ruby-keyword kw">end</span>
176
176
  </pre>
177
177
  </div>
178
178
  </div>
@@ -180,7 +180,7 @@ work around an obscure bug in ActiveSupport&#8216;s Dispatcher.
180
180
  <div class="sectiontitle">Public Instance methods</div>
181
181
  <div class="method">
182
182
  <div class="title">
183
- <a name="M000119"></a><b>cleanup</b>()
183
+ <a name="M000123"></a><b>cleanup</b>()
184
184
  </div>
185
185
  <div class="description">
186
186
  <p>
@@ -189,20 +189,20 @@ href="SpawnManager.html">SpawnManager</a> is no longer needed.
189
189
  </p>
190
190
  </div>
191
191
  <div class="sourcecode">
192
- <p class="source-link">[ <a href="javascript:toggleSource('M000119_source')" id="l_M000119_source">show source</a> ]</p>
193
- <div id="M000119_source" class="dyn-source">
192
+ <p class="source-link">[ <a href="javascript:toggleSource('M000123_source')" id="l_M000123_source">show source</a> ]</p>
193
+ <div id="M000123_source" class="dyn-source">
194
194
  <pre>
195
- <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 214</span>
196
- 214: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup</span>
197
- 215: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">cleanup</span>
198
- 216: <span class="ruby-keyword kw">end</span>
195
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 215</span>
196
+ 215: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup</span>
197
+ 216: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">cleanup</span>
198
+ 217: <span class="ruby-keyword kw">end</span>
199
199
  </pre>
200
200
  </div>
201
201
  </div>
202
202
  </div>
203
203
  <div class="method">
204
204
  <div class="title">
205
- <a name="M000118"></a><b>reload</b>(app_root = nil)
205
+ <a name="M000122"></a><b>reload</b>(app_root = nil)
206
206
  </div>
207
207
  <div class="description">
208
208
  <p>
@@ -213,8 +213,8 @@ will be removed, no matter the application root.
213
213
  <p>
214
214
  <b>Long description:</b> <a href="Application.html">Application</a> code
215
215
  might be cached in memory. But once it a while, it will be necessary to <a
216
- href="SpawnManager.html#M000118">reload</a> the code for an application,
217
- such as after deploying a <a href="SpawnManager.html#M000116">new</a>
216
+ href="SpawnManager.html#M000122">reload</a> the code for an application,
217
+ such as after deploying a <a href="SpawnManager.html#M000120">new</a>
218
218
  version of the application. This method makes sure that any cached
219
219
  application code is removed, so that the next time an application instance
220
220
  is spawned, the application code will be freshly loaded into memory.
@@ -224,42 +224,42 @@ Raises AbstractServer::SpawnError if something went wrong.
224
224
  </p>
225
225
  </div>
226
226
  <div class="sourcecode">
227
- <p class="source-link">[ <a href="javascript:toggleSource('M000118_source')" id="l_M000118_source">show source</a> ]</p>
228
- <div id="M000118_source" class="dyn-source">
227
+ <p class="source-link">[ <a href="javascript:toggleSource('M000122_source')" id="l_M000122_source">show source</a> ]</p>
228
+ <div id="M000122_source" class="dyn-source">
229
229
  <pre>
230
- <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 187</span>
231
- 187: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload</span>(<span class="ruby-identifier">app_root</span> = <span class="ruby-keyword kw">nil</span>)
232
- 188: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
233
- 189: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">app_root</span>
234
- 190: <span class="ruby-comment cmt"># Delete associated ApplicationSpawner.</span>
235
- 191: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-node">&quot;app:#{app_root}&quot;</span>)
236
- 192: <span class="ruby-keyword kw">else</span>
237
- 193: <span class="ruby-comment cmt"># Delete all ApplicationSpawners.</span>
238
- 194: <span class="ruby-identifier">keys_to_delete</span> = []
239
- 195: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">spawner</span><span class="ruby-operator">|</span>
240
- 196: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">spawner</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Railz</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>)
241
- 197: <span class="ruby-identifier">keys_to_delete</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">key</span>
242
- 198: <span class="ruby-keyword kw">end</span>
243
- 199: <span class="ruby-keyword kw">end</span>
244
- 200: <span class="ruby-identifier">keys_to_delete</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
245
- 201: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
246
- 202: <span class="ruby-keyword kw">end</span>
247
- 203: <span class="ruby-keyword kw">end</span>
248
- 204: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spawner</span><span class="ruby-operator">|</span>
249
- 205: <span class="ruby-comment cmt"># Reload all FrameworkSpawners.</span>
250
- 206: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">spawner</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:reload</span>)
251
- 207: <span class="ruby-identifier">spawner</span>.<span class="ruby-identifier">reload</span>(<span class="ruby-identifier">app_root</span>)
252
- 208: <span class="ruby-keyword kw">end</span>
253
- 209: <span class="ruby-keyword kw">end</span>
254
- 210: <span class="ruby-keyword kw">end</span>
255
- 211: <span class="ruby-keyword kw">end</span>
230
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 188</span>
231
+ 188: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload</span>(<span class="ruby-identifier">app_root</span> = <span class="ruby-keyword kw">nil</span>)
232
+ 189: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
233
+ 190: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">app_root</span>
234
+ 191: <span class="ruby-comment cmt"># Delete associated ApplicationSpawner.</span>
235
+ 192: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-node">&quot;app:#{app_root}&quot;</span>)
236
+ 193: <span class="ruby-keyword kw">else</span>
237
+ 194: <span class="ruby-comment cmt"># Delete all ApplicationSpawners.</span>
238
+ 195: <span class="ruby-identifier">keys_to_delete</span> = []
239
+ 196: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">spawner</span><span class="ruby-operator">|</span>
240
+ 197: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">spawner</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Railz</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>)
241
+ 198: <span class="ruby-identifier">keys_to_delete</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">key</span>
242
+ 199: <span class="ruby-keyword kw">end</span>
243
+ 200: <span class="ruby-keyword kw">end</span>
244
+ 201: <span class="ruby-identifier">keys_to_delete</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
245
+ 202: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
246
+ 203: <span class="ruby-keyword kw">end</span>
247
+ 204: <span class="ruby-keyword kw">end</span>
248
+ 205: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spawner</span><span class="ruby-operator">|</span>
249
+ 206: <span class="ruby-comment cmt"># Reload all FrameworkSpawners.</span>
250
+ 207: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">spawner</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:reload</span>)
251
+ 208: <span class="ruby-identifier">spawner</span>.<span class="ruby-identifier">reload</span>(<span class="ruby-identifier">app_root</span>)
252
+ 209: <span class="ruby-keyword kw">end</span>
253
+ 210: <span class="ruby-keyword kw">end</span>
254
+ 211: <span class="ruby-keyword kw">end</span>
255
+ 212: <span class="ruby-keyword kw">end</span>
256
256
  </pre>
257
257
  </div>
258
258
  </div>
259
259
  </div>
260
260
  <div class="method">
261
261
  <div class="title">
262
- <a name="M000117"></a><b>spawn_application</b>(options)
262
+ <a name="M000121"></a><b>spawn_application</b>(options)
263
263
  </div>
264
264
  <div class="description">
265
265
  <p>
@@ -288,12 +288,12 @@ must do one of these things:
288
288
 
289
289
  <ul>
290
290
  <li>Restart this <a href="SpawnManager.html">SpawnManager</a> by calling <a
291
- href="AbstractServer.html#M000132">AbstractServer#stop</a>, then <a
292
- href="AbstractServer.html#M000130">AbstractServer#start</a>.
291
+ href="AbstractServer.html#M000136">AbstractServer#stop</a>, then <a
292
+ href="AbstractServer.html#M000134">AbstractServer#start</a>.
293
293
 
294
294
  </li>
295
295
  <li>Reload the application by calling <a
296
- href="SpawnManager.html#M000118">reload</a> with the correct app_root
296
+ href="SpawnManager.html#M000122">reload</a> with the correct app_root
297
297
  argument.
298
298
 
299
299
  </li>
@@ -354,42 +354,42 @@ exception or called exit() during startup.
354
354
  </ul>
355
355
  </div>
356
356
  <div class="sourcecode">
357
- <p class="source-link">[ <a href="javascript:toggleSource('M000117_source')" id="l_M000117_source">show source</a> ]</p>
358
- <div id="M000117_source" class="dyn-source">
357
+ <p class="source-link">[ <a href="javascript:toggleSource('M000121_source')" id="l_M000121_source">show source</a> ]</p>
358
+ <div id="M000121_source" class="dyn-source">
359
359
  <pre>
360
- <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 141</span>
361
- 141: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">options</span>)
362
- 142: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>]
363
- 143: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;The 'app_root' option must be given.&quot;</span>
364
- 144: <span class="ruby-keyword kw">end</span>
365
- 145: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
366
- 146:
367
- 147: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_type&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;rails&quot;</span>
368
- 148: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">Railz</span><span class="ruby-operator">::</span><span class="ruby-constant">FrameworkSpawner</span>)
369
- 149: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/application'</span>
370
- 150: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/framework_spawner'</span>
371
- 151: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/application_spawner'</span>
372
- 152: <span class="ruby-keyword kw">end</span>
373
- 153: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">spawn_rails_application</span>(<span class="ruby-identifier">options</span>)
374
- 154: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_type&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;rack&quot;</span>
375
- 155: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>)
376
- 156: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/rack/application_spawner'</span>
377
- 157: <span class="ruby-keyword kw">end</span>
378
- 158: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>.<span class="ruby-identifier">spawn_application</span>(
379
- 159: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>], <span class="ruby-identifier">options</span>
380
- 160: )
381
- 161: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_type&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;wsgi&quot;</span>
382
- 162: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/wsgi/application_spawner'</span>
383
- 163: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">WSGI</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>.<span class="ruby-identifier">spawn_application</span>(
384
- 164: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>],
385
- 165: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lower_privilege&quot;</span>],
386
- 166: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lowest_user&quot;</span>],
387
- 167: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;environment&quot;</span>]
388
- 168: )
389
- 169: <span class="ruby-keyword kw">else</span>
390
- 170: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Unknown 'app_type' value '#{options[&quot;app_type&quot;]}'.&quot;</span>
391
- 171: <span class="ruby-keyword kw">end</span>
392
- 172: <span class="ruby-keyword kw">end</span>
360
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 142</span>
361
+ 142: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">options</span>)
362
+ 143: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>]
363
+ 144: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;The 'app_root' option must be given.&quot;</span>
364
+ 145: <span class="ruby-keyword kw">end</span>
365
+ 146: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
366
+ 147:
367
+ 148: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_type&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;rails&quot;</span>
368
+ 149: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">Railz</span><span class="ruby-operator">::</span><span class="ruby-constant">FrameworkSpawner</span>)
369
+ 150: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/application'</span>
370
+ 151: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/framework_spawner'</span>
371
+ 152: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/application_spawner'</span>
372
+ 153: <span class="ruby-keyword kw">end</span>
373
+ 154: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">spawn_rails_application</span>(<span class="ruby-identifier">options</span>)
374
+ 155: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_type&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;rack&quot;</span>
375
+ 156: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>)
376
+ 157: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/rack/application_spawner'</span>
377
+ 158: <span class="ruby-keyword kw">end</span>
378
+ 159: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>.<span class="ruby-identifier">spawn_application</span>(
379
+ 160: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>], <span class="ruby-identifier">options</span>
380
+ 161: )
381
+ 162: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_type&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;wsgi&quot;</span>
382
+ 163: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/wsgi/application_spawner'</span>
383
+ 164: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">WSGI</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>.<span class="ruby-identifier">spawn_application</span>(
384
+ 165: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>],
385
+ 166: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lower_privilege&quot;</span>],
386
+ 167: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lowest_user&quot;</span>],
387
+ 168: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;environment&quot;</span>]
388
+ 169: )
389
+ 170: <span class="ruby-keyword kw">else</span>
390
+ 171: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Unknown 'app_type' value '#{options[&quot;app_type&quot;]}'.&quot;</span>
391
+ 172: <span class="ruby-keyword kw">end</span>
392
+ 173: <span class="ruby-keyword kw">end</span>
393
393
  </pre>
394
394
  </div>
395
395
  </div>