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
@@ -0,0 +1,153 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+ <html>
6
+ <head>
7
+ <title>Class: PhusionPassenger::AbstractInstaller</title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
+
11
+ <script language="JavaScript" type="text/javascript">
12
+ // <![CDATA[
13
+
14
+ function toggleSource( id )
15
+ {
16
+ var elem
17
+ var link
18
+
19
+ if( document.getElementById )
20
+ {
21
+ elem = document.getElementById( id )
22
+ link = document.getElementById( "l_" + id )
23
+ }
24
+ else if ( document.all )
25
+ {
26
+ elem = eval( "document.all." + id )
27
+ link = eval( "document.all.l_" + id )
28
+ }
29
+ else
30
+ return false;
31
+
32
+ if( elem.style.display == "block" )
33
+ {
34
+ elem.style.display = "none"
35
+ link.innerHTML = "show source"
36
+ }
37
+ else
38
+ {
39
+ elem.style.display = "block"
40
+ link.innerHTML = "hide source"
41
+ }
42
+ }
43
+
44
+ function openCode( url )
45
+ {
46
+ window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
+ }
48
+ // ]]>
49
+ </script>
50
+ </head>
51
+
52
+ <body>
53
+ <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
+ <td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::AbstractInstaller</td>
55
+ <td align="right">
56
+ <table cellspacing="0" cellpadding="2">
57
+ <tr valign="top">
58
+ <td>In:</td>
59
+ <td>
60
+ <a href="../../files/lib/phusion_passenger/abstract_installer_rb.html">lib/phusion_passenger/abstract_installer.rb</a>
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td>Parent:</td>
65
+ <td>
66
+ Object
67
+ </td>
68
+ </tr>
69
+ </table>
70
+ </td>
71
+ </tr>
72
+ </table>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+ <div id="content">
77
+
78
+ <div class="description"><p>
79
+ Abstract base class for installers. Used by
80
+ passenger-install-apache2-module and passenger-install-nginx-module.
81
+ </p>
82
+ </div>
83
+
84
+
85
+
86
+ <div class="sectiontitle">Methods</div>
87
+ <ul>
88
+ <li><a href="#M000148">new</a></li>
89
+ <li><a href="#M000149">start</a></li>
90
+ </ul>
91
+
92
+
93
+
94
+
95
+ <div class="sectiontitle">Constants</div>
96
+ <table border='0' cellpadding='5'>
97
+ <tr valign='top'>
98
+ <td class="attr-name">PASSENGER_WEBSITE</td>
99
+ <td>=</td>
100
+ <td class="attr-value">&quot;http://www.modrails.com/&quot;</td>
101
+ </tr>
102
+ <tr valign='top'>
103
+ <td class="attr-name">PHUSION_WEBSITE</td>
104
+ <td>=</td>
105
+ <td class="attr-value">&quot;www.phusion.nl&quot;</td>
106
+ </tr>
107
+ </table>
108
+
109
+
110
+ <div class="sectiontitle">Public Class methods</div>
111
+ <div class="method">
112
+ <div class="title">
113
+ <a name="M000148"></a><b>new</b>(options = {})
114
+ </div>
115
+ <div class="sourcecode">
116
+ <p class="source-link">[ <a href="javascript:toggleSource('M000148_source')" id="l_M000148_source">show source</a> ]</p>
117
+ <div id="M000148_source" class="dyn-source">
118
+ <pre>
119
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_installer.rb, line 36</span>
120
+ 36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
121
+ 37: <span class="ruby-identifier">options</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">value</span><span class="ruby-operator">|</span>
122
+ 38: <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">&quot;@#{key}&quot;</span><span class="ruby-node">&quot;@#{key}&quot;</span>, <span class="ruby-identifier">value</span>)
123
+ 39: <span class="ruby-keyword kw">end</span>
124
+ 40: <span class="ruby-keyword kw">end</span>
125
+ </pre>
126
+ </div>
127
+ </div>
128
+ </div>
129
+ <div class="sectiontitle">Public Instance methods</div>
130
+ <div class="method">
131
+ <div class="title">
132
+ <a name="M000149"></a><b>start</b>()
133
+ </div>
134
+ <div class="sourcecode">
135
+ <p class="source-link">[ <a href="javascript:toggleSource('M000149_source')" id="l_M000149_source">show source</a> ]</p>
136
+ <div id="M000149_source" class="dyn-source">
137
+ <pre>
138
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_installer.rb, line 42</span>
139
+ 42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
140
+ 43: <span class="ruby-identifier">install!</span>
141
+ 44: <span class="ruby-keyword kw">ensure</span>
142
+ 45: <span class="ruby-identifier">reset_terminal_colors</span>
143
+ 46: <span class="ruby-keyword kw">end</span>
144
+ </pre>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ </div>
149
+
150
+ </div>
151
+
152
+ </body>
153
+ </html>
@@ -161,11 +161,11 @@ and sends it to the request handler.
161
161
 
