passenger 2.1.3 → 2.2.0

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 (398) hide show
  1. data/DEVELOPERS.TXT +2 -0
  2. data/INSTALL +3 -1
  3. data/LICENSE +19 -355
  4. data/NEWS +3 -0
  5. data/README +11 -4
  6. data/Rakefile +435 -236
  7. data/bin/passenger-config +20 -14
  8. data/bin/passenger-install-apache2-module +67 -201
  9. data/bin/passenger-install-nginx-module +477 -0
  10. data/bin/passenger-make-enterprisey +17 -12
  11. data/bin/passenger-memory-stats +33 -23
  12. data/bin/passenger-spawn-server +17 -12
  13. data/bin/passenger-status +18 -13
  14. data/bin/passenger-stress-test +17 -12
  15. data/doc/{Users guide.html → Users guide Apache.html } +79 -61
  16. data/doc/{Users guide.txt → Users guide Apache.txt } +43 -939
  17. data/doc/Users guide Nginx.html +2276 -0
  18. data/doc/Users guide Nginx.txt +776 -0
  19. data/doc/cxxapi/ApplicationPoolServer_8h-source.html +9 -4
  20. data/doc/cxxapi/ApplicationPool_8h-source.html +9 -4
  21. data/doc/cxxapi/Application_8h-source.html +26 -21
  22. data/doc/cxxapi/Bucket_8h-source.html +54 -44
  23. data/doc/cxxapi/CachedFileStat_8h-source.html +9 -4
  24. data/doc/cxxapi/Configuration_8h-source.html +357 -339
  25. data/doc/cxxapi/DirectoryMapper_8h-source.html +294 -280
  26. data/doc/cxxapi/DummySpawnManager_8h-source.html +9 -4
  27. data/doc/cxxapi/Exceptions_8h-source.html +9 -4
  28. data/doc/cxxapi/FileChecker_8h-source.html +9 -4
  29. data/doc/cxxapi/Hooks_8h-source.html +50 -40
  30. data/doc/cxxapi/Logging_8h-source.html +9 -4
  31. data/doc/cxxapi/MessageChannel_8h-source.html +20 -15
  32. data/doc/cxxapi/PoolOptions_8h-source.html +10 -5
  33. data/doc/cxxapi/SpawnManager_8h-source.html +9 -4
  34. data/doc/cxxapi/StandardApplicationPool_8h-source.html +10 -5
  35. data/doc/cxxapi/SystemTime_8h-source.html +9 -4
  36. data/doc/cxxapi/Utils_8h-source.html +242 -214
  37. data/doc/cxxapi/annotated.html +4 -28
  38. data/doc/cxxapi/classClient-members.html +4 -4
  39. data/doc/cxxapi/classClient.html +14 -11
  40. data/doc/cxxapi/classHooks-members.html +4 -5
  41. data/doc/cxxapi/classHooks.html +26 -24
  42. data/doc/cxxapi/classPassenger_1_1Application-members.html +4 -4
  43. data/doc/cxxapi/classPassenger_1_1Application.html +40 -37
  44. data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +4 -4
  45. data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +95 -92
  46. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +4 -4
  47. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +26 -23
  48. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.map +1 -1
  49. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.md5 +1 -1
  50. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
  51. data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +17 -17
  52. data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +139 -136
  53. data/doc/cxxapi/classPassenger_1_1BufferedUpload-members.html +4 -4
  54. data/doc/cxxapi/classPassenger_1_1BufferedUpload.html +13 -10
  55. data/doc/cxxapi/classPassenger_1_1BusyException-members.html +4 -4
  56. data/doc/cxxapi/classPassenger_1_1BusyException.html +11 -8
  57. data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +4 -4
  58. data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +11 -8
  59. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +4 -5
  60. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +45 -43
  61. data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +4 -4
  62. data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +13 -10
  63. data/doc/cxxapi/classPassenger_1_1FileChecker-members.html +4 -4
  64. data/doc/cxxapi/classPassenger_1_1FileChecker.html +22 -19
  65. data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +4 -4
  66. data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +12 -9
  67. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +1 -1
  68. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +1 -1
  69. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
  70. data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +4 -4
  71. data/doc/cxxapi/classPassenger_1_1FileSystemException.html +14 -11
  72. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +1 -1
  73. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +1 -1
  74. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
  75. data/doc/cxxapi/classPassenger_1_1IOException-members.html +4 -4
  76. data/doc/cxxapi/classPassenger_1_1IOException.html +12 -9
  77. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +1 -1
  78. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +1 -1
  79. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
  80. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +4 -4
  81. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +228 -225
  82. data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +4 -4
  83. data/doc/cxxapi/classPassenger_1_1RuntimeException.html +11 -8
  84. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +4 -4
  85. data/doc/cxxapi/classPassenger_1_1SpawnException.html +14 -11
  86. data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +4 -4
  87. data/doc/cxxapi/classPassenger_1_1SpawnManager.html +50 -47
  88. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +4 -4
  89. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +73 -70
  90. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.map +1 -1
  91. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.md5 +1 -1
  92. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
  93. data/doc/cxxapi/classPassenger_1_1SystemException-members.html +4 -4
  94. data/doc/cxxapi/classPassenger_1_1SystemException.html +17 -14
  95. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +1 -1
  96. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +1 -1
  97. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
  98. data/doc/cxxapi/classPassenger_1_1SystemTime-members.html +4 -4
  99. data/doc/cxxapi/classPassenger_1_1SystemTime.html +14 -11
  100. data/doc/cxxapi/classes.html +35 -0
  101. data/doc/cxxapi/definitions_8h-source.html +9 -4
  102. data/doc/cxxapi/doxygen.css +311 -303
  103. data/doc/cxxapi/files.html +9 -18
  104. data/doc/cxxapi/functions.html +5 -224
  105. data/doc/cxxapi/functions_func.html +5 -185
  106. data/doc/cxxapi/functions_type.html +4 -4
  107. data/doc/cxxapi/functions_vars.html +4 -4
  108. data/doc/cxxapi/graph_legend.dot +19 -19
  109. data/doc/cxxapi/graph_legend.html +5 -5
  110. data/doc/cxxapi/graph_legend.png +0 -0
  111. data/doc/cxxapi/group__Configuration.html +11 -13
  112. data/doc/cxxapi/group__Configuration.png +0 -0
  113. data/doc/cxxapi/group__Core.html +10 -12
  114. data/doc/cxxapi/group__Core.png +0 -0
  115. data/doc/cxxapi/group__Exceptions.html +5 -7
  116. data/doc/cxxapi/group__Hooks.html +5 -7
  117. data/doc/cxxapi/group__Hooks.png +0 -0
  118. data/doc/cxxapi/group__Support.html +5 -624
  119. data/doc/cxxapi/hierarchy.html +6 -6
  120. data/doc/cxxapi/inherit__graph__0.map +1 -1
  121. data/doc/cxxapi/inherit__graph__0.md5 +1 -1
  122. data/doc/cxxapi/inherit__graph__0.png +0 -0
  123. data/doc/cxxapi/inherit__graph__1.map +1 -1
  124. data/doc/cxxapi/inherit__graph__1.md5 +1 -1
  125. data/doc/cxxapi/inherit__graph__1.png +0 -0
  126. data/doc/cxxapi/inherit__graph__10.map +1 -1
  127. data/doc/cxxapi/inherit__graph__10.md5 +1 -1
  128. data/doc/cxxapi/inherit__graph__10.png +0 -0
  129. data/doc/cxxapi/inherit__graph__11.map +1 -1
  130. data/doc/cxxapi/inherit__graph__11.md5 +1 -1
  131. data/doc/cxxapi/inherit__graph__11.png +0 -0
  132. data/doc/cxxapi/inherit__graph__12.map +1 -1
  133. data/doc/cxxapi/inherit__graph__12.md5 +1 -1
  134. data/doc/cxxapi/inherit__graph__12.png +0 -0
  135. data/doc/cxxapi/inherit__graph__13.map +1 -2
  136. data/doc/cxxapi/inherit__graph__13.md5 +1 -1
  137. data/doc/cxxapi/inherit__graph__13.png +0 -0
  138. data/doc/cxxapi/inherit__graph__14.map +2 -1
  139. data/doc/cxxapi/inherit__graph__14.md5 +1 -1
  140. data/doc/cxxapi/inherit__graph__14.png +0 -0
  141. data/doc/cxxapi/inherit__graph__15.map +1 -1
  142. data/doc/cxxapi/inherit__graph__15.md5 +1 -1
  143. data/doc/cxxapi/inherit__graph__15.png +0 -0
  144. data/doc/cxxapi/inherit__graph__16.map +1 -1
  145. data/doc/cxxapi/inherit__graph__16.md5 +1 -1
  146. data/doc/cxxapi/inherit__graph__16.png +0 -0
  147. data/doc/cxxapi/inherit__graph__17.map +1 -1
  148. data/doc/cxxapi/inherit__graph__17.md5 +1 -1
  149. data/doc/cxxapi/inherit__graph__17.png +0 -0
  150. data/doc/cxxapi/inherit__graph__18.map +1 -1
  151. data/doc/cxxapi/inherit__graph__18.md5 +1 -1
  152. data/doc/cxxapi/inherit__graph__18.png +0 -0
  153. data/doc/cxxapi/inherit__graph__19.map +1 -1
  154. data/doc/cxxapi/inherit__graph__19.md5 +1 -1
  155. data/doc/cxxapi/inherit__graph__19.png +0 -0
  156. data/doc/cxxapi/inherit__graph__2.map +1 -1
  157. data/doc/cxxapi/inherit__graph__2.md5 +1 -1
  158. data/doc/cxxapi/inherit__graph__2.png +0 -0
  159. data/doc/cxxapi/inherit__graph__20.map +2 -2
  160. data/doc/cxxapi/inherit__graph__20.md5 +1 -1
  161. data/doc/cxxapi/inherit__graph__20.png +0 -0
  162. data/doc/cxxapi/inherit__graph__21.map +1 -1
  163. data/doc/cxxapi/inherit__graph__21.md5 +1 -1
  164. data/doc/cxxapi/inherit__graph__21.png +0 -0
  165. data/doc/cxxapi/inherit__graph__3.map +1 -1
  166. data/doc/cxxapi/inherit__graph__3.md5 +1 -1
  167. data/doc/cxxapi/inherit__graph__3.png +0 -0
  168. data/doc/cxxapi/inherit__graph__4.map +1 -1
  169. data/doc/cxxapi/inherit__graph__4.md5 +1 -1
  170. data/doc/cxxapi/inherit__graph__4.png +0 -0
  171. data/doc/cxxapi/inherit__graph__5.map +1 -2
  172. data/doc/cxxapi/inherit__graph__5.md5 +1 -1
  173. data/doc/cxxapi/inherit__graph__5.png +0 -0
  174. data/doc/cxxapi/inherit__graph__6.map +2 -1
  175. data/doc/cxxapi/inherit__graph__6.md5 +1 -1
  176. data/doc/cxxapi/inherit__graph__6.png +0 -0
  177. data/doc/cxxapi/inherit__graph__7.map +1 -1
  178. data/doc/cxxapi/inherit__graph__7.md5 +1 -1
  179. data/doc/cxxapi/inherit__graph__7.png +0 -0
  180. data/doc/cxxapi/inherit__graph__8.map +1 -1
  181. data/doc/cxxapi/inherit__graph__8.md5 +1 -1
  182. data/doc/cxxapi/inherit__graph__8.png +0 -0
  183. data/doc/cxxapi/inherit__graph__9.map +1 -1
  184. data/doc/cxxapi/inherit__graph__9.md5 +1 -1
  185. data/doc/cxxapi/inherit__graph__9.png +0 -0
  186. data/doc/cxxapi/inherits.html +41 -41
  187. data/doc/cxxapi/main.html +4 -4
  188. data/doc/cxxapi/modules.html +4 -5
  189. data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +4 -4
  190. data/doc/cxxapi/structPassenger_1_1AnythingToString.html +13 -10
  191. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +5 -5
  192. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +16 -13
  193. data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +4 -4
  194. data/doc/cxxapi/structPassenger_1_1PoolOptions.html +63 -60
  195. data/doc/cxxapi/tabs.css +5 -2
  196. data/doc/cxxapi/tree.html +7 -81
  197. data/doc/rdoc/classes/ConditionVariable.html +59 -59
  198. data/doc/rdoc/classes/Exception.html +11 -11
  199. data/doc/rdoc/classes/GC.html +4 -4
  200. data/doc/rdoc/classes/IO.html +14 -14
  201. data/doc/rdoc/classes/PhusionPassenger.html +75 -20
  202. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +153 -0
  203. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +125 -130
  204. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +236 -236
  205. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +213 -213
  206. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +28 -28
  207. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +91 -75
  208. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +10 -10
  209. data/doc/rdoc/classes/PhusionPassenger/Application.html +64 -64
  210. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +34 -34
  211. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +13 -13
  212. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +30 -30
  213. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +10 -10
  214. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +136 -136
  215. data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +24 -24
  216. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +42 -42
  217. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +55 -53
  218. data/doc/rdoc/classes/PhusionPassenger/Railz.html +1 -1
  219. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +25 -30
  220. data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +23 -23
  221. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +116 -117
  222. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +22 -22
  223. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +118 -124
  224. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +10 -10
  225. data/doc/rdoc/classes/PhusionPassenger/Utils.html +354 -354
  226. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +9 -9
  227. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +37 -37
  228. data/doc/rdoc/classes/PlatformInfo.html +282 -261
  229. data/doc/rdoc/classes/RakeExtensions.html +7 -7
  230. data/doc/rdoc/classes/Signal.html +26 -26
  231. data/doc/rdoc/created.rid +1 -1
  232. data/doc/rdoc/files/DEVELOPERS_TXT.html +6 -1
  233. data/doc/rdoc/files/README.html +15 -6
  234. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
  235. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +129 -0
  236. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +20 -13
  237. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +19 -13
  238. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +19 -13
  239. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +31 -1
  240. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +31 -1
  241. data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +19 -13
  242. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +19 -13
  243. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +21 -12
  244. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +19 -13
  245. data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +19 -13
  246. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +19 -13
  247. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +19 -13
  248. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +19 -13
  249. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +122 -0
  250. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +19 -13
  251. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +22 -12
  252. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +21 -12
  253. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +19 -13
  254. data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +1 -1
  255. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +19 -13
  256. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +21 -12
  257. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +19 -13
  258. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +19 -13
  259. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +27 -21
  260. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +21 -12
  261. data/doc/rdoc/files/misc/rake/extensions_rb.html +21 -12
  262. data/doc/rdoc/fr_class_index.html +1 -0
  263. data/doc/rdoc/fr_file_index.html +2 -0
  264. data/doc/rdoc/fr_method_index.html +116 -112
  265. data/doc/users_guide_snippets/analysis_and_system_maintenance_tools.txt +144 -0
  266. data/doc/users_guide_snippets/appendix_a_about.txt +13 -0
  267. data/doc/users_guide_snippets/appendix_b_terminology.txt +63 -0
  268. data/doc/users_guide_snippets/appendix_c_spawning_methods.txt +304 -0
  269. data/doc/users_guide_snippets/global_queueing_explained.txt +78 -0
  270. data/doc/users_guide_snippets/rackup_specifications.txt +75 -0
  271. data/doc/users_guide_snippets/rails_spawn_method.txt +48 -0
  272. data/doc/users_guide_snippets/tips.txt +173 -0
  273. data/ext/apache2/Bucket.cpp +17 -12
  274. data/ext/apache2/Bucket.h +17 -12
  275. data/ext/apache2/Configuration.cpp +17 -12
  276. data/ext/apache2/Configuration.h +27 -14
  277. data/ext/apache2/DirectoryMapper.h +21 -12
  278. data/ext/apache2/Hooks.cpp +67 -21
  279. data/ext/apache2/Hooks.h +17 -12
  280. data/ext/apache2/mod_passenger.c +17 -12
  281. data/ext/{apache2 → common}/Application.h +19 -14
  282. data/ext/{apache2 → common}/ApplicationPool.h +17 -12
  283. data/ext/{apache2 → common}/ApplicationPoolServer.h +18 -72
  284. data/ext/{apache2 → common}/ApplicationPoolServerExecutable.cpp +45 -104
  285. data/ext/common/ApplicationPoolStatusReporter.h +212 -0
  286. data/ext/{apache2 → common}/CachedFileStat.cpp +17 -12
  287. data/ext/{apache2 → common}/CachedFileStat.h +17 -12
  288. data/ext/{apache2 → common}/DummySpawnManager.h +17 -12
  289. data/ext/{apache2 → common}/Exceptions.h +17 -12
  290. data/ext/{apache2 → common}/FileChecker.h +17 -12
  291. data/ext/common/Logging.cpp +65 -0
  292. data/ext/{apache2 → common}/Logging.h +17 -12
  293. data/ext/{apache2 → common}/MessageChannel.h +17 -12
  294. data/ext/{apache2 → common}/PoolOptions.h +17 -12
  295. data/ext/{apache2 → common}/SpawnManager.h +17 -12
  296. data/ext/{apache2 → common}/StandardApplicationPool.h +17 -12
  297. data/ext/common/StaticString.h +147 -0
  298. data/ext/common/SystemTime.cpp +33 -0
  299. data/ext/{apache2 → common}/SystemTime.h +17 -12
  300. data/ext/{apache2 → common}/Utils.cpp +69 -12
  301. data/ext/{apache2 → common}/Utils.h +41 -12
  302. data/ext/nginx/Configuration.c +1091 -0
  303. data/ext/nginx/Configuration.h +71 -0
  304. data/ext/nginx/ContentHandler.c +1154 -0
  305. data/ext/nginx/ContentHandler.h +64 -0
  306. data/ext/nginx/HelperServer.cpp +857 -0
  307. data/ext/nginx/HttpStatusExtractor.h +161 -0
  308. data/ext/nginx/ScgiRequestParser.h +317 -0
  309. data/ext/nginx/StaticContentHandler.c +222 -0
  310. data/ext/nginx/StaticContentHandler.h +37 -0
  311. data/ext/nginx/config +41 -0
  312. data/ext/nginx/ngx_http_passenger_module.c +572 -0
  313. data/ext/nginx/ngx_http_passenger_module.h +72 -0
  314. data/ext/oxt/backtrace.cpp +8 -1
  315. data/ext/oxt/system_calls.cpp +40 -0
  316. data/ext/oxt/system_calls.hpp +14 -7
  317. data/ext/phusion_passenger/extconf.rb +17 -12
  318. data/ext/phusion_passenger/native_support.c +19 -12
  319. data/lib/phusion_passenger/abstract_installer.rb +196 -0
  320. data/lib/phusion_passenger/abstract_request_handler.rb +19 -24
  321. data/lib/phusion_passenger/abstract_server.rb +17 -12
  322. data/lib/phusion_passenger/abstract_server_collection.rb +17 -12
  323. data/lib/phusion_passenger/admin_tools.rb +23 -0
  324. data/lib/phusion_passenger/admin_tools/control_process.rb +39 -13
  325. data/lib/phusion_passenger/application.rb +17 -12
  326. data/lib/phusion_passenger/console_text_template.rb +17 -12
  327. data/lib/phusion_passenger/constants.rb +22 -11
  328. data/lib/phusion_passenger/dependencies.rb +47 -12
  329. data/lib/phusion_passenger/events.rb +17 -12
  330. data/lib/phusion_passenger/exceptions.rb +17 -12
  331. data/lib/phusion_passenger/html_template.rb +17 -12
  332. data/lib/phusion_passenger/message_channel.rb +17 -12
  333. data/lib/phusion_passenger/packaging.rb +39 -0
  334. data/lib/phusion_passenger/platform_info.rb +48 -22
  335. data/lib/phusion_passenger/rack/application_spawner.rb +22 -11
  336. data/lib/phusion_passenger/rack/request_handler.rb +21 -12
  337. data/lib/phusion_passenger/railz/application_spawner.rb +23 -23
  338. data/lib/phusion_passenger/railz/framework_spawner.rb +18 -14
  339. data/lib/phusion_passenger/railz/request_handler.rb +18 -11
  340. data/lib/phusion_passenger/simple_benchmarking.rb +17 -12
  341. data/lib/phusion_passenger/spawn_manager.rb +17 -20
  342. data/lib/phusion_passenger/templates/{apache_must_be_compiled_with_compatible_mpm.txt.erb → apache2/apache_must_be_compiled_with_compatible_mpm.txt.erb} +0 -0
  343. data/lib/phusion_passenger/templates/{apache2_config_snippets.txt.erb → apache2/config_snippets.txt.erb} +0 -0
  344. data/lib/phusion_passenger/templates/{deployment_example.txt.erb → apache2/deployment_example.txt.erb} +0 -0
  345. data/lib/phusion_passenger/templates/{no_write_permission_to_passenger_root.txt.erb → apache2/no_write_permission_to_passenger_root.txt.erb} +0 -0
  346. data/lib/phusion_passenger/templates/{possible_solutions_for_compilation_and_installation_problems.txt.erb → apache2/possible_solutions_for_compilation_and_installation_problems.txt.erb} +0 -0
  347. data/lib/phusion_passenger/templates/{run_installer_as_root.txt.erb → apache2/run_installer_as_root.txt.erb} +0 -0
  348. data/lib/phusion_passenger/templates/{welcome.txt.erb → apache2/welcome.txt.erb} +0 -0
  349. data/lib/phusion_passenger/templates/nginx/ask_for_extra_configure_flags.txt.erb +8 -0
  350. data/lib/phusion_passenger/templates/nginx/cannot_write_to_dir.txt.erb +11 -0
  351. data/lib/phusion_passenger/templates/nginx/config_snippets.txt.erb +17 -0
  352. data/lib/phusion_passenger/templates/nginx/config_snippets_inserted.txt.erb +20 -0
  353. data/lib/phusion_passenger/templates/nginx/confirm_extra_configure_flags.txt.erb +5 -0
  354. data/lib/phusion_passenger/templates/nginx/deployment_example.txt.erb +22 -0
  355. data/lib/phusion_passenger/templates/nginx/pcre_could_not_be_downloaded.txt.erb +11 -0
  356. data/lib/phusion_passenger/templates/nginx/pcre_could_not_be_extracted.txt.erb +11 -0
  357. data/lib/phusion_passenger/templates/nginx/possible_solutions_for_compilation_and_installation_problems.txt.erb +11 -0
  358. data/lib/phusion_passenger/templates/nginx/possible_solutions_for_download_and_extraction_problems.txt.erb +20 -0
  359. data/lib/phusion_passenger/templates/nginx/query_download_and_install.txt.erb +21 -0
  360. data/lib/phusion_passenger/templates/nginx/run_installer_as_root.txt.erb +8 -0
  361. data/lib/phusion_passenger/templates/nginx/welcome.txt.erb +15 -0
  362. data/lib/phusion_passenger/utils.rb +20 -15
  363. data/lib/phusion_passenger/wsgi/application_spawner.rb +18 -11
  364. data/lib/phusion_passenger/wsgi/request_handler.py +23 -0
  365. data/misc/copy_boost_headers.rb +23 -0
  366. data/misc/find_owner_pipe_leaks.rb +18 -11
  367. data/misc/rake/cplusplus.rb +18 -11
  368. data/misc/rake/extensions.rb +21 -14
  369. data/misc/render_error_pages.rb +18 -11
  370. data/test/ApplicationPoolServerTest.cpp +1 -3
  371. data/test/ApplicationPoolServer_ApplicationPoolTest.cpp +1 -1
  372. data/test/CxxTestMain.cpp +19 -3
  373. data/test/HttpStatusExtractorTest.cpp +181 -0
  374. data/test/ScgiRequestParserTest.cpp +337 -0
  375. data/test/StaticStringTest.cpp +51 -0
  376. data/test/UtilsTest.cpp +32 -0
  377. data/test/config.yml.example +5 -0
  378. data/test/{integration_tests.rb → integration_tests/apache2_tests.rb} +7 -299
  379. data/test/integration_tests/hello_world_rack_spec.rb +36 -0
  380. data/test/integration_tests/hello_world_wsgi_spec.rb +41 -0
  381. data/test/integration_tests/mycook_spec.rb +192 -0
  382. data/test/integration_tests/nginx_tests.rb +98 -0
  383. data/test/ruby/rack/application_spawner_spec.rb +40 -0
  384. data/test/stub/nginx/koi-utf +109 -0
  385. data/test/stub/nginx/koi-win +103 -0
  386. data/test/stub/nginx/mime.types +70 -0
  387. data/test/stub/nginx/nginx.conf.erb +57 -0
  388. data/test/stub/nginx/win-utf +126 -0
  389. data/test/stub/rails_apps/mycook/app/controllers/uploads_controller.rb +4 -0
  390. data/test/stub/rails_apps/mycook/config/routes.rb +1 -1
  391. data/test/stub/wsgi/passenger_wsgi.pyc +0 -0
  392. data/test/support/Support.h +40 -0
  393. data/test/support/nginx_controller.rb +98 -0
  394. data/test/support/test_helper.rb +79 -0
  395. metadata +1091 -1028
  396. data/benchmark/DummyRequestHandler.cpp +0 -101
  397. data/ext/apache2/Logging.cpp +0 -60
  398. data/ext/apache2/SystemTime.cpp +0 -28