162
162
  <div class="sectiontitle">Methods</div>
163
163
  <ul>
164
- <li><a href="#M000111">cleanup</a></li>
165
- <li><a href="#M000113">main_loop</a></li>
166
- <li><a href="#M000112">main_loop_running?</a></li>
167
- <li><a href="#M000110">new</a></li>
168
- <li><a href="#M000114">start_main_loop_thread</a></li>
164
+ <li><a href="#M000117">cleanup</a></li>
165
+ <li><a href="#M000119">main_loop</a></li>
166
+ <li><a href="#M000118">main_loop_running?</a></li>
167
+ <li><a href="#M000116">new</a></li>
168
+ <li><a href="#M000120">start_main_loop_thread</a></li>
169
169
  </ul>
170
170
 
171
171
  <div class="sectiontitle">Included Modules</div>
@@ -213,11 +213,6 @@ to exit as soon as it&#8216;s done processing a request.
213
213
  <td>=</td>
214
214
  <td class="attr-value">128 * 1024</td>
215
215
  </tr>
216
- <tr valign='top'>
217
- <td class="attr-name">PASSENGER_VERSION</td>
218
- <td>=</td>
219
- <td class="attr-value">determine_passenger_version</td>
220
- </tr>
221
216
  <tr valign='top'>
222
217
  <td class="attr-name">PASSENGER_HEADER</td>
223
218
  <td>=</td>
@@ -273,7 +268,7 @@ exceptions.
273
268
  <td class='attr-name'>socket_name</td>
274
269
  <td class='attr-desc'>
275
270
  The name of the socket on which the request handler accepts <a
276
- href="AbstractRequestHandler.html#M000110">new</a> connections. At this
271
+ href="AbstractRequestHandler.html#M000116">new</a> connections. At this
277
272
  moment, this value is always the filename of a Unix domain socket.
278
273
 
279
274
  <p>
@@ -297,11 +292,11 @@ always &#8216;unix&#8217;, which indicates a Unix domain socket.
297
292
  <div class="sectiontitle">Public Class methods</div>
298
293
  <div class="method">
299
294
  <div class="title">
300
- <a name="M000110"></a><b>new</b>(owner_pipe, options = {})
295
+ <a name="M000116"></a><b>new</b>(owner_pipe, options = {})
301
296
  </div>
302
297
  <div class="description">
303
298
  <p>
304
- Create a <a href="AbstractRequestHandler.html#M000110">new</a>
299
+ Create a <a href="AbstractRequestHandler.html#M000116">new</a>
305
300
  RequestHandler with the given owner pipe. <tt>owner_pipe</tt> must be the
306
301
  readable part of a pipe <a href="../IO.html">IO</a> object.
307
302
  </p>
@@ -315,25 +310,25 @@ Additionally, the following options may be given:
315
310
  </ul>
316
311
  </div>
317
312
  <div class="sourcecode">
318
- <p class="source-link">[ <a href="javascript:toggleSource('M000110_source')" id="l_M000110_source">show source</a> ]</p>
319
- <div id="M000110_source" class="dyn-source">
313
+ <p class="source-link">[ <a href="javascript:toggleSource('M000116_source')" id="l_M000116_source">show source</a> ]</p>
314
+ <div id="M000116_source" class="dyn-source">
320
315
  <pre>
321
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 132</span>
322
- 132: <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> = {})
323
- 133: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">should_use_unix_sockets?</span>
324
- 134: <span class="ruby-identifier">create_unix_socket_on_filesystem</span>
325
- 135: <span class="ruby-keyword kw">else</span>
326
- 136: <span class="ruby-identifier">create_tcp_socket</span>
327
- 137: <span class="ruby-keyword kw">end</span>
328
- 138: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close_on_exec!</span>
329
- 139: <span class="ruby-ivar">@owner_pipe</span> = <span class="ruby-identifier">owner_pipe</span>
330
- 140: <span class="ruby-ivar">@previous_signal_handlers</span> = {}
331
- 141: <span class="ruby-ivar">@main_loop_thread_lock</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
332
- 142: <span class="ruby-ivar">@main_loop_thread_cond</span> = <span class="ruby-constant">ConditionVariable</span>.<span class="ruby-identifier">new</span>
333
- 143: <span class="ruby-ivar">@memory_limit</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;memory_limit&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
334
- 144: <span class="ruby-ivar">@iterations</span> = <span class="ruby-value">0</span>
335
- 145: <span class="ruby-ivar">@processed_requests</span> = <span class="ruby-value">0</span>
336
- 146: <span class="ruby-keyword kw">end</span>
316
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 138</span>
317
+ 138: <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> = {})
318
+ 139: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">should_use_unix_sockets?</span>
319
+ 140: <span class="ruby-identifier">create_unix_socket_on_filesystem</span>
320
+ 141: <span class="ruby-keyword kw">else</span>
321
+ 142: <span class="ruby-identifier">create_tcp_socket</span>
322
+ 143: <span class="ruby-keyword kw">end</span>
323
+ 144: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close_on_exec!</span>
324
+ 145: <span class="ruby-ivar">@owner_pipe</span> = <span class="ruby-identifier">owner_pipe</span>
325
+ 146: <span class="ruby-ivar">@previous_signal_handlers</span> = {}
326
+ 147: <span class="ruby-ivar">@main_loop_thread_lock</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
327
+ 148: <span class="ruby-ivar">@main_loop_thread_cond</span> = <span class="ruby-constant">ConditionVariable</span>.<span class="ruby-identifier">new</span>
328
+ 149: <span class="ruby-ivar">@memory_limit</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;memory_limit&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
329
+ 150: <span class="ruby-ivar">@iterations</span> = <span class="ruby-value">0</span>
330
+ 151: <span class="ruby-ivar">@processed_requests</span> = <span class="ruby-value">0</span>
331
+ 152: <span class="ruby-keyword kw">end</span>
337
332
  </pre>
338
333
  </div>
339
334
  </div>
@@ -341,7 +336,7 @@ Additionally, the following options may be given:
341
336
  <div class="sectiontitle">Public Instance methods</div>
342
337
  <div class="method">
343
338
  <div class="title">
344
- <a name="M000111"></a><b>cleanup</b>()
339
+ <a name="M000117"></a><b>cleanup</b>()
345
340
  </div>
346
341
  <div class="description">
347
342
  <p>
@@ -349,37 +344,37 @@ Clean up temporary stuff created by the request handler.
349
344
  </p>
350
345
  <p>
351
346
  If the main loop was started by <a
352
- href="AbstractRequestHandler.html#M000113">#main_loop</a>, then this method
347
+ href="AbstractRequestHandler.html#M000119">#main_loop</a>, then this method
353
348
  may only be called after the main loop has exited.
354
349
  </p>