@@ -77,29 +77,29 @@ Object
77
77
 
78
78
  <div class="description"><p>
79
79
  An abstract base class for a <a
80
- href="AbstractServer.html#M000134">server</a>, with the following
80
+ href="AbstractServer.html#M000136">server</a>, with the following
81
81
  properties:
82
82
  </p>
83
83
  <ul>
84
- <li>The <a href="AbstractServer.html#M000134">server</a> has exactly one <a
85
- href="AbstractServer.html#M000135">client</a>, and is connected to that <a
86
- href="AbstractServer.html#M000135">client</a> at all times. The <a
87
- href="AbstractServer.html#M000134">server</a> will quit when the connection
84
+ <li>The <a href="AbstractServer.html#M000136">server</a> has exactly one <a
85
+ href="AbstractServer.html#M000137">client</a>, and is connected to that <a
86
+ href="AbstractServer.html#M000137">client</a> at all times. The <a
87
+ href="AbstractServer.html#M000136">server</a> will quit when the connection
88
88
  closes.
89
89
 
90
90
  </li>
91
- <li>The <a href="AbstractServer.html#M000134">server</a>&#8216;s main loop may
91
+ <li>The <a href="AbstractServer.html#M000136">server</a>&#8216;s main loop may
92
92
  be run in a child process (and so is asynchronous from the main process).