355
350
  <p>
356
351
  If the main loop was started by <a
357
- href="AbstractRequestHandler.html#M000114">#start_main_loop_thread</a>,
352
+ href="AbstractRequestHandler.html#M000120">#start_main_loop_thread</a>,
358
353
  then this method may be called at any time, and it will stop the main loop
359
354
  thread.
360
355
  </p>
361
356
  </div>
362
357
  <div class="sourcecode">
363
- <p class="source-link">[ <a href="javascript:toggleSource('M000111_source')" id="l_M000111_source">show source</a> ]</p>
364
- <div id="M000111_source" class="dyn-source">
358
+ <p class="source-link">[ <a href="javascript:toggleSource('M000117_source')" id="l_M000117_source">show source</a> ]</p>
359
+ <div id="M000117_source" class="dyn-source">
365
360
  <pre>
366
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 155</span>
367
- 155: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup</span>
368
- 156: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@main_loop_thread</span>
369
- 157: <span class="ruby-ivar">@main_loop_thread</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-constant">Interrupt</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Cleaning up&quot;</span>))
370
- 158: <span class="ruby-ivar">@main_loop_thread</span>.<span class="ruby-identifier">join</span>
371
- 159: <span class="ruby-keyword kw">end</span>
372
- 160: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
373
- 161: <span class="ruby-ivar">@owner_pipe</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
374
- 162: <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-ivar">@socket_name</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
375
- 163: <span class="ruby-keyword kw">end</span>
361
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 161</span>
362
+ 161: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup</span>
363
+ 162: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@main_loop_thread</span>
364
+ 163: <span class="ruby-ivar">@main_loop_thread</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-constant">Interrupt</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Cleaning up&quot;</span>))
365
+ 164: <span class="ruby-ivar">@main_loop_thread</span>.<span class="ruby-identifier">join</span>
366
+ 165: <span class="ruby-keyword kw">end</span>
367
+ 166: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
368
+ 167: <span class="ruby-ivar">@owner_pipe</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
369
+ 168: <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-ivar">@socket_name</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
370
+ 169: <span class="ruby-keyword kw">end</span>
376
371
  </pre>
377
372
  </div>
378
373
  </div>
379
374
  </div>
380
375
  <div class="method">
381
376
  <div class="title">
382
- <a name="M000113"></a><b>main_loop</b>()
377
+ <a name="M000119"></a><b>main_loop</b>()
383
378
  </div>
384
379
  <div class="description">
385
380
  <p>
@@ -387,74 +382,74 @@ Enter the request handler&#8216;s main loop.
387
382
  </p>
388
383
  </div>
389
384
  <div class="sourcecode">
390
- <p class="source-link">[ <a href="javascript:toggleSource('M000113_source')" id="l_M000113_source">show source</a> ]</p>
391
- <div id="M000113_source" class="dyn-source">
385
+ <p class="source-link">[ <a href="javascript:toggleSource('M000119_source')" id="l_M000119_source">show source</a> ]</p>
386
+ <div id="M000119_source" class="dyn-source">
392
387
  <pre>