93
93
 
94
94
  </li>
95
95
  <li>One can communicate with the <a
96
- href="AbstractServer.html#M000134">server</a> through discrete messages (as
96
+ href="AbstractServer.html#M000136">server</a> through discrete messages (as
97
97
  opposed to byte streams).
98
98
 
99
99
  </li>
100
- <li>The <a href="AbstractServer.html#M000134">server</a> can pass file
100
+ <li>The <a href="AbstractServer.html#M000136">server</a> can pass file
101
101
  descriptors (<a href="../IO.html">IO</a> objects) back to the <a
102
- href="AbstractServer.html#M000135">client</a>.
102
+ href="AbstractServer.html#M000137">client</a>.
103
103
 
104
104
  </li>
105
105
  </ul>
@@ -108,17 +108,17 @@ A message is just an ordered list of strings. The first element in the
108
108
  message is the _message name_.
109
109
  </p>
110
110
  <p>
111
- The <a href="AbstractServer.html#M000134">server</a> will also reset all
111
+ The <a href="AbstractServer.html#M000136">server</a> will also reset all
112
112
  signal handlers (in the child process). That is, it will respond to all
113
113
  signals in the default manner. The only exception is SIGHUP, which is
114
114
  ignored. One may define additional signal handlers using <a
115
- href="AbstractServer.html#M000133">define_signal_handler</a>().
115
+ href="AbstractServer.html#M000135">define_signal_handler</a>().
116
116
  </p>
117
117
  <p>
118
118
  Before an <a href="AbstractServer.html">AbstractServer</a> can be used, it
119
119
  must first be started by calling <a
120
- href="AbstractServer.html#M000124">start</a>(). When it is no longer
121
- needed, <a href="AbstractServer.html#M000126">stop</a>() should be called.
120
+ href="AbstractServer.html#M000126">start</a>(). When it is no longer
121
+ needed, <a href="AbstractServer.html#M000128">stop</a>() should be called.
122
122
  </p>
123
123
  <p>
124
124
  Here&#8216;s an example on using <a
@@ -155,20 +155,20 @@ href="AbstractServer.html">AbstractServer</a>:
155
155
 
156
156
  <div class="sectiontitle">Methods</div>
157
157
  <ul>
158
- <li><a href="#M000129">before_fork</a></li>
159
- <li><a href="#M000135">client</a></li>
160
- <li><a href="#M000132">define_message_handler</a></li>
161
- <li><a href="#M000133">define_signal_handler</a></li>
162
- <li><a href="#M000131">finalize_server</a></li>
163
- <li><a href="#M000130">initialize_server</a></li>
164
- <li><a href="#M000123">new</a></li>
165
- <li><a href="#M000136">quit_main</a></li>
166
- <li><a href="#M000134">server</a></li>
167
- <li><a href="#M000128">server_pid</a></li>
168
- <li><a href="#M000124">start</a></li>
169
- <li><a href="#M000125">start_synchronously</a></li>
170
- <li><a href="#M000127">started?</a></li>
171
- <li><a href="#M000126">stop</a></li>
158
+ <li><a href="#M000131">before_fork</a></li>
159
+ <li><a href="#M000137">client</a></li>
160
+ <li><a href="#M000134">define_message_handler</a></li>
161
+ <li><a href="#M000135">define_signal_handler</a></li>
162
+ <li><a href="#M000133">finalize_server</a></li>
163
+ <li><a href="#M000132">initialize_server</a></li>
164
+ <li><a href="#M000125">new</a></li>
165
+ <li><a href="#M000138">quit_main</a></li>
166
+ <li><a href="#M000136">server</a></li>
167
+ <li><a href="#M000130">server_pid</a></li>
168
+ <li><a href="#M000126">start</a></li>
169
+ <li><a href="#M000127">start_synchronously</a></li>
170
+ <li><a href="#M000129">started?</a></li>
171
+ <li><a href="#M000128">stop</a></li>
172
172
  </ul>
173
173
 
174
174
  <div class="sectiontitle">Included Modules</div>
@@ -238,20 +238,20 @@ be idle cleaned.
238
238
  <div class="sectiontitle">Public Class methods</div>
239
239
  <div class="method">
240
240
  <div class="title">
241
- <a name="M000123"></a><b>new</b>()
241
+ <a name="M000125"></a><b>new</b>()
242
242
  </div>
243
243
  <div class="sourcecode">
244
- <p class="source-link">[ <a href="javascript:toggleSource('M000123_source')" id="l_M000123_source">show source</a> ]</p>
245
- <div id="M000123_source" class="dyn-source">
244
+ <p class="source-link">[ <a href="javascript:toggleSource('M000125_source')" id="l_M000125_source">show source</a> ]</p>
245
+ <div id="M000125_source" class="dyn-source">
246
246
  <pre>
247
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 103</span>
248
- 103: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
249
- 104: <span class="ruby-ivar">@done</span> = <span class="ruby-keyword kw">false</span>
250
- 105: <span class="ruby-ivar">@message_handlers</span> = {}
251
- 106: <span class="ruby-ivar">@signal_handlers</span> = {}
252
- 107: <span class="ruby-ivar">@orig_signal_handlers</span> = {}
253
- 108: <span class="ruby-ivar">@last_activity_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
254
- 109: <span class="ruby-keyword kw">end</span>
247
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 108</span>
248
+ 108: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
249
+ 109: <span class="ruby-ivar">@done</span> = <span class="ruby-keyword kw">false</span>
250
+ 110: <span class="ruby-ivar">@message_handlers</span> = {}
251
+ 111: <span class="ruby-ivar">@signal_handlers</span> = {}
252
+ 112: <span class="ruby-ivar">@orig_signal_handlers</span> = {}
253
+ 113: <span class="ruby-ivar">@last_activity_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
254
+ 114: <span class="ruby-keyword kw">end</span>
255
255
  </pre>
256
256
  </div>
257
257
  </div>
@@ -259,40 +259,40 @@ be idle cleaned.
259
259
  <div class="sectiontitle">Public Instance methods</div>
260
260
  <div class="method">
261
261
  <div class="title">
262
- <a name="M000128"></a><b>server_pid</b>()
262
+ <a name="M000130"></a><b>server_pid</b>()
263
263
  </div>
264
264
  <div class="description">
265
265
  <p>
266
266
  Return the PID of the started <a
267
- href="AbstractServer.html#M000134">server</a>. This is only valid if <a
268
- href="AbstractServer.html#M000124">start</a>() has been called.
267
+ href="AbstractServer.html#M000136">server</a>. This is only valid if <a
268
+ href="AbstractServer.html#M000126">start</a>() has been called.
269
269
  </p>
270
270
  </div>
271
271
  <div class="sourcecode">
272
- <p class="source-link">[ <a href="javascript:toggleSource('M000128_source')" id="l_M000128_source">show source</a> ]</p>
273
- <div id="M000128_source" class="dyn-source">
272
+ <p class="source-link">[ <a href="javascript:toggleSource('M000130_source')" id="l_M000130_source">show source</a> ]</p>
273
+ <div id="M000130_source" class="dyn-source">
274
274
  <pre>
275
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 230</span>
276
- 230: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server_pid</span>
277
- 231: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@pid</span>
278
- 232: <span class="ruby-keyword kw">end</span>
275
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 235</span>
276
+ 235: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server_pid</span>
277
+ 236: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@pid</span>
278
+ 237: <span class="ruby-keyword kw">end</span>
279
279
  </pre>
280
280
  </div>
281
281
  </div>
282
282
  </div>
283
283
  <div class="method">
284
284
  <div class="title">
285
- <a name="M000124"></a><b>start</b>()
285
+ <a name="M000126"></a><b>start</b>()
286
286
  </div>
287
287
  <div class="description">
288
288
  <p>
289
- Start the <a href="AbstractServer.html#M000134">server</a>. This method
290
- does not block since the <a href="AbstractServer.html#M000134">server</a>
289
+ Start the <a href="AbstractServer.html#M000136">server</a>. This method
290
+ does not block since the <a href="AbstractServer.html#M000136">server</a>
291
291
  runs asynchronously from the current process.
292
292
  </p>
293
293
  <p>
294
294
  You may only call this method if the <a
295
- href="AbstractServer.html#M000134">server</a> is not already started.
295
+ href="AbstractServer.html#M000136">server</a> is not already started.
296
296
  Otherwise, a <a
297
297
  href="AbstractServer/ServerAlreadyStarted.html">ServerAlreadyStarted</a>
298
298
  will be raised.
@@ -302,181 +302,181 @@ Derived classes may raise additional exceptions.
302
302
  </p>
303
303
  </div>
304
304
  <div class="sourcecode">
305
- <p class="source-link">[ <a href="javascript:toggleSource('M000124_source')" id="l_M000124_source">show source</a> ]</p>
306
- <div id="M000124_source" class="dyn-source">
305
+ <p class="source-link">[ <a href="javascript:toggleSource('M000126_source')" id="l_M000126_source">show source</a> ]</p>
306
+ <div id="M000126_source" class="dyn-source">
307
307
  <pre>
308
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 118</span>
309
- 118: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
310
- 119: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">started?</span>
311
- 120: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ServerAlreadyStarted</span>, <span class="ruby-value str">&quot;Server is already started&quot;</span>
312
- 121: <span class="ruby-keyword kw">end</span>
313
- 122:
314
- 123: <span class="ruby-ivar">@parent_socket</span>, <span class="ruby-ivar">@child_socket</span> = <span class="ruby-constant">UNIXSocket</span>.<span class="ruby-identifier">pair</span>
315
- 124: <span class="ruby-identifier">before_fork</span>
316
- 125: <span class="ruby-ivar">@pid</span> = <span class="ruby-identifier">fork</span>
317
- 126: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@pid</span>.<span class="ruby-identifier">nil?</span>
318
- 127: <span class="ruby-keyword kw">begin</span>
319
- 128: <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
320
- 129: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
321
- 130: <span class="ruby-ivar">@parent_socket</span>.<span class="ruby-identifier">close</span>
322
- 131:
323
- 132: <span class="ruby-comment cmt"># During Passenger's early days, we used to close file descriptors based</span>
324
- 133: <span class="ruby-comment cmt"># on a white list of file descriptors. That proved to be way too fragile:</span>
325
- 134: <span class="ruby-comment cmt"># too many file descriptors are being left open even though they shouldn't</span>
326
- 135: <span class="ruby-comment cmt"># be. So now we close file descriptors based on a black list.</span>
327
- 136: <span class="ruby-identifier">file_descriptors_to_leave_open</span> = [<span class="ruby-value">0</span>, <span class="ruby-value">1</span>, <span class="ruby-value">2</span>, <span class="ruby-ivar">@child_socket</span>.<span class="ruby-identifier">fileno</span>]
328
- 137: <span class="ruby-constant">NativeSupport</span>.<span class="ruby-identifier">close_all_file_descriptors</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
329
- 138: <span class="ruby-comment cmt"># In addition to closing the file descriptors, one must also close</span>
330
- 139: <span class="ruby-comment cmt"># the associated IO objects. This is to prevent IO.close from</span>
331
- 140: <span class="ruby-comment cmt"># double-closing already closed file descriptors.</span>
332
- 141: <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
333
- 142:
334
- 143: <span class="ruby-comment cmt"># At this point, RubyGems might have open file handles for which</span>
335
- 144: <span class="ruby-comment cmt"># the associated file descriptors have just been closed. This can</span>
336
- 145: <span class="ruby-comment cmt"># result in mysterious 'EBADFD' errors. So we force RubyGems to</span>
337
- 146: <span class="ruby-comment cmt"># clear all open file handles.</span>
338
- 147: <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">clear_paths</span>
339
- 148:
340
- 149: <span class="ruby-identifier">start_synchronously</span>(<span class="ruby-ivar">@child_socket</span>)
341
- 150: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Interrupt</span>
342
- 151: <span class="ruby-comment cmt"># Do nothing.</span>
343
- 152: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SignalException</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">signal</span>
344
- 153: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">signal</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">==</span> <span class="ruby-constant">SERVER_TERMINATION_SIGNAL</span>
345
- 154: <span class="ruby-comment cmt"># Do nothing.</span>
346
- 155: <span class="ruby-keyword kw">else</span>
347
- 156: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">signal</span>)
348
- 157: <span class="ruby-keyword kw">end</span>
349
- 158: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
350
- 159: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>)
351
- 160: <span class="ruby-keyword kw">ensure</span>
352
- 161: <span class="ruby-identifier">exit!</span>
353
- 162: <span class="ruby-keyword kw">end</span>
354
- 163: <span class="ruby-keyword kw">end</span>
355
- 164: <span class="ruby-ivar">@child_socket</span>.<span class="ruby-identifier">close</span>
356
- 165: <span class="ruby-ivar">@parent_channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@parent_socket</span>)
357
- 166: <span class="ruby-keyword kw">end</span>
308
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 123</span>
309
+ 123: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
310
+ 124: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">started?</span>
311
+ 125: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ServerAlreadyStarted</span>, <span class="ruby-value str">&quot;Server is already started&quot;</span>
312
+ 126: <span class="ruby-keyword kw">end</span>
313
+ 127:
314
+ 128: <span class="ruby-ivar">@parent_socket</span>, <span class="ruby-ivar">@child_socket</span> = <span class="ruby-constant">UNIXSocket</span>.<span class="ruby-identifier">pair</span>
315
+ 129: <span class="ruby-identifier">before_fork</span>
316
+ 130: <span class="ruby-ivar">@pid</span> = <span class="ruby-identifier">fork</span>
317
+ 131: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@pid</span>.<span class="ruby-identifier">nil?</span>
318
+ 132: <span class="ruby-keyword kw">begin</span>
319
+ 133: <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
320
+ 134: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
321
+ 135: <span class="ruby-ivar">@parent_socket</span>.<span class="ruby-identifier">close</span>
322
+ 136:
323
+ 137: <span class="ruby-comment cmt"># During Passenger's early days, we used to close file descriptors based</span>
324
+ 138: <span class="ruby-comment cmt"># on a white list of file descriptors. That proved to be way too fragile:</span>
325
+ 139: <span class="ruby-comment cmt"># too many file descriptors are being left open even though they shouldn't</span>
326
+ 140: <span class="ruby-comment cmt"># be. So now we close file descriptors based on a black list.</span>
327
+ 141: <span class="ruby-identifier">file_descriptors_to_leave_open</span> = [<span class="ruby-value">0</span>, <span class="ruby-value">1</span>, <span class="ruby-value">2</span>, <span class="ruby-ivar">@child_socket</span>.<span class="ruby-identifier">fileno</span>]
328
+ 142: <span class="ruby-constant">NativeSupport</span>.<span class="ruby-identifier">close_all_file_descriptors</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
329
+ 143: <span class="ruby-comment cmt"># In addition to closing the file descriptors, one must also close</span>
330
+ 144: <span class="ruby-comment cmt"># the associated IO objects. This is to prevent IO.close from</span>
331
+ 145: <span class="ruby-comment cmt"># double-closing already closed file descriptors.</span>
332
+ 146: <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
333
+ 147:
334
+ 148: <span class="ruby-comment cmt"># At this point, RubyGems might have open file handles for which</span>
335
+ 149: <span class="ruby-comment cmt"># the associated file descriptors have just been closed. This can</span>
336
+ 150: <span class="ruby-comment cmt"># result in mysterious 'EBADFD' errors. So we force RubyGems to</span>
337
+ 151: <span class="ruby-comment cmt"># clear all open file handles.</span>
338
+ 152: <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">clear_paths</span>
339
+ 153:
340
+ 154: <span class="ruby-identifier">start_synchronously</span>(<span class="ruby-ivar">@child_socket</span>)
341
+ 155: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Interrupt</span>
342
+ 156: <span class="ruby-comment cmt"># Do nothing.</span>
343
+ 157: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SignalException</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">signal</span>
344
+ 158: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">signal</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">==</span> <span class="ruby-constant">SERVER_TERMINATION_SIGNAL</span>
345
+ 159: <span class="ruby-comment cmt"># Do nothing.</span>
346
+ 160: <span class="ruby-keyword kw">else</span>
347
+ 161: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">signal</span>)
348
+ 162: <span class="ruby-keyword kw">end</span>
349
+ 163: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
350
+ 164: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>)
351
+ 165: <span class="ruby-keyword kw">ensure</span>
352
+ 166: <span class="ruby-identifier">exit!</span>
353
+ 167: <span class="ruby-keyword kw">end</span>
354
+ 168: <span class="ruby-keyword kw">end</span>
355
+ 169: <span class="ruby-ivar">@child_socket</span>.<span class="ruby-identifier">close</span>
356
+ 170: <span class="ruby-ivar">@parent_channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@parent_socket</span>)
357
+ 171: <span class="ruby-keyword kw">end</span>
358
358
  </pre>
359
359
  </div>
360
360
  </div>
361
361
  </div>
362
362
  <div class="method">
363
363
  <div class="title">
364
- <a name="M000125"></a><b>start_synchronously</b>(socket)
364
+ <a name="M000127"></a><b>start_synchronously</b>(socket)
365
365
  </div>
366
366
  <div class="description">
367
367
  <p>
368
- Start the <a href="AbstractServer.html#M000134">server</a>, but in the
368
+ Start the <a href="AbstractServer.html#M000136">server</a>, but in the
369
369
  current process instead of in a child process. This method blocks until the
370
- <a href="AbstractServer.html#M000134">server</a>&#8216;s main loop has
370
+ <a href="AbstractServer.html#M000136">server</a>&#8216;s main loop has
371
371
  ended.
372
372
  </p>
373
373
  <p>
374
374
  <em>socket</em> is the socket that the <a
375
- href="AbstractServer.html#M000134">server</a> should listen on. The <a
376
- href="AbstractServer.html#M000134">server</a> main loop will end if the
375
+ href="AbstractServer.html#M000136">server</a> should listen on. The <a
376
+ href="AbstractServer.html#M000136">server</a> main loop will end if the
377
377
  socket has been closed.
378
378
  </p>
379
379
  <p>
380
380
  All hooks will be called, except <a