393
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 171</span>
394
- 171: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main_loop</span>
395
- 172: <span class="ruby-identifier">reset_signal_handlers</span>
396
- 173: <span class="ruby-keyword kw">begin</span>
397
- 174: <span class="ruby-ivar">@graceful_termination_pipe</span> = <span class="ruby-constant">IO</span>.<span class="ruby-identifier">pipe</span>
398
- 175: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">close_on_exec!</span>
399
- 176: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">close_on_exec!</span>
400
- 177:
401
- 178: <span class="ruby-ivar">@main_loop_thread_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
402
- 179: <span class="ruby-ivar">@main_loop_running</span> = <span class="ruby-keyword kw">true</span>
403
- 180: <span class="ruby-ivar">@main_loop_thread_cond</span>.<span class="ruby-identifier">broadcast</span>
404
- 181: <span class="ruby-keyword kw">end</span>
405
- 182:
406
- 183: <span class="ruby-identifier">install_useful_signal_handlers</span>
407
- 184:
408
- 185: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
409
- 186: <span class="ruby-ivar">@iterations</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
410
- 187: <span class="ruby-identifier">client</span> = <span class="ruby-identifier">accept_connection</span>
411
- 188: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">nil?</span>
412
- 189: <span class="ruby-keyword kw">break</span>
413
- 190: <span class="ruby-keyword kw">end</span>
414
- 191: <span class="ruby-keyword kw">begin</span>
415
- 192: <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span> = <span class="ruby-identifier">parse_request</span>(<span class="ruby-identifier">client</span>)
416
- 193: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">headers</span>
417
- 194: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">headers</span>[<span class="ruby-constant">REQUEST_METHOD</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">PING</span>
418
- 195: <span class="ruby-identifier">process_ping</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">client</span>)
419
- 196: <span class="ruby-keyword kw">else</span>
420
- 197: <span class="ruby-identifier">process_request</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">client</span>)
421
- 198: <span class="ruby-keyword kw">end</span>
422
- 199: <span class="ruby-keyword kw">end</span>
423
- 200: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SocketError</span>, <span class="ruby-constant">SystemCallError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
424
- 201: <span class="ruby-identifier">print_exception</span>(<span class="ruby-value str">&quot;Passenger RequestHandler&quot;</span>, <span class="ruby-identifier">e</span>)
425
- 202: <span class="ruby-keyword kw">ensure</span>
426
- 203: <span class="ruby-comment cmt"># 'input' is the same as 'client' so we don't</span>
427
- 204: <span class="ruby-comment cmt"># need to close that.</span>
428
- 205: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
429
- 206: <span class="ruby-keyword kw">end</span>
430
- 207: <span class="ruby-ivar">@processed_requests</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
431
- 208: <span class="ruby-keyword kw">end</span>
432
- 209: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>
433
- 210: <span class="ruby-comment cmt"># Exit main loop.</span>
434
- 211: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Interrupt</span>
435
- 212: <span class="ruby-comment cmt"># Exit main loop.</span>
436
- 213: <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>
437
- 214: <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">HARD_TERMINATION_SIGNAL</span> <span class="ruby-operator">&amp;&amp;</span>
438
- 215: <span class="ruby-identifier">signal</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">SOFT_TERMINATION_SIGNAL</span>
439
- 216: <span class="ruby-identifier">raise</span>
440
- 217: <span class="ruby-keyword kw">end</span>
441
- 218: <span class="ruby-keyword kw">ensure</span>
442
- 219: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
443
- 220: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
444
- 221: <span class="ruby-identifier">revert_signal_handlers</span>
445
- 222: <span class="ruby-ivar">@main_loop_thread_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
446
- 223: <span class="ruby-ivar">@main_loop_running</span> = <span class="ruby-keyword kw">false</span>
447
- 224: <span class="ruby-ivar">@main_loop_thread_cond</span>.<span class="ruby-identifier">broadcast</span>
448
- 225: <span class="ruby-keyword kw">end</span>
449
- 226: <span class="ruby-keyword kw">end</span>
450
- 227: <span class="ruby-keyword kw">end</span>
388
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 177</span>
389
+ 177: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main_loop</span>
390
+ 178: <span class="ruby-identifier">reset_signal_handlers</span>
391
+ 179: <span class="ruby-keyword kw">begin</span>
392
+ 180: <span class="ruby-ivar">@graceful_termination_pipe</span> = <span class="ruby-constant">IO</span>.<span class="ruby-identifier">pipe</span>
393
+ 181: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">close_on_exec!</span>
394
+ 182: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">close_on_exec!</span>
395
+ 183:
396
+ 184: <span class="ruby-ivar">@main_loop_thread_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
397
+ 185: <span class="ruby-ivar">@main_loop_running</span> = <span class="ruby-keyword kw">true</span>
398
+ 186: <span class="ruby-ivar">@main_loop_thread_cond</span>.<span class="ruby-identifier">broadcast</span>
399
+ 187: <span class="ruby-keyword kw">end</span>
400
+ 188:
401
+ 189: <span class="ruby-identifier">install_useful_signal_handlers</span>
402
+ 190:
403
+ 191: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
404
+ 192: <span class="ruby-ivar">@iterations</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
405
+ 193: <span class="ruby-identifier">client</span> = <span class="ruby-identifier">accept_connection</span>
406
+ 194: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">nil?</span>
407
+ 195: <span class="ruby-keyword kw">break</span>
408
+ 196: <span class="ruby-keyword kw">end</span>
409
+ 197: <span class="ruby-keyword kw">begin</span>
410
+ 198: <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span> = <span class="ruby-identifier">parse_request</span>(<span class="ruby-identifier">client</span>)
411
+ 199: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">headers</span>
412
+ 200: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">headers</span>[<span class="ruby-constant">REQUEST_METHOD</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">PING</span>
413
+ 201: <span class="ruby-identifier">process_ping</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">client</span>)
414
+ 202: <span class="ruby-keyword kw">else</span>
415
+ 203: <span class="ruby-identifier">process_request</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">client</span>)
416
+ 204: <span class="ruby-keyword kw">end</span>
417
+ 205: <span class="ruby-keyword kw">end</span>
418
+ 206: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SocketError</span>, <span class="ruby-constant">SystemCallError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
419
+ 207: <span class="ruby-identifier">print_exception</span>(<span class="ruby-value str">&quot;Passenger RequestHandler&quot;</span>, <span class="ruby-identifier">e</span>)
420
+ 208: <span class="ruby-keyword kw">ensure</span>
421
+ 209: <span class="ruby-comment cmt"># 'input' is the same as 'client' so we don't</span>
422
+ 210: <span class="ruby-comment cmt"># need to close that.</span>
423
+ 211: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
424
+ 212: <span class="ruby-keyword kw">end</span>
425
+ 213: <span class="ruby-ivar">@processed_requests</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
426
+ 214: <span class="ruby-keyword kw">end</span>
427
+ 215: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>
428
+ 216: <span class="ruby-comment cmt"># Exit main loop.</span>
429
+ 217: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Interrupt</span>
430
+ 218: <span class="ruby-comment cmt"># Exit main loop.</span>
431
+ 219: <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>
432
+ 220: <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">HARD_TERMINATION_SIGNAL</span> <span class="ruby-operator">&amp;&amp;</span>
433
+ 221: <span class="ruby-identifier">signal</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">SOFT_TERMINATION_SIGNAL</span>
434
+ 222: <span class="ruby-identifier">raise</span>
435
+ 223: <span class="ruby-keyword kw">end</span>
436
+ 224: <span class="ruby-keyword kw">ensure</span>
437
+ 225: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
438
+ 226: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
439
+ 227: <span class="ruby-identifier">revert_signal_handlers</span>
440
+ 228: <span class="ruby-ivar">@main_loop_thread_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
441
+ 229: <span class="ruby-ivar">@main_loop_running</span> = <span class="ruby-keyword kw">false</span>
442
+ 230: <span class="ruby-ivar">@main_loop_thread_cond</span>.<span class="ruby-identifier">broadcast</span>
443
+ 231: <span class="ruby-keyword kw">end</span>
444
+ 232: <span class="ruby-keyword kw">end</span>
445
+ 233: <span class="ruby-keyword kw">end</span>
451
446
  </pre>
452
447
  </div>
453
448
  </div>
454
449
  </div>
455
450
  <div class="method">
456
451
  <div class="title">
457
- <a name="M000112"></a><b>main_loop_running?</b>()
452
+ <a name="M000118"></a><b>main_loop_running?</b>()
458
453
  </div>
459
454
  <div class="description">
460
455
  <p>
@@ -462,43 +457,43 @@ Check whether the main loop&#8216;s currently running.
462
457
  </p>
463
458
  </div>
464
459
  <div class="sourcecode">
465
- <p class="source-link">[ <a href="javascript:toggleSource('M000112_source')" id="l_M000112_source">show source</a> ]</p>
466
- <div id="M000112_source" class="dyn-source">
460
+ <p class="source-link">[ <a href="javascript:toggleSource('M000118_source')" id="l_M000118_source">show source</a> ]</p>
461
+ <div id="M000118_source" class="dyn-source">
467
462
  <pre>
468
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 166</span>
469
- 166: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main_loop_running?</span>
470
- 167: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@main_loop_running</span>
471
- 168: <span class="ruby-keyword kw">end</span>
463
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 172</span>
464
+ 172: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main_loop_running?</span>
465
+ 173: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@main_loop_running</span>
466
+ 174: <span class="ruby-keyword kw">end</span>
472
467
  </pre>