381
- href="AbstractServer.html#M000129">before_fork</a>().
381
+ href="AbstractServer.html#M000131">before_fork</a>().
382
382
  </p>
383
383
  </div>
384
384
  <div class="sourcecode">
385
- <p class="source-link">[ <a href="javascript:toggleSource('M000125_source')" id="l_M000125_source">show source</a> ]</p>
386
- <div id="M000125_source" class="dyn-source">
385
+ <p class="source-link">[ <a href="javascript:toggleSource('M000127_source')" id="l_M000127_source">show source</a> ]</p>
386
+ <div id="M000127_source" class="dyn-source">
387
387
  <pre>
388
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 175</span>
389
- 175: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_synchronously</span>(<span class="ruby-identifier">socket</span>)
390
- 176: <span class="ruby-ivar">@child_socket</span> = <span class="ruby-identifier">socket</span>
391
- 177: <span class="ruby-ivar">@child_channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">socket</span>)
392
- 178: <span class="ruby-keyword kw">begin</span>
393
- 179: <span class="ruby-identifier">reset_signal_handlers</span>
394
- 180: <span class="ruby-identifier">initialize_server</span>
395
- 181: <span class="ruby-keyword kw">begin</span>
396
- 182: <span class="ruby-identifier">main_loop</span>
397
- 183: <span class="ruby-keyword kw">ensure</span>
398
- 184: <span class="ruby-identifier">finalize_server</span>
399
- 185: <span class="ruby-keyword kw">end</span>
400
- 186: <span class="ruby-keyword kw">ensure</span>
401
- 187: <span class="ruby-identifier">revert_signal_handlers</span>
402
- 188: <span class="ruby-keyword kw">end</span>
403
- 189: <span class="ruby-keyword kw">end</span>
388
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 180</span>
389
+ 180: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_synchronously</span>(<span class="ruby-identifier">socket</span>)
390
+ 181: <span class="ruby-ivar">@child_socket</span> = <span class="ruby-identifier">socket</span>
391
+ 182: <span class="ruby-ivar">@child_channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">socket</span>)
392
+ 183: <span class="ruby-keyword kw">begin</span>
393
+ 184: <span class="ruby-identifier">reset_signal_handlers</span>
394
+ 185: <span class="ruby-identifier">initialize_server</span>
395
+ 186: <span class="ruby-keyword kw">begin</span>
396
+ 187: <span class="ruby-identifier">main_loop</span>
397
+ 188: <span class="ruby-keyword kw">ensure</span>
398
+ 189: <span class="ruby-identifier">finalize_server</span>
399
+ 190: <span class="ruby-keyword kw">end</span>
400
+ 191: <span class="ruby-keyword kw">ensure</span>
401
+ 192: <span class="ruby-identifier">revert_signal_handlers</span>
402
+ 193: <span class="ruby-keyword kw">end</span>
403
+ 194: <span class="ruby-keyword kw">end</span>
404
404
  </pre>
405
405
  </div>
406
406
  </div>
407
407
  </div>
408
408
  <div class="method">
409
409
  <div class="title">
410
- <a name="M000127"></a><b>started?</b>()
410
+ <a name="M000129"></a><b>started?</b>()
411
411
  </div>
412
412
  <div class="description">
413
413
  <p>
414
- Return whether the <a href="AbstractServer.html#M000134">server</a> has
414
+ Return whether the <a href="AbstractServer.html#M000136">server</a> has
415
415
  been started.
416
416
  </p>
417
417
  </div>
418
418
  <div class="sourcecode">
419
- <p class="source-link">[ <a href="javascript:toggleSource('M000127_source')" id="l_M000127_source">show source</a> ]</p>
420
- <div id="M000127_source" class="dyn-source">
419
+ <p class="source-link">[ <a href="javascript:toggleSource('M000129_source')" id="l_M000129_source">show source</a> ]</p>
420
+ <div id="M000129_source" class="dyn-source">
421
421
  <pre>
422
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 225</span>
423
- 225: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">started?</span>
424
- 226: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@parent_channel</span>.<span class="ruby-identifier">nil?</span>
425
- 227: <span class="ruby-keyword kw">end</span>
422
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 230</span>
423
+ 230: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">started?</span>
424
+ 231: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@parent_channel</span>.<span class="ruby-identifier">nil?</span>
425
+ 232: <span class="ruby-keyword kw">end</span>
426
426
  </pre>
427
427
  </div>
428
428
  </div>
429
429
  </div>
430
430
  <div class="method">
431
431
  <div class="title">
432
- <a name="M000126"></a><b>stop</b>()
432
+ <a name="M000128"></a><b>stop</b>()
433
433
  </div>
434
434
  <div class="description">
435
435
  <p>
436
- Stop the <a href="AbstractServer.html#M000134">server</a>. The <a
437
- href="AbstractServer.html#M000134">server</a> will quit as soon as
436
+ Stop the <a href="AbstractServer.html#M000136">server</a>. The <a
437
+ href="AbstractServer.html#M000136">server</a> will quit as soon as
438
438
  possible. This method waits until the <a
439
- href="AbstractServer.html#M000134">server</a> has been stopped.
439
+ href="AbstractServer.html#M000136">server</a> has been stopped.
440
440
  </p>
441
441
  <p>
442
442
  When calling this method, the <a
443
- href="AbstractServer.html#M000134">server</a> must already be started. If
443
+ href="AbstractServer.html#M000136">server</a> must already be started. If
444
444
  not, a <a href="AbstractServer/ServerNotStarted.html">ServerNotStarted</a>
445
445
  will be raised.
446
446
  </p>
447
447
  </div>
448
448
  <div class="sourcecode">
449
- <p class="source-link">[ <a href="javascript:toggleSource('M000126_source')" id="l_M000126_source">show source</a> ]</p>
450
- <div id="M000126_source" class="dyn-source">
449
+ <p class="source-link">[ <a href="javascript:toggleSource('M000128_source')" id="l_M000128_source">show source</a> ]</p>
450
+ <div id="M000128_source" class="dyn-source">
451
451
  <pre>