473
468
  </div>
474
469
  </div>
475
470
  </div>
476
471
  <div class="method">
477
472
  <div class="title">
478
- <a name="M000114"></a><b>start_main_loop_thread</b>()
473
+ <a name="M000120"></a><b>start_main_loop_thread</b>()
479
474
  </div>
480
475
  <div class="description">
481
476
  <p>
482
477
  Start the main loop in a <a
483
- href="AbstractRequestHandler.html#M000110">new</a> thread. This thread will
484
- be stopped by <a href="AbstractRequestHandler.html#M000111">#cleanup</a>.
478
+ href="AbstractRequestHandler.html#M000116">new</a> thread. This thread will
479
+ be stopped by <a href="AbstractRequestHandler.html#M000117">#cleanup</a>.
485
480
  </p>
486
481
  </div>
487
482
  <div class="sourcecode">
488
- <p class="source-link">[ <a href="javascript:toggleSource('M000114_source')" id="l_M000114_source">show source</a> ]</p>
489
- <div id="M000114_source" class="dyn-source">
483
+ <p class="source-link">[ <a href="javascript:toggleSource('M000120_source')" id="l_M000120_source">show source</a> ]</p>
484
+ <div id="M000120_source" class="dyn-source">
490
485
  <pre>
491
- <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 230</span>
492
- 230: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_main_loop_thread</span>
493
- 231: <span class="ruby-ivar">@main_loop_thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
494
- 232: <span class="ruby-identifier">main_loop</span>
495
- 233: <span class="ruby-keyword kw">end</span>
496
- 234: <span class="ruby-ivar">@main_loop_thread_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
497
- 235: <span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@main_loop_running</span>
498
- 236: <span class="ruby-ivar">@main_loop_thread_cond</span>.<span class="ruby-identifier">wait</span>(<span class="ruby-ivar">@main_loop_thread_lock</span>)
499
- 237: <span class="ruby-keyword kw">end</span>
500
- 238: <span class="ruby-keyword kw">end</span>
501
- 239: <span class="ruby-keyword kw">end</span>
486
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 236</span>
487
+ 236: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_main_loop_thread</span>
488
+ 237: <span class="ruby-ivar">@main_loop_thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
489
+ 238: <span class="ruby-identifier">main_loop</span>
490
+ 239: <span class="ruby-keyword kw">end</span>
491
+ 240: <span class="ruby-ivar">@main_loop_thread_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
492
+ 241: <span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@main_loop_running</span>
493
+ 242: <span class="ruby-ivar">@main_loop_thread_cond</span>.<span class="ruby-identifier">wait</span>(<span class="ruby-ivar">@main_loop_thread_lock</span>)
494
+ 243: <span class="ruby-keyword kw">end</span>
495
+ 244: <span class="ruby-keyword kw">end</span>
496
+ 245: <span class="ruby-keyword kw">end</span>
502
497
  </pre>
503
498
  </div>
504
499
  </div>