452
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 196</span>
453
- 196: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
454
- 197: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">started?</span>
455
- 198: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ServerNotStarted</span>, <span class="ruby-value str">&quot;Server is not started&quot;</span>
456
- 199: <span class="ruby-keyword kw">end</span>
457
- 200:
458
- 201: <span class="ruby-ivar">@parent_socket</span>.<span class="ruby-identifier">close</span>
459
- 202: <span class="ruby-ivar">@parent_channel</span> = <span class="ruby-keyword kw">nil</span>
460
- 203:
461
- 204: <span class="ruby-comment cmt"># Wait at most 3 seconds for server to exit. If it doesn't do that,</span>
462
- 205: <span class="ruby-comment cmt"># we kill it. If that doesn't work either, we kill it forcefully with</span>
463
- 206: <span class="ruby-comment cmt"># SIGKILL.</span>
464
- 207: <span class="ruby-keyword kw">begin</span>
465
- 208: <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-value">3</span>) <span class="ruby-keyword kw">do</span>
466
- 209: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
467
- 210: <span class="ruby-keyword kw">end</span>
468
- 211: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
469
- 212: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-constant">SERVER_TERMINATION_SIGNAL</span>, <span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
470
- 213: <span class="ruby-keyword kw">begin</span>
471
- 214: <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-value">3</span>) <span class="ruby-keyword kw">do</span>
472
- 215: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
473
- 216: <span class="ruby-keyword kw">end</span>
474
- 217: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
475
- 218: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-value str">'SIGKILL'</span>, <span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
476
- 219: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-ivar">@pid</span>, <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-constant">WNOHANG</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
477
- 220: <span class="ruby-keyword kw">end</span>
478
- 221: <span class="ruby-keyword kw">end</span>
479
- 222: <span class="ruby-keyword kw">end</span>
452
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 201</span>
453
+ 201: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
454
+ 202: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">started?</span>
455
+ 203: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ServerNotStarted</span>, <span class="ruby-value str">&quot;Server is not started&quot;</span>
456
+ 204: <span class="ruby-keyword kw">end</span>
457
+ 205:
458
+ 206: <span class="ruby-ivar">@parent_socket</span>.<span class="ruby-identifier">close</span>
459
+ 207: <span class="ruby-ivar">@parent_channel</span> = <span class="ruby-keyword kw">nil</span>
460
+ 208:
461
+ 209: <span class="ruby-comment cmt"># Wait at most 3 seconds for server to exit. If it doesn't do that,</span>
462
+ 210: <span class="ruby-comment cmt"># we kill it. If that doesn't work either, we kill it forcefully with</span>
463
+ 211: <span class="ruby-comment cmt"># SIGKILL.</span>
464
+ 212: <span class="ruby-keyword kw">begin</span>
465
+ 213: <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-value">3</span>) <span class="ruby-keyword kw">do</span>
466
+ 214: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
467
+ 215: <span class="ruby-keyword kw">end</span>
468
+ 216: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
469
+ 217: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-constant">SERVER_TERMINATION_SIGNAL</span>, <span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
470
+ 218: <span class="ruby-keyword kw">begin</span>
471
+ 219: <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-value">3</span>) <span class="ruby-keyword kw">do</span>
472
+ 220: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
473
+ 221: <span class="ruby-keyword kw">end</span>
474
+ 222: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
475
+ 223: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-value str">'SIGKILL'</span>, <span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
476
+ 224: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-ivar">@pid</span>, <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-constant">WNOHANG</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
477
+ 225: <span class="ruby-keyword kw">end</span>
478
+ 226: <span class="ruby-keyword kw">end</span>
479
+ 227: <span class="ruby-keyword kw">end</span>
480
480
  </pre>
481
481
  </div>
482
482
  </div>
@@ -484,55 +484,55 @@ will be raised.
484
484
  <div class="sectiontitle">Protected Instance methods</div>
485
485
  <div class="method">
486
486
  <div class="title">
487
- <a name="M000129"></a><b>before_fork</b>()
487
+ <a name="M000131"></a><b>before_fork</b>()
488
488
  </div>
489
489
  <div class="description">
490
490
  <p>
491
491
  A hook which is called when the <a
492
- href="AbstractServer.html#M000134">server</a> is being started, just before
493
- forking a <a href="AbstractServer.html#M000123">new</a> process. The
492
+ href="AbstractServer.html#M000136">server</a> is being started, just before
493
+ forking a <a href="AbstractServer.html#M000125">new</a> process. The
494
494
  default implementation does nothing, this method is supposed to be
495
495
  overrided by child classes.
496
496
  </p>
497
497
  </div>
498
498
  <div class="sourcecode">
499
- <p class="source-link">[ <a href="javascript:toggleSource('M000129_source')" id="l_M000129_source">show source</a> ]</p>
500
- <div id="M000129_source" class="dyn-source">
499
+ <p class="source-link">[ <a href="javascript:toggleSource('M000131_source')" id="l_M000131_source">show source</a> ]</p>
500
+ <div id="M000131_source" class="dyn-source">
501
501
  <pre>
502
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 237</span>
503
- 237: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">before_fork</span>
504
- 238: <span class="ruby-keyword kw">end</span>
502
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 242</span>
503
+ 242: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">before_fork</span>
504
+ 243: <span class="ruby-keyword kw">end</span>
505
505
  </pre>
506
506
  </div>
507
507
  </div>
508
508
  </div>
509
509
  <div class="method">
510
510
  <div class="title">
511
- <a name="M000135"></a><b>client</b>()
511
+ <a name="M000137"></a><b>client</b>()
512
512
  </div>
513
513
  <div class="description">
514
514
  <p>
515
515
  Return the communication channel with the <a
516
- href="AbstractServer.html#M000135">client</a> (i.e. the parent process that
517
- started the <a href="AbstractServer.html#M000134">server</a>). This is a <a
516
+ href="AbstractServer.html#M000137">client</a> (i.e. the parent process that
517
+ started the <a href="AbstractServer.html#M000136">server</a>). This is a <a
518
518
  href="MessageChannel.html">MessageChannel</a> object.
519
519
  </p>
520
520
  </div>
521
521
  <div class="sourcecode">
522
- <p class="source-link">[ <a href="javascript:toggleSource('M000135_source')" id="l_M000135_source">show source</a> ]</p>
523
- <div id="M000135_source" class="dyn-source">
522
+ <p class="source-link">[ <a href="javascript:toggleSource('M000137_source')" id="l_M000137_source">show source</a> ]</p>
523
+ <div id="M000137_source" class="dyn-source">
524
524
  <pre>
525
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 282</span>
526
- 282: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client</span>
527
- 283: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@child_channel</span>
528
- 284: <span class="ruby-keyword kw">end</span>
525
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 287</span>
526
+ 287: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client</span>
527
+ 288: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@child_channel</span>
528
+ 289: <span class="ruby-keyword kw">end</span>
529
529
  </pre>
530
530
  </div>
531
531
  </div>
532
532
  </div>
533
533
  <div class="method">
534
534
  <div class="title">
535
- <a name="M000132"></a><b>define_message_handler</b>(message_name, handler)
535
+ <a name="M000134"></a><b>define_message_handler</b>(message_name, handler)
536
536
  </div>
537
537
  <div class="description">
538
538
  <p>
@@ -547,20 +547,20 @@ the example in the class description.
547
547
  </p>
548
548
  </div>
549
549
  <div class="sourcecode">
550
- <p class="source-link">[ <a href="javascript:toggleSource('M000132_source')" id="l_M000132_source">show source</a> ]</p>
551
- <div id="M000132_source" class="dyn-source">
550
+ <p class="source-link">[ <a href="javascript:toggleSource('M000134_source')" id="l_M000134_source">show source</a> ]</p>
551
+ <div id="M000134_source" class="dyn-source">
552
552
  <pre>
553
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 257</span>
554
- 257: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">message_name</span>, <span class="ruby-identifier">handler</span>)
555
- 258: <span class="ruby-ivar">@message_handlers</span>[<span class="ruby-identifier">message_name</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">handler</span>
556
- 259: <span class="ruby-keyword kw">end</span>
553
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 262</span>
554
+ 262: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">message_name</span>, <span class="ruby-identifier">handler</span>)
555
+ 263: <span class="ruby-ivar">@message_handlers</span>[<span class="ruby-identifier">message_name</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">handler</span>
556
+ 264: <span class="ruby-keyword kw">end</span>
557
557
  </pre>
558
558
  </div>
559
559
  </div>
560
560
  </div>
561
561
  <div class="method">
562
562
  <div class="title">
563
- <a name="M000133"></a><b>define_signal_handler</b>(signal, handler)
563
+ <a name="M000135"></a><b>define_signal_handler</b>(signal, handler)
564
564
  </div>
565
565
  <div class="description">
566
566
  <p>
@@ -568,118 +568,118 @@ Define a handler for a signal.
568
568
  </p>
569
569
  </div>
570
570
  <div class="sourcecode">
571
- <p class="source-link">[ <a href="javascript:toggleSource('M000133_source')" id="l_M000133_source">show source</a> ]</p>
572
- <div id="M000133_source" class="dyn-source">
571
+ <p class="source-link">[ <a href="javascript:toggleSource('M000135_source')" id="l_M000135_source">show source</a> ]</p>
572
+ <div id="M000135_source" class="dyn-source">
573
573
  <pre>
574
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 262</span>
575
- 262: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">define_signal_handler</span>(<span class="ruby-identifier">signal</span>, <span class="ruby-identifier">handler</span>)
576
- 263: <span class="ruby-ivar">@signal_handlers</span>[<span class="ruby-identifier">signal</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">handler</span>
577
- 264: <span class="ruby-keyword kw">end</span>
574
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 267</span>
575
+ 267: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">define_signal_handler</span>(<span class="ruby-identifier">signal</span>, <span class="ruby-identifier">handler</span>)
576
+ 268: <span class="ruby-ivar">@signal_handlers</span>[<span class="ruby-identifier">signal</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">handler</span>
577
+ 269: <span class="ruby-keyword kw">end</span>
578
578
  </pre>
579
579
  </div>
580
580
  </div>
581
581
  </div>
582
582
  <div class="method">
583
583
  <div class="title">
584
- <a name="M000131"></a><b>finalize_server</b>()
584
+ <a name="M000133"></a><b>finalize_server</b>()
585
585
  </div>
586
586
  <div class="description">
587
587
  <p>
588
588
  A hook which is called when the <a
589
- href="AbstractServer.html#M000134">server</a> is being stopped. This is
589
+ href="AbstractServer.html#M000136">server</a> is being stopped. This is
590
590
  called in the child process, after the main loop has been left. The default
591
591
  implementation does nothing, this method is supposed to be overrided by
592
592
  child classes.
593
593
  </p>
594
594
  </div>
595
595
  <div class="sourcecode">
596
- <p class="source-link">[ <a href="javascript:toggleSource('M000131_source')" id="l_M000131_source">show source</a> ]</p>
597
- <div id="M000131_source" class="dyn-source">
596
+ <p class="source-link">[ <a href="javascript:toggleSource('M000133_source')" id="l_M000133_source">show source</a> ]</p>
597
+ <div id="M000133_source" class="dyn-source">
598
598
  <pre>
599
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 249</span>
600
- 249: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">finalize_server</span>
601
- 250: <span class="ruby-keyword kw">end</span>
599
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 254</span>
600
+ 254: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">finalize_server</span>
601
+ 255: <span class="ruby-keyword kw">end</span>
602
602
  </pre>
603
603
  </div>
604
604
  </div>
605
605
  </div>
606
606
  <div class="method">
607
607
  <div class="title">
608
- <a name="M000130"></a><b>initialize_server</b>()
608
+ <a name="M000132"></a><b>initialize_server</b>()
609
609
  </div>
610
610
  <div class="description">
611
611
  <p>
612
612
  A hook which is called when the <a
613
- href="AbstractServer.html#M000134">server</a> is being started. This is
613
+ href="AbstractServer.html#M000136">server</a> is being started. This is
614
614
  called in the child process, before the main loop is entered. The default
615
615
  implementation does nothing, this method is supposed to be overrided by
616
616
  child classes.
617
617
  </p>
618
618
  </div>
619
619
  <div class="sourcecode">
620
- <p class="source-link">[ <a href="javascript:toggleSource('M000130_source')" id="l_M000130_source">show source</a> ]</p>
621
- <div id="M000130_source" class="dyn-source">
620
+ <p class="source-link">[ <a href="javascript:toggleSource('M000132_source')" id="l_M000132_source">show source</a> ]</p>
621
+ <div id="M000132_source" class="dyn-source">
622
622
  <pre>
623
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 243</span>
624
- 243: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_server</span>
625
- 244: <span class="ruby-keyword kw">end</span>
623
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 248</span>
624
+ 248: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_server</span>
625
+ 249: <span class="ruby-keyword kw">end</span>
626
626
  </pre>
627
627
  </div>
628
628
  </div>
629
629
  </div>
630
630
  <div class="method">
631
631
  <div class="title">
632
- <a name="M000136"></a><b>quit_main</b>()
632
+ <a name="M000138"></a><b>quit_main</b>()
633
633
  </div>
634
634
  <div class="description">
635
635
  <p>
636
- Tell the main loop to <a href="AbstractServer.html#M000126">stop</a> as
636
+ Tell the main loop to <a href="AbstractServer.html#M000128">stop</a> as
637
637
  soon as possible.
638
638
  </p>
639
639
  </div>
640
640
  <div class="sourcecode">
641
- <p class="source-link">[ <a href="javascript:toggleSource('M000136_source')" id="l_M000136_source">show source</a> ]</p>
642
- <div id="M000136_source" class="dyn-source">
641
+ <p class="source-link">[ <a href="javascript:toggleSource('M000138_source')" id="l_M000138_source">show source</a> ]</p>
642
+ <div id="M000138_source" class="dyn-source">
643
643
  <pre>
644
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 287</span>
645
- 287: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quit_main</span>
646
- 288: <span class="ruby-ivar">@done</span> = <span class="ruby-keyword kw">true</span>
647
- 289: <span class="ruby-keyword kw">end</span>
644
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 292</span>
645
+ 292: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quit_main</span>
646
+ 293: <span class="ruby-ivar">@done</span> = <span class="ruby-keyword kw">true</span>
647
+ 294: <span class="ruby-keyword kw">end</span>
648
648
  </pre>
649
649
  </div>
650
650
  </div>
651
651
  </div>
652
652
  <div class="method">
653
653
  <div class="title">
654
- <a name="M000134"></a><b>server</b>()
654
+ <a name="M000136"></a><b>server</b>()
655
655
  </div>
656
656
  <div class="description">
657
657
  <p>
658
658
  Return the communication channel with the <a
659
- href="AbstractServer.html#M000134">server</a>. This is a <a
659
+ href="AbstractServer.html#M000136">server</a>. This is a <a
660
660
  href="MessageChannel.html">MessageChannel</a> object.
661
661
  </p>
662
662
  <p>
663
663
  Raises <a href="AbstractServer/ServerNotStarted.html">ServerNotStarted</a>
664
- if the <a href="AbstractServer.html#M000134">server</a> hasn&#8216;t been
664
+ if the <a href="AbstractServer.html#M000136">server</a> hasn&#8216;t been
665
665
  started yet.
666
666
  </p>
667
667
  <p>
668
668
  This method may only be called in the parent process, and not in the
669
- started <a href="AbstractServer.html#M000134">server</a> process.
669
+ started <a href="AbstractServer.html#M000136">server</a> process.
670
670
  </p>
671
671
  </div>
672
672
  <div class="sourcecode">
673
- <p class="source-link">[ <a href="javascript:toggleSource('M000134_source')" id="l_M000134_source">show source</a> ]</p>
674
- <div id="M000134_source" class="dyn-source">
673
+ <p class="source-link">[ <a href="javascript:toggleSource('M000136_source')" id="l_M000136_source">show source</a> ]</p>
674
+ <div id="M000136_source" class="dyn-source">
675
675
  <pre>
676
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 273</span>
677
- 273: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server</span>
678
- 274: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">started?</span>
679
- 275: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ServerNotStarted</span>, <span class="ruby-value str">&quot;Server hasn't been started yet. Please call start() first.&quot;</span>
680
- 276: <span class="ruby-keyword kw">end</span>
681
- 277: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@parent_channel</span>
682
- 278: <span class="ruby-keyword kw">end</span>
676
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server.rb, line 278</span>
677
+ 278: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server</span>
678
+ 279: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">started?</span>
679
+ 280: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ServerNotStarted</span>, <span class="ruby-value str">&quot;Server hasn't been started yet. Please call start() first.&quot;</span>
680
+ 281: <span class="ruby-keyword kw">end</span>
681
+ 282: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@parent_channel</span>
682
+ 283: <span class="ruby-keyword kw">end</span>
683
683
  </pre>
684
684
  </div>
685
685
  </div>