passenger 2.2.9 → 2.2.10

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 (435) hide show
  1. data/NEWS +10 -0
  2. data/doc/Architectural overview.html +202 -65
  3. data/doc/Security of user switching support.html +200 -63
  4. data/doc/Users guide Apache.html +266 -129
  5. data/doc/Users guide Nginx.html +234 -97
  6. data/doc/cxxapi/AbstractSpawnManager_8h-source.html +138 -0
  7. data/doc/cxxapi/Account_8h-source.html +202 -0
  8. data/doc/cxxapi/AccountsDatabase_8h-source.html +158 -0
  9. data/doc/cxxapi/AgentsStarter_8h-source.html +79 -0
  10. data/doc/cxxapi/BCrypt_8h-source.html +101 -0
  11. data/doc/cxxapi/BacktracesServer_8h-source.html +87 -0
  12. data/doc/cxxapi/Base64_8h-source.html +85 -0
  13. data/doc/cxxapi/Blowfish_8h-source.html +131 -0
  14. data/doc/cxxapi/Bucket_8h-source.html +1 -1
  15. data/doc/cxxapi/CachedFileStat_8h-source.html +49 -157
  16. data/doc/cxxapi/Configuration_8h-source.html +1 -1
  17. data/doc/cxxapi/Constants_8h-source.html +71 -0
  18. data/doc/cxxapi/ContentHandler_8h-source.html +92 -0
  19. data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
  20. data/doc/cxxapi/Exceptions_8h-source.html +332 -236
  21. data/doc/cxxapi/FileChangeChecker_8h-source.html +237 -0
  22. data/doc/cxxapi/FileDescriptor_8h-source.html +206 -0
  23. data/doc/cxxapi/Hooks_8h-source.html +1 -1
  24. data/doc/cxxapi/HttpStatusExtractor_8h-source.html +378 -0
  25. data/doc/cxxapi/LoggingServer_8h-source.html +165 -0
  26. data/doc/cxxapi/Logging_8h-source.html +580 -112
  27. data/doc/cxxapi/MessageChannel_8h-source.html +789 -599
  28. data/doc/cxxapi/MessageClient_8h-source.html +297 -0
  29. data/doc/cxxapi/MessageServer_8h-source.html +607 -0
  30. data/doc/cxxapi/PoolOptions_8h-source.html +471 -278
  31. data/doc/cxxapi/Process_8h-source.html +272 -0
  32. data/doc/cxxapi/RandomGenerator_8h-source.html +156 -0
  33. data/doc/cxxapi/ResourceLocator_8h-source.html +104 -0
  34. data/doc/cxxapi/ScgiRequestParser_8h-source.html +399 -0
  35. data/doc/cxxapi/ServerInstanceDir_8h-source.html +356 -0
  36. data/doc/cxxapi/Session_8h-source.html +483 -0
  37. data/doc/cxxapi/SpawnManager_8h-source.html +590 -546
  38. data/doc/cxxapi/StaticContentHandler_8h-source.html +65 -0
  39. data/doc/cxxapi/StaticString_8h-source.html +214 -0
  40. data/doc/cxxapi/StringListCreator_8h-source.html +111 -0
  41. data/doc/cxxapi/SystemTime_8h-source.html +191 -78
  42. data/doc/cxxapi/Timer_8h-source.html +157 -0
  43. data/doc/cxxapi/Utils_8h-source.html +621 -434
  44. data/doc/cxxapi/Version_8h-source.html +59 -0
  45. data/doc/cxxapi/annotated.html +1 -1
  46. data/doc/cxxapi/apache2_2Configuration_8h-source.html +79 -0
  47. data/doc/cxxapi/classAgentWatcher-members.html +50 -0
  48. data/doc/cxxapi/classAgentWatcher.html +445 -0
  49. data/doc/cxxapi/classClient-members.html +4 -3
  50. data/doc/cxxapi/classClient.html +50 -46
  51. data/doc/cxxapi/classHooks-members.html +1 -1
  52. data/doc/cxxapi/classHooks.html +1 -1
  53. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager-members.html +37 -0
  54. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager.html +191 -0
  55. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.map +1 -0
  56. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.md5 +1 -0
  57. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.png +0 -0
  58. data/doc/cxxapi/{classPassenger_1_1DummySpawnManager-members.html → classPassenger_1_1ArgumentException-members.html} +3 -2
  59. data/doc/cxxapi/classPassenger_1_1ArgumentException.html +52 -0
  60. data/doc/cxxapi/classPassenger_1_1BacktracesServer-members.html +36 -0
  61. data/doc/cxxapi/classPassenger_1_1BacktracesServer.html +107 -0
  62. data/doc/cxxapi/classPassenger_1_1BacktracesServer__inherit__graph.map +1 -0
  63. data/doc/cxxapi/classPassenger_1_1BacktracesServer__inherit__graph.md5 +1 -0
  64. data/doc/cxxapi/classPassenger_1_1BacktracesServer__inherit__graph.png +0 -0
  65. data/doc/cxxapi/classPassenger_1_1BufferedUpload-members.html +3 -3
  66. data/doc/cxxapi/classPassenger_1_1BufferedUpload.html +18 -34
  67. data/doc/cxxapi/classPassenger_1_1BusyException-members.html +2 -1
  68. data/doc/cxxapi/classPassenger_1_1BusyException.html +3 -2
  69. data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +2 -1
  70. data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +3 -2
  71. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
  72. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
  73. data/doc/cxxapi/{classPassenger_1_1FileChecker-members.html → classPassenger_1_1EOFException-members.html} +3 -4
  74. data/doc/cxxapi/classPassenger_1_1EOFException.html +57 -0
  75. data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.map +1 -0
  76. data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.md5 +1 -0
  77. data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.png +0 -0
  78. data/doc/cxxapi/classPassenger_1_1EventFd-members.html +33 -0
  79. data/doc/cxxapi/classPassenger_1_1EventFd.html +49 -0
  80. data/doc/cxxapi/classPassenger_1_1FileChangeChecker-members.html +37 -0
  81. data/doc/cxxapi/classPassenger_1_1FileChangeChecker.html +166 -0
  82. data/doc/cxxapi/classPassenger_1_1FileDescriptor-members.html +37 -0
  83. data/doc/cxxapi/classPassenger_1_1FileDescriptor.html +159 -0
  84. data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +2 -1
  85. data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +3 -2
  86. data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +2 -1
  87. data/doc/cxxapi/classPassenger_1_1FileSystemException.html +3 -2
  88. data/doc/cxxapi/{classPassenger_1_1ApplicationPoolServer-members.html → classPassenger_1_1HttpStatusExtractor-members.html} +6 -5
  89. data/doc/cxxapi/classPassenger_1_1HttpStatusExtractor.html +128 -0
  90. data/doc/cxxapi/classPassenger_1_1IOException-members.html +2 -1
  91. data/doc/cxxapi/classPassenger_1_1IOException.html +4 -3
  92. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +2 -1
  93. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +1 -1
  94. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
  95. data/doc/cxxapi/classPassenger_1_1MemZeroGuard-members.html +36 -0
  96. data/doc/cxxapi/classPassenger_1_1MemZeroGuard.html +147 -0
  97. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +12 -5
  98. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +267 -34
  99. data/doc/cxxapi/classPassenger_1_1MessageServer-members.html +46 -0
  100. data/doc/cxxapi/classPassenger_1_1MessageServer.html +438 -0
  101. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext-members.html +33 -0
  102. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext.html +56 -0
  103. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.map +1 -0
  104. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.md5 +1 -0
  105. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.png +0 -0
  106. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext-members.html +38 -0
  107. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext.html +175 -0
  108. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.map +1 -0
  109. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.md5 +1 -0
  110. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.png +0 -0
  111. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler-members.html +36 -0
  112. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler.html +176 -0
  113. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler__inherit__graph.map +1 -0
  114. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler__inherit__graph.md5 +1 -0
  115. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler__inherit__graph.png +0 -0
  116. data/doc/cxxapi/classPassenger_1_1Process-members.html +40 -0
  117. data/doc/cxxapi/classPassenger_1_1Process.html +266 -0
  118. data/doc/cxxapi/classPassenger_1_1RandomGenerator-members.html +33 -0
  119. data/doc/cxxapi/classPassenger_1_1RandomGenerator.html +51 -0
  120. data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +2 -1
  121. data/doc/cxxapi/classPassenger_1_1RuntimeException.html +3 -2
  122. data/doc/cxxapi/classPassenger_1_1ScgiRequestParser-members.html +47 -0
  123. data/doc/cxxapi/classPassenger_1_1ScgiRequestParser.html +302 -0
  124. data/doc/cxxapi/classPassenger_1_1SecurityException-members.html +33 -0
  125. data/doc/cxxapi/classPassenger_1_1SecurityException.html +52 -0
  126. data/doc/cxxapi/classPassenger_1_1Session-members.html +50 -0
  127. data/doc/cxxapi/classPassenger_1_1Session.html +577 -0
  128. data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.map +1 -0
  129. data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.md5 +1 -0
  130. data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.png +0 -0
  131. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +2 -1
  132. data/doc/cxxapi/classPassenger_1_1SpawnException.html +5 -4
  133. data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +8 -5
  134. data/doc/cxxapi/classPassenger_1_1SpawnManager.html +127 -45
  135. data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.map +1 -0
  136. data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.md5 +1 -0
  137. data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.png +0 -0
  138. data/doc/cxxapi/classPassenger_1_1StandardSession-members.html +51 -0
  139. data/doc/cxxapi/classPassenger_1_1StandardSession.html +415 -0
  140. data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.map +1 -0
  141. data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.md5 +1 -0
  142. data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.png +0 -0
  143. data/doc/cxxapi/classPassenger_1_1StaticString-members.html +33 -0
  144. data/doc/cxxapi/classPassenger_1_1StaticString.html +54 -0
  145. data/doc/cxxapi/classPassenger_1_1SystemException-members.html +2 -1
  146. data/doc/cxxapi/classPassenger_1_1SystemException.html +4 -3
  147. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +1 -0
  148. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +1 -1
  149. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
  150. data/doc/cxxapi/classPassenger_1_1SystemTime-members.html +9 -1
  151. data/doc/cxxapi/classPassenger_1_1SystemTime.html +92 -8
  152. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException-members.html +37 -0
  153. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException.html +57 -0
  154. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.map +1 -0
  155. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.md5 +1 -0
  156. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.png +0 -0
  157. data/doc/cxxapi/classPassenger_1_1TimeoutException-members.html +33 -0
  158. data/doc/cxxapi/classPassenger_1_1TimeoutException.html +50 -0
  159. data/doc/cxxapi/{classPassenger_1_1Application-members.html → classPassenger_1_1Timer-members.html} +8 -7
  160. data/doc/cxxapi/classPassenger_1_1Timer.html +163 -0
  161. data/doc/cxxapi/classServer-members.html +33 -0
  162. data/doc/cxxapi/classServer.html +46 -0
  163. data/doc/cxxapi/classServerInstanceDirToucher-members.html +33 -0
  164. data/doc/cxxapi/classServerInstanceDirToucher.html +43 -0
  165. data/doc/cxxapi/classes.html +1 -1
  166. data/doc/cxxapi/definitions_8h-source.html +1 -1
  167. data/doc/cxxapi/files.html +1 -1
  168. data/doc/cxxapi/functions.html +1 -1
  169. data/doc/cxxapi/{functions_type.html → functions_enum.html} +7 -5
  170. data/doc/cxxapi/functions_eval.html +55 -0
  171. data/doc/cxxapi/functions_func.html +1 -1
  172. data/doc/cxxapi/functions_vars.html +106 -9
  173. data/doc/cxxapi/graph_legend.html +1 -1
  174. data/doc/cxxapi/group__Configuration.html +1 -1
  175. data/doc/cxxapi/group__Core.html +1 -1
  176. data/doc/cxxapi/group__Exceptions.html +17 -1
  177. data/doc/cxxapi/group__Hooks.html +1 -1
  178. data/doc/cxxapi/group__Support.html +1 -1
  179. data/doc/cxxapi/hierarchy.html +34 -12
  180. data/doc/cxxapi/inherit__graph__0.map +1 -1
  181. data/doc/cxxapi/inherit__graph__0.md5 +1 -1
  182. data/doc/cxxapi/inherit__graph__0.png +0 -0
  183. data/doc/cxxapi/inherit__graph__1.map +1 -1
  184. data/doc/cxxapi/inherit__graph__1.md5 +1 -1
  185. data/doc/cxxapi/inherit__graph__1.png +0 -0
  186. data/doc/cxxapi/inherit__graph__10.map +1 -1
  187. data/doc/cxxapi/inherit__graph__10.md5 +1 -1
  188. data/doc/cxxapi/inherit__graph__10.png +0 -0
  189. data/doc/cxxapi/inherit__graph__11.map +1 -1
  190. data/doc/cxxapi/inherit__graph__11.md5 +1 -1
  191. data/doc/cxxapi/inherit__graph__11.png +0 -0
  192. data/doc/cxxapi/inherit__graph__12.map +1 -1
  193. data/doc/cxxapi/inherit__graph__12.md5 +1 -1
  194. data/doc/cxxapi/inherit__graph__12.png +0 -0
  195. data/doc/cxxapi/inherit__graph__13.map +1 -1
  196. data/doc/cxxapi/inherit__graph__13.md5 +1 -1
  197. data/doc/cxxapi/inherit__graph__13.png +0 -0
  198. data/doc/cxxapi/inherit__graph__14.map +3 -2
  199. data/doc/cxxapi/inherit__graph__14.md5 +1 -1
  200. data/doc/cxxapi/inherit__graph__14.png +0 -0
  201. data/doc/cxxapi/inherit__graph__15.map +1 -1
  202. data/doc/cxxapi/inherit__graph__15.md5 +1 -1
  203. data/doc/cxxapi/inherit__graph__15.png +0 -0
  204. data/doc/cxxapi/inherit__graph__16.map +1 -1
  205. data/doc/cxxapi/inherit__graph__16.md5 +1 -1
  206. data/doc/cxxapi/inherit__graph__16.png +0 -0
  207. data/doc/cxxapi/inherit__graph__17.map +1 -1
  208. data/doc/cxxapi/inherit__graph__17.md5 +1 -1
  209. data/doc/cxxapi/inherit__graph__17.png +0 -0
  210. data/doc/cxxapi/inherit__graph__18.map +2 -1
  211. data/doc/cxxapi/inherit__graph__18.md5 +1 -1
  212. data/doc/cxxapi/inherit__graph__18.png +0 -0
  213. data/doc/cxxapi/inherit__graph__19.map +1 -1
  214. data/doc/cxxapi/inherit__graph__19.md5 +1 -1
  215. data/doc/cxxapi/inherit__graph__19.png +0 -0
  216. data/doc/cxxapi/inherit__graph__2.map +1 -1
  217. data/doc/cxxapi/inherit__graph__2.md5 +1 -1
  218. data/doc/cxxapi/inherit__graph__2.png +0 -0
  219. data/doc/cxxapi/inherit__graph__20.map +1 -2
  220. data/doc/cxxapi/inherit__graph__20.md5 +1 -1
  221. data/doc/cxxapi/inherit__graph__20.png +0 -0
  222. data/doc/cxxapi/inherit__graph__21.map +1 -1
  223. data/doc/cxxapi/inherit__graph__21.md5 +1 -1
  224. data/doc/cxxapi/inherit__graph__21.png +0 -0
  225. data/doc/cxxapi/inherit__graph__22.map +1 -0
  226. data/doc/cxxapi/inherit__graph__22.md5 +1 -0
  227. data/doc/cxxapi/inherit__graph__22.png +0 -0
  228. data/doc/cxxapi/inherit__graph__23.map +1 -0
  229. data/doc/cxxapi/inherit__graph__23.md5 +1 -0
  230. data/doc/cxxapi/inherit__graph__23.png +0 -0
  231. data/doc/cxxapi/inherit__graph__24.map +1 -0
  232. data/doc/cxxapi/inherit__graph__24.md5 +1 -0
  233. data/doc/cxxapi/inherit__graph__24.png +0 -0
  234. data/doc/cxxapi/inherit__graph__25.map +1 -0
  235. data/doc/cxxapi/inherit__graph__25.md5 +1 -0
  236. data/doc/cxxapi/inherit__graph__25.png +0 -0
  237. data/doc/cxxapi/inherit__graph__26.map +1 -0
  238. data/doc/cxxapi/inherit__graph__26.md5 +1 -0
  239. data/doc/cxxapi/inherit__graph__26.png +0 -0
  240. data/doc/cxxapi/inherit__graph__27.map +2 -0
  241. data/doc/cxxapi/inherit__graph__27.md5 +1 -0
  242. data/doc/cxxapi/inherit__graph__27.png +0 -0
  243. data/doc/cxxapi/inherit__graph__28.map +1 -0
  244. data/doc/cxxapi/inherit__graph__28.md5 +1 -0
  245. data/doc/cxxapi/inherit__graph__28.png +0 -0
  246. data/doc/cxxapi/inherit__graph__29.map +1 -0
  247. data/doc/cxxapi/inherit__graph__29.md5 +1 -0
  248. data/doc/cxxapi/inherit__graph__29.png +0 -0
  249. data/doc/cxxapi/inherit__graph__3.map +2 -1
  250. data/doc/cxxapi/inherit__graph__3.md5 +1 -1
  251. data/doc/cxxapi/inherit__graph__3.png +0 -0
  252. data/doc/cxxapi/inherit__graph__30.map +1 -0
  253. data/doc/cxxapi/inherit__graph__30.md5 +1 -0
  254. data/doc/cxxapi/inherit__graph__30.png +0 -0
  255. data/doc/cxxapi/inherit__graph__31.map +3 -0
  256. data/doc/cxxapi/inherit__graph__31.md5 +1 -0
  257. data/doc/cxxapi/inherit__graph__31.png +0 -0
  258. data/doc/cxxapi/inherit__graph__32.map +1 -0
  259. data/doc/cxxapi/inherit__graph__32.md5 +1 -0
  260. data/doc/cxxapi/inherit__graph__32.png +0 -0
  261. data/doc/cxxapi/inherit__graph__33.map +1 -0
  262. data/doc/cxxapi/inherit__graph__33.md5 +1 -0
  263. data/doc/cxxapi/inherit__graph__33.png +0 -0
  264. data/doc/cxxapi/inherit__graph__34.map +1 -0
  265. data/doc/cxxapi/inherit__graph__34.md5 +1 -0
  266. data/doc/cxxapi/inherit__graph__34.png +0 -0
  267. data/doc/cxxapi/inherit__graph__35.map +1 -0
  268. data/doc/cxxapi/inherit__graph__35.md5 +1 -0
  269. data/doc/cxxapi/inherit__graph__35.png +0 -0
  270. data/doc/cxxapi/inherit__graph__36.map +1 -0
  271. data/doc/cxxapi/inherit__graph__36.md5 +1 -0
  272. data/doc/cxxapi/inherit__graph__36.png +0 -0
  273. data/doc/cxxapi/inherit__graph__4.map +1 -1
  274. data/doc/cxxapi/inherit__graph__4.md5 +1 -1
  275. data/doc/cxxapi/inherit__graph__4.png +0 -0
  276. data/doc/cxxapi/inherit__graph__5.map +1 -1
  277. data/doc/cxxapi/inherit__graph__5.md5 +1 -1
  278. data/doc/cxxapi/inherit__graph__5.png +0 -0
  279. data/doc/cxxapi/inherit__graph__6.map +1 -2
  280. data/doc/cxxapi/inherit__graph__6.md5 +1 -1
  281. data/doc/cxxapi/inherit__graph__6.png +0 -0
  282. data/doc/cxxapi/inherit__graph__7.map +1 -1
  283. data/doc/cxxapi/inherit__graph__7.md5 +1 -1
  284. data/doc/cxxapi/inherit__graph__7.png +0 -0
  285. data/doc/cxxapi/inherit__graph__8.map +1 -1
  286. data/doc/cxxapi/inherit__graph__8.md5 +1 -1
  287. data/doc/cxxapi/inherit__graph__8.png +0 -0
  288. data/doc/cxxapi/inherit__graph__9.map +1 -1
  289. data/doc/cxxapi/inherit__graph__9.md5 +1 -1
  290. data/doc/cxxapi/inherit__graph__9.png +0 -0
  291. data/doc/cxxapi/inherits.html +81 -41
  292. data/doc/cxxapi/main.html +1 -1
  293. data/doc/cxxapi/md5_8h-source.html +121 -0
  294. data/doc/cxxapi/modules.html +1 -1
  295. data/doc/cxxapi/namespacePassenger.html +651 -0
  296. data/doc/cxxapi/namespacemembers.html +155 -0
  297. data/doc/cxxapi/namespacemembers_enum.html +46 -0
  298. data/doc/cxxapi/namespacemembers_eval.html +52 -0
  299. data/doc/cxxapi/namespacemembers_func.html +139 -0
  300. data/doc/cxxapi/namespacemembers_type.html +50 -0
  301. data/doc/cxxapi/namespaces.html +34 -0
  302. data/doc/cxxapi/nginx_2Configuration_8h-source.html +114 -0
  303. data/doc/cxxapi/ngx__http__passenger__module_8h-source.html +91 -0
  304. data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +2 -1
  305. data/doc/cxxapi/structPassenger_1_1AnythingToString.html +3 -2
  306. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +2 -1
  307. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +3 -2
  308. data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard-members.html +33 -0
  309. data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard.html +49 -0
  310. data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +19 -7
  311. data/doc/cxxapi/structPassenger_1_1PoolOptions.html +323 -53
  312. data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash-members.html +33 -0
  313. data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash.html +49 -0
  314. data/ext/common/MessageChannel.h +48 -4
  315. data/ext/common/Version.h +1 -1
  316. data/ext/nginx/HttpStatusExtractor.h +1 -0
  317. data/ext/nginx/ScgiRequestParser.h +1 -0
  318. data/ext/phusion_passenger/native_support.c +5 -1
  319. data/lib/phusion_passenger/constants.rb +1 -1
  320. data/lib/phusion_passenger/message_channel.rb +45 -3
  321. data/lib/phusion_passenger/rack/application_spawner.rb +4 -0
  322. data/lib/phusion_passenger/railz/application_spawner.rb +19 -1
  323. data/lib/phusion_passenger/utils.rb +3 -3
  324. data/lib/phusion_passenger/utils/rewindable_input.rb +5 -0
  325. data/test/MessageChannelTest.cpp +9 -1
  326. data/test/stub/message_channel.rb +1 -1
  327. data/test/stub/message_channel_2.rb +1 -1
  328. data/test/stub/message_channel_3.rb +2 -2
  329. metadata +173 -113
  330. data/doc/cxxapi/ApplicationPoolServer_8h-source.html +0 -833
  331. data/doc/cxxapi/ApplicationPool_8h-source.html +0 -226
  332. data/doc/cxxapi/Application_8h-source.html +0 -553
  333. data/doc/cxxapi/DummySpawnManager_8h-source.html +0 -130
  334. data/doc/cxxapi/FileChecker_8h-source.html +0 -134
  335. data/doc/cxxapi/StandardApplicationPool_8h-source.html +0 -842
  336. data/doc/cxxapi/classPassenger_1_1Application.html +0 -231
  337. data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +0 -41
  338. data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +0 -323
  339. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +0 -227
  340. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.map +0 -1
  341. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.md5 +0 -1
  342. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
  343. data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +0 -44
  344. data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +0 -403
  345. data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +0 -53
  346. data/doc/cxxapi/classPassenger_1_1FileChecker.html +0 -124
  347. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +0 -44
  348. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +0 -342
  349. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.map +0 -1
  350. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.md5 +0 -1
  351. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
  352. data/doc/rdoc/classes/ConditionVariable.html +0 -194
  353. data/doc/rdoc/classes/Exception.html +0 -120
  354. data/doc/rdoc/classes/GC.html +0 -113
  355. data/doc/rdoc/classes/IO.html +0 -169
  356. data/doc/rdoc/classes/PhusionPassenger.html +0 -239
  357. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -153
  358. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -517
  359. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -719
  360. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  361. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
  362. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
  363. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
  364. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -598
  365. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -140
  366. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +0 -317
  367. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess/Instance.html +0 -138
  368. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -154
  369. data/doc/rdoc/classes/PhusionPassenger/Application.html +0 -283
  370. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
  371. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
  372. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -175
  373. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
  374. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
  375. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -489
  376. data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +0 -350
  377. data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
  378. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -188
  379. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -199
  380. data/doc/rdoc/classes/PhusionPassenger/Railz.html +0 -95
  381. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +0 -438
  382. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner/Error.html +0 -98
  383. data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +0 -200
  384. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +0 -436
  385. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner/Error.html +0 -98
  386. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +0 -155
  387. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -402
  388. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
  389. data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -805
  390. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -169
  391. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +0 -247
  392. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +0 -120
  393. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
  394. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
  395. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -188
  396. data/doc/rdoc/classes/PlatformInfo.html +0 -866
  397. data/doc/rdoc/classes/RakeExtensions.html +0 -197
  398. data/doc/rdoc/classes/Signal.html +0 -139
  399. data/doc/rdoc/created.rid +0 -1
  400. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -255
  401. data/doc/rdoc/files/README.html +0 -157
  402. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +0 -92
  403. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -129
  404. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -129
  405. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
  406. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
  407. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +0 -130
  408. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
  409. data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +0 -127
  410. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
  411. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
  412. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -134
  413. data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +0 -122
  414. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
  415. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -126
  416. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
  417. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
  418. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -127
  419. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -133
  420. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
  421. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +0 -140
  422. data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +0 -126
  423. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +0 -145
  424. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +0 -125
  425. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
  426. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -159
  427. data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +0 -100
  428. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -174
  429. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -129
  430. data/doc/rdoc/files/misc/rake/extensions_rb.html +0 -130
  431. data/doc/rdoc/fr_class_index.html +0 -93
  432. data/doc/rdoc/fr_file_index.html +0 -77
  433. data/doc/rdoc/fr_method_index.html +0 -212
  434. data/doc/rdoc/index.html +0 -26
  435. data/doc/rdoc/rdoc-style.css +0 -187
@@ -1,125 +0,0 @@
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::UnknownError</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::UnknownError</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/exceptions_rb.html">lib/phusion_passenger/exceptions.rb</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- StandardError
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
-
79
-
80
-
81
- <div class="sectiontitle">Methods</div>
82
- <ul>
83
- <li><a href="#M000162">new</a></li>
84
- </ul>
85
-
86
-
87
-
88
-
89
-
90
- <div class="sectiontitle">Attributes</div>
91
- <table border='0' cellpadding='5'>
92
- <tr valign='top'>
93
- <td class='attr-rw'>
94
- [RW]
95
- </td>
96
- <td class='attr-name'>real_class_name</td>
97
- <td class='attr-desc'></td>
98
- </tr>
99
- </table>
100
-
101
- <div class="sectiontitle">Public Class methods</div>
102
- <div class="method">
103
- <div class="title">
104
- <a name="M000162"></a><b>new</b>(message, class_name, backtrace)
105
- </div>
106
- <div class="sourcecode">
107
- <p class="source-link">[ <a href="javascript:toggleSource('M000162_source')" id="l_M000162_source">show source</a> ]</p>
108
- <div id="M000162_source" class="dyn-source">
109
- <pre>
110
- <span class="ruby-comment cmt"># File lib/phusion_passenger/exceptions.rb, line 93</span>
111
- 93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">class_name</span>, <span class="ruby-identifier">backtrace</span>)
112
- 94: <span class="ruby-keyword kw">super</span>(<span class="ruby-node">&quot;#{message} (#{class_name})&quot;</span>)
113
- 95: <span class="ruby-identifier">set_backtrace</span>(<span class="ruby-identifier">backtrace</span>)
114
- 96: <span class="ruby-ivar">@real_class_name</span> = <span class="ruby-identifier">class_name</span>
115
- 97: <span class="ruby-keyword kw">end</span>
116
- </pre>
117
- </div>
118
- </div>
119
- </div>
120
- </div>
121
-
122
- </div>
123
-
124
- </body>
125
- </html>
@@ -1,805 +0,0 @@
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>Module: PhusionPassenger::Utils</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">Module</span><br />PhusionPassenger::Utils</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/utils_rb.html">lib/phusion_passenger/utils.rb</a>
61
- <a href="../../files/lib/phusion_passenger/utils/rewindable_input_rb.html">lib/phusion_passenger/utils/rewindable_input.rb</a>
62
- </td>
63
- </tr>
64
- </table>
65
- </td>
66
- </tr>
67
- </table>
68
- <!-- banner header -->
69
-
70
- <div id="bodyContent">
71
- <div id="content">
72
-
73
- <div class="description"><p>
74
- Utility functions.
75
- </p>
76
- </div>
77
-
78
-
79
-
80
- <div class="sectiontitle">Methods</div>
81
- <ul>
82
- <li><a href="#M000076">assert_valid_app_root</a></li>
83
- <li><a href="#M000077">assert_valid_directory</a></li>
84
- <li><a href="#M000078">assert_valid_file</a></li>
85
- <li><a href="#M000080">assert_valid_groupname</a></li>
86
- <li><a href="#M000079">assert_valid_username</a></li>
87
- <li><a href="#M000075">canonicalize_path</a></li>
88
- <li><a href="#M000081">close_all_io_objects_for_fds</a></li>
89
- <li><a href="#M000088">lower_privilege</a></li>
90
- <li><a href="#M000082">marshal_exception</a></li>
91
- <li><a href="#M000092">passenger_tmpdir</a></li>
92
- <li><a href="#M000093">passenger_tmpdir</a></li>
93
- <li><a href="#M000094">passenger_tmpdir=</a></li>
94
- <li><a href="#M000084">print_exception</a></li>
95
- <li><a href="#M000086">report_app_init_status</a></li>
96
- <li><a href="#M000085">safe_fork</a></li>
97
- <li><a href="#M000091">sanitize_spawn_options</a></li>
98
- <li><a href="#M000089">switch_to_user</a></li>
99
- <li><a href="#M000090">to_boolean</a></li>
100
- <li><a href="#M000087">unmarshal_and_raise_errors</a></li>
101
- <li><a href="#M000083">unmarshal_exception</a></li>
102
- </ul>
103
-
104
-
105
-
106
- <div class="sectiontitle">Classes and Modules</div>
107
- Class <a href="Utils/PseudoIO.html" class="link">PhusionPassenger::Utils::PseudoIO</a><br />
108
- Class <a href="Utils/RewindableInput.html" class="link">PhusionPassenger::Utils::RewindableInput</a><br />
109
-
110
-
111
-
112
-
113
- <div class="sectiontitle">Protected Class methods</div>
114
- <div class="method">
115
- <div class="title">
116
- <a name="M000093"></a><b>passenger_tmpdir</b>(create = true)
117
- </div>
118
- <div class="description">
119
- <p>
120
- Returns the directory in which to store Phusion Passenger-specific
121
- temporary files. If <tt>create</tt> is true, then this method creates the
122
- directory if it doesn&#8216;t exist.
123
- </p>
124
- </div>
125
- <div class="sourcecode">
126
- <p class="source-link">[ <a href="javascript:toggleSource('M000093_source')" id="l_M000093_source">show source</a> ]</p>
127
- <div id="M000093_source" class="dyn-source">
128
- <pre>
129
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 421</span>
130
- 421: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">passenger_tmpdir</span>(<span class="ruby-identifier">create</span> = <span class="ruby-keyword kw">true</span>)
131
- 422: <span class="ruby-identifier">dir</span> = <span class="ruby-ivar">@@passenger_tmpdir</span>
132
- 423: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">empty?</span>
133
- 424: <span class="ruby-identifier">dir</span> = <span class="ruby-node">&quot;#{Dir.tmpdir}/passenger.#{Process.pid}&quot;</span>
134
- 425: <span class="ruby-ivar">@@passenger_tmpdir</span> = <span class="ruby-identifier">dir</span>
135
- 426: <span class="ruby-keyword kw">end</span>
136
- 427: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">create</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">dir</span>)
137
- 428: <span class="ruby-comment cmt"># This is a very minimal implementation of the function</span>
138
- 429: <span class="ruby-comment cmt"># passengerCreateTempDir() in Utils.cpp. This implementation</span>
139
- 430: <span class="ruby-comment cmt"># is only meant to make the unit tests pass. For production</span>
140
- 431: <span class="ruby-comment cmt"># systems one should pre-create the temp directory with</span>
141
- 432: <span class="ruby-comment cmt"># passengerCreateTempDir().</span>
142
- 433: <span class="ruby-identifier">system</span>(<span class="ruby-value str">&quot;mkdir&quot;</span>, <span class="ruby-value str">&quot;-p&quot;</span>, <span class="ruby-value str">&quot;-m&quot;</span>, <span class="ruby-value str">&quot;u=wxs,g=wx,o=wx&quot;</span>, <span class="ruby-identifier">dir</span>)
143
- 434: <span class="ruby-identifier">system</span>(<span class="ruby-value str">&quot;mkdir&quot;</span>, <span class="ruby-value str">&quot;-p&quot;</span>, <span class="ruby-value str">&quot;-m&quot;</span>, <span class="ruby-value str">&quot;u=wxs,g=wx,o=wx&quot;</span>, <span class="ruby-node">&quot;#{dir}/backends&quot;</span>)
144
- 435: <span class="ruby-keyword kw">end</span>
145
- 436: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">dir</span>
146
- 437: <span class="ruby-keyword kw">end</span>
147
- </pre>
148
- </div>
149
- </div>
150
- </div>
151
- <div class="method">
152
- <div class="title">
153
- <a name="M000094"></a><b>passenger_tmpdir=</b>(dir)
154
- </div>
155
- <div class="sourcecode">
156
- <p class="source-link">[ <a href="javascript:toggleSource('M000094_source')" id="l_M000094_source">show source</a> ]</p>
157
- <div id="M000094_source" class="dyn-source">
158
- <pre>
159
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 439</span>
160
- 439: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">passenger_tmpdir=</span>(<span class="ruby-identifier">dir</span>)
161
- 440: <span class="ruby-ivar">@@passenger_tmpdir</span> = <span class="ruby-identifier">dir</span>
162
- 441: <span class="ruby-keyword kw">end</span>
163
- </pre>
164
- </div>
165
- </div>
166
- </div>
167
- <div class="sectiontitle">Protected Instance methods</div>
168
- <div class="method">
169
- <div class="title">
170
- <a name="M000076"></a><b>assert_valid_app_root</b>(app_root)
171
- </div>
172
- <div class="description">
173
- <p>
174
- Assert that <tt>app_root</tt> is a valid Ruby on Rails application root.
175
- Raises <a href="InvalidPath.html">InvalidPath</a> if that is not the case.
176
- </p>
177
- </div>
178
- <div class="sourcecode">
179
- <p class="source-link">[ <a href="javascript:toggleSource('M000076_source')" id="l_M000076_source">show source</a> ]</p>
180
- <div id="M000076_source" class="dyn-source">
181
- <pre>
182
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 61</span>
183
- 61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_app_root</span>(<span class="ruby-identifier">app_root</span>)
184
- 62: <span class="ruby-identifier">assert_valid_directory</span>(<span class="ruby-identifier">app_root</span>)
185
- 63: <span class="ruby-identifier">assert_valid_file</span>(<span class="ruby-node">&quot;#{app_root}/config/environment.rb&quot;</span>)
186
- 64: <span class="ruby-keyword kw">end</span>
187
- </pre>
188
- </div>
189
- </div>
190
- </div>
191
- <div class="method">
192
- <div class="title">
193
- <a name="M000077"></a><b>assert_valid_directory</b>(path)
194
- </div>
195
- <div class="description">
196
- <p>
197
- Assert that <tt>path</tt> is a directory. Raises <tt><a
198
- href="InvalidPath.html">InvalidPath</a></tt> if it isn&#8216;t.
199
- </p>
200
- </div>
201
- <div class="sourcecode">
202
- <p class="source-link">[ <a href="javascript:toggleSource('M000077_source')" id="l_M000077_source">show source</a> ]</p>
203
- <div id="M000077_source" class="dyn-source">
204
- <pre>
205
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 67</span>
206
- 67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_directory</span>(<span class="ruby-identifier">path</span>)
207
- 68: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">path</span>)
208
- 69: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidPath</span>, <span class="ruby-node">&quot;'#{path}' is not a valid directory.&quot;</span>
209
- 70: <span class="ruby-keyword kw">end</span>
210
- 71: <span class="ruby-keyword kw">end</span>
211
- </pre>
212
- </div>
213
- </div>
214
- </div>
215
- <div class="method">
216
- <div class="title">
217
- <a name="M000078"></a><b>assert_valid_file</b>(path)
218
- </div>
219
- <div class="description">
220
- <p>
221
- Assert that <tt>path</tt> is a file. Raises <tt><a
222
- href="InvalidPath.html">InvalidPath</a></tt> if it isn&#8216;t.
223
- </p>
224
- </div>
225
- <div class="sourcecode">
226
- <p class="source-link">[ <a href="javascript:toggleSource('M000078_source')" id="l_M000078_source">show source</a> ]</p>
227
- <div id="M000078_source" class="dyn-source">
228
- <pre>
229
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 74</span>
230
- 74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_file</span>(<span class="ruby-identifier">path</span>)
231
- 75: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">path</span>)
232
- 76: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidPath</span>, <span class="ruby-node">&quot;'#{path}' is not a valid file.&quot;</span>
233
- 77: <span class="ruby-keyword kw">end</span>
234
- 78: <span class="ruby-keyword kw">end</span>
235
- </pre>
236
- </div>
237
- </div>
238
- </div>
239
- <div class="method">
240
- <div class="title">
241
- <a name="M000080"></a><b>assert_valid_groupname</b>(groupname)
242
- </div>
243
- <div class="description">
244
- <p>
245
- Assert that <tt>groupname</tt> is a valid group name. Raises ArgumentError
246
- if that is not the case.
247
- </p>
248
- </div>
249
- <div class="sourcecode">
250
- <p class="source-link">[ <a href="javascript:toggleSource('M000080_source')" id="l_M000080_source">show source</a> ]</p>
251
- <div id="M000080_source" class="dyn-source">
252
- <pre>
253
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 89</span>
254
- 89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_groupname</span>(<span class="ruby-identifier">groupname</span>)
255
- 90: <span class="ruby-comment cmt"># If groupname does not exist then getgrnam() will raise an ArgumentError.</span>
256
- 91: <span class="ruby-identifier">groupname</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getgrnam</span>(<span class="ruby-identifier">groupname</span>)
257
- 92: <span class="ruby-keyword kw">end</span>
258
- </pre>
259
- </div>
260
- </div>
261
- </div>
262
- <div class="method">
263
- <div class="title">
264
- <a name="M000079"></a><b>assert_valid_username</b>(username)
265
- </div>
266
- <div class="description">
267
- <p>
268
- Assert that <tt>username</tt> is a valid username. Raises ArgumentError if
269
- that is not the case.
270
- </p>
271
- </div>
272
- <div class="sourcecode">
273
- <p class="source-link">[ <a href="javascript:toggleSource('M000079_source')" id="l_M000079_source">show source</a> ]</p>
274
- <div id="M000079_source" class="dyn-source">
275
- <pre>
276
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 82</span>
277
- 82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_username</span>(<span class="ruby-identifier">username</span>)
278
- 83: <span class="ruby-comment cmt"># If username does not exist then getpwnam() will raise an ArgumentError.</span>
279
- 84: <span class="ruby-identifier">username</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwnam</span>(<span class="ruby-identifier">username</span>)
280
- 85: <span class="ruby-keyword kw">end</span>
281
- </pre>
282
- </div>
283
- </div>
284
- </div>
285
- <div class="method">
286
- <div class="title">
287
- <a name="M000075"></a><b>canonicalize_path</b>(path)
288
- </div>
289
- <div class="description">
290
- <p>
291
- Return the canonicalized version of <tt>path</tt>. This path is guaranteed
292
- to to be &quot;normal&quot;, i.e. it doesn&#8216;t contain stuff like
293
- &quot;..&quot; or &quot;/&quot;, and it fully resolves symbolic links.
294
- </p>
295
- <p>
296
- Raises SystemCallError if something went wrong. Raises ArgumentError if
297
- <tt>path</tt> is nil. Raises <a href="InvalidPath.html">InvalidPath</a> if
298
- <tt>path</tt> does not appear to be a valid path.
299
- </p>
300
- </div>
301
- <div class="sourcecode">
302
- <p class="source-link">[ <a href="javascript:toggleSource('M000075_source')" id="l_M000075_source">show source</a> ]</p>
303
- <div id="M000075_source" class="dyn-source">
304
- <pre>
305
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 52</span>
306
- 52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">canonicalize_path</span>(<span class="ruby-identifier">path</span>)
307
- 53: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;The 'path' argument may not be nil&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">nil?</span>
308
- 54: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">realpath</span>.<span class="ruby-identifier">to_s</span>
309
- 55: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
310
- 56: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidAPath</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
311
- 57: <span class="ruby-keyword kw">end</span>
312
- </pre>
313
- </div>
314
- </div>
315
- </div>
316
- <div class="method">
317
- <div class="title">
318
- <a name="M000081"></a><b>close_all_io_objects_for_fds</b>(file_descriptors_to_leave_open)
319
- </div>
320
- <div class="sourcecode">
321
- <p class="source-link">[ <a href="javascript:toggleSource('M000081_source')" id="l_M000081_source">show source</a> ]</p>
322
- <div id="M000081_source" class="dyn-source">
323
- <pre>
324
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 94</span>
325
- 94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
326
- 95: <span class="ruby-constant">ObjectSpace</span>.<span class="ruby-identifier">each_object</span>(<span class="ruby-constant">IO</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">io</span><span class="ruby-operator">|</span>
327
- 96: <span class="ruby-keyword kw">begin</span>
328
- 97: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">file_descriptors_to_leave_open</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">io</span>.<span class="ruby-identifier">fileno</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">io</span>.<span class="ruby-identifier">closed?</span>
329
- 98: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">close</span>
330
- 99: <span class="ruby-keyword kw">end</span>
331
- 100: <span class="ruby-keyword kw">rescue</span>
332
- 101: <span class="ruby-keyword kw">end</span>
333
- 102: <span class="ruby-keyword kw">end</span>
334
- 103: <span class="ruby-keyword kw">end</span>
335
- </pre>
336
- </div>
337
- </div>
338
- </div>
339
- <div class="method">
340
- <div class="title">
341
- <a name="M000088"></a><b>lower_privilege</b>(filename, lowest_user = &quot;nobody&quot;)
342
- </div>
343
- <div class="description">
344
- <p>
345
- Lower the current process&#8216;s privilege to the owner of the given file.
346
- No exceptions will be raised in the event that privilege lowering fails.
347
- </p>
348
- </div>
349
- <div class="sourcecode">
350
- <p class="source-link">[ <a href="javascript:toggleSource('M000088_source')" id="l_M000088_source">show source</a> ]</p>
351
- <div id="M000088_source" class="dyn-source">
352
- <pre>
353
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 344</span>
354
- 344: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lower_privilege</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-identifier">lowest_user</span> = <span class="ruby-value str">&quot;nobody&quot;</span>)
355
- 345: <span class="ruby-identifier">stat</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">lstat</span>(<span class="ruby-identifier">filename</span>)
356
- 346: <span class="ruby-keyword kw">begin</span>
357
- 347: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">switch_to_user</span>(<span class="ruby-identifier">stat</span>.<span class="ruby-identifier">uid</span>)
358
- 348: <span class="ruby-identifier">switch_to_user</span>(<span class="ruby-identifier">lowest_user</span>)
359
- 349: <span class="ruby-keyword kw">end</span>
360
- 350: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EPERM</span>
361
- 351: <span class="ruby-comment cmt"># No problem if we were unable to switch user.</span>
362
- 352: <span class="ruby-keyword kw">end</span>
363
- 353: <span class="ruby-keyword kw">end</span>
364
- </pre>
365
- </div>
366
- </div>
367
- </div>
368
- <div class="method">
369
- <div class="title">
370
- <a name="M000082"></a><b>marshal_exception</b>(exception)
371
- </div>
372
- <div class="sourcecode">
373
- <p class="source-link">[ <a href="javascript:toggleSource('M000082_source')" id="l_M000082_source">show source</a> ]</p>
374
- <div id="M000082_source" class="dyn-source">
375
- <pre>
376
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 105</span>
377
- 105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">exception</span>)
378
- 106: <span class="ruby-identifier">data</span> = {
379
- 107: <span class="ruby-identifier">:message</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">message</span>,
380
- 108: <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>,
381
- 109: <span class="ruby-identifier">:backtrace</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace</span>
382
- 110: }
383
- 111: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">InitializationError</span>)
384
- 112: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:is_initialization_error</span>] = <span class="ruby-keyword kw">true</span>
385
- 113: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span>
386
- 114: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:child_exception</span>] = <span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span>)
387
- 115: <span class="ruby-keyword kw">end</span>
388
- 116: <span class="ruby-keyword kw">else</span>
389
- 117: <span class="ruby-keyword kw">begin</span>
390
- 118: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:exception</span>] = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">exception</span>)
391
- 119: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">TypeError</span>
392
- 120: <span class="ruby-identifier">e</span> = <span class="ruby-constant">UnknownError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">exception</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>,
393
- 121: <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace</span>)
394
- 122: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:exception</span>] = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">e</span>)
395
- 123: <span class="ruby-keyword kw">end</span>
396
- 124: <span class="ruby-keyword kw">end</span>
397
- 125: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">data</span>)
398
- 126: <span class="ruby-keyword kw">end</span>
399
- </pre>
400
- </div>
401
- </div>
402
- </div>
403
- <div class="method">
404
- <div class="title">
405
- <a name="M000092"></a><b>passenger_tmpdir</b>(create = true)
406
- </div>
407
- <div class="sourcecode">
408
- <p class="source-link">[ <a href="javascript:toggleSource('M000092_source')" id="l_M000092_source">show source</a> ]</p>
409
- <div id="M000092_source" class="dyn-source">
410
- <pre>
411
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 414</span>
412
- 414: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">passenger_tmpdir</span>(<span class="ruby-identifier">create</span> = <span class="ruby-keyword kw">true</span>)
413
- 415: <span class="ruby-constant">PhusionPassenger</span><span class="ruby-operator">::</span><span class="ruby-constant">Utils</span>.<span class="ruby-identifier">passenger_tmpdir</span>(<span class="ruby-identifier">create</span>)
414
- 416: <span class="ruby-keyword kw">end</span>
415
- </pre>
416
- </div>
417
- </div>
418
- </div>
419
- <div class="method">
420
- <div class="title">
421
- <a name="M000084"></a><b>print_exception</b>(current_location, exception, destination = STDERR)
422
- </div>
423
- <div class="description">
424
- <p>
425
- Print the given exception, including the stack trace, to STDERR.
426
- </p>
427
- <p>
428
- <tt>current_location</tt> is a string which describes where the code is
429
- currently at. Usually the current class name will be enough.
430
- </p>
431
- </div>
432
- <div class="sourcecode">
433
- <p class="source-link">[ <a href="javascript:toggleSource('M000084_source')" id="l_M000084_source">show source</a> ]</p>
434
- <div id="M000084_source" class="dyn-source">
435
- <pre>
436
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 159</span>
437
- 159: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_exception</span>(<span class="ruby-identifier">current_location</span>, <span class="ruby-identifier">exception</span>, <span class="ruby-identifier">destination</span> = <span class="ruby-constant">STDERR</span>)
438
- 160: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">exception</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">SystemExit</span>)
439
- 161: <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace_string</span>(<span class="ruby-identifier">current_location</span>))
440
- 162: <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">flush</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:flush</span>)
441
- 163: <span class="ruby-keyword kw">end</span>
442
- 164: <span class="ruby-keyword kw">end</span>
443
- </pre>
444
- </div>
445
- </div>
446
- </div>
447
- <div class="method">
448
- <div class="title">
449
- <a name="M000086"></a><b>report_app_init_status</b>(channel, sink = STDERR) {|| ...}
450
- </div>
451
- <div class="description">
452
- <p>
453
- Run the given block. A message will be sent through <tt>channel</tt> (a <a
454
- href="MessageChannel.html">MessageChannel</a> object), telling the remote
455
- side whether the block raised an exception, called exit(), or succeeded.
456
- </p>
457
- <p>
458
- If <em>sink</em> is non-nil, then every operation on $stderr/STDERR inside
459
- the block will be performed on <em>sink</em> as well. If <em>sink</em> is
460
- nil then all operations on $stderr/STDERR inside the block will be silently
461
- discarded, i.e. if one writes to $stderr/STDERR then nothing will be
462
- actually written to the console.
463
- </p>
464
- <p>
465
- Returns whether the block succeeded, i.e. whether it didn&#8216;t raise an
466
- exception.
467
- </p>
468
- <p>
469
- Exceptions are not propagated, except SystemExit and a few
470
- non-StandardExeption classes such as SignalException. Of the exceptions
471
- that are propagated, only SystemExit will be reported.
472
- </p>
473
- </div>
474
- <div class="sourcecode">
475
- <p class="source-link">[ <a href="javascript:toggleSource('M000086_source')" id="l_M000086_source">show source</a> ]</p>
476
- <div id="M000086_source" class="dyn-source">
477
- <pre>
478
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 243</span>
479
- 243: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">report_app_init_status</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">sink</span> = <span class="ruby-constant">STDERR</span>)
480
- 244: <span class="ruby-keyword kw">begin</span>
481
- 245: <span class="ruby-identifier">old_global_stderr</span> = <span class="ruby-identifier">$stderr</span>
482
- 246: <span class="ruby-identifier">old_stderr</span> = <span class="ruby-constant">STDERR</span>
483
- 247: <span class="ruby-identifier">stderr_output</span> = <span class="ruby-value str">&quot;&quot;</span>
484
- 248:
485
- 249: <span class="ruby-identifier">pseudo_stderr</span> = <span class="ruby-constant">PseudoIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sink</span>)
486
- 250: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:remove_const</span>, <span class="ruby-value str">'STDERR'</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
487
- 251: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-value str">'STDERR'</span>, <span class="ruby-identifier">pseudo_stderr</span>)
488
- 252: <span class="ruby-identifier">$stderr</span> = <span class="ruby-identifier">pseudo_stderr</span>
489
- 253:
490
- 254: <span class="ruby-keyword kw">begin</span>
491
- 255: <span class="ruby-keyword kw">yield</span>
492
- 256: <span class="ruby-keyword kw">ensure</span>
493
- 257: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:remove_const</span>, <span class="ruby-value str">'STDERR'</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
494
- 258: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-value str">'STDERR'</span>, <span class="ruby-identifier">old_stderr</span>)
495
- 259: <span class="ruby-identifier">$stderr</span> = <span class="ruby-identifier">old_global_stderr</span>
496
- 260: <span class="ruby-identifier">stderr_output</span> = <span class="ruby-identifier">pseudo_stderr</span>.<span class="ruby-identifier">done!</span>
497
- 261: <span class="ruby-keyword kw">end</span>
498
- 262:
499
- 263: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'success'</span>)
500
- 264: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
501
- 265: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-constant">ScriptError</span>, <span class="ruby-constant">NoMemoryError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
502
- 266: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'TESTING_PASSENGER'</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'1'</span>
503
- 267: <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>)
504
- 268: <span class="ruby-keyword kw">end</span>
505
- 269: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'exception'</span>)
506
- 270: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">e</span>))
507
- 271: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">stderr_output</span>)
508
- 272: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
509
- 273: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemExit</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
510
- 274: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'exit'</span>)
511
- 275: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">e</span>))
512
- 276: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">stderr_output</span>)
513
- 277: <span class="ruby-identifier">raise</span>
514
- 278: <span class="ruby-keyword kw">end</span>
515
- 279: <span class="ruby-keyword kw">end</span>
516
- </pre>
517
- </div>
518
- </div>
519
- </div>
520
- <div class="method">
521
- <div class="title">
522
- <a name="M000085"></a><b>safe_fork</b>(current_location = self.class, double_fork = false) {|| ...}
523
- </div>
524
- <div class="description">
525
- <p>
526
- Fork a new process and run the given block inside the child process, just
527
- like fork(). Unlike fork(), this method is safe, i.e. there&#8216;s no way
528
- for the child process to escape the block. Any uncaught exceptions in the
529
- child process will be printed to standard output, citing
530
- <tt>current_location</tt> as the source. Futhermore, the child process will
531
- exit by calling Kernel#exit!, thereby bypassing any at_exit or ensure
532
- blocks.
533
- </p>
534
- <p>
535
- If <tt>double_fork</tt> is true, then the child process will fork and
536
- immediately exit. This technique can be used to avoid zombie processes, at
537
- the expense of not being able to waitpid() the second child.
538
- </p>
539
- </div>
540
- <div class="sourcecode">
541
- <p class="source-link">[ <a href="javascript:toggleSource('M000085_source')" id="l_M000085_source">show source</a> ]</p>
542
- <div id="M000085_source" class="dyn-source">
543
- <pre>
544
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 176</span>
545
- 176: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">safe_fork</span>(<span class="ruby-identifier">current_location</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">double_fork</span> = <span class="ruby-keyword kw">false</span>)
546
- 177: <span class="ruby-identifier">pid</span> = <span class="ruby-identifier">fork</span>
547
- 178: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>.<span class="ruby-identifier">nil?</span>
548
- 179: <span class="ruby-keyword kw">begin</span>
549
- 180: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">double_fork</span>
550
- 181: <span class="ruby-identifier">pid2</span> = <span class="ruby-identifier">fork</span>
551
- 182: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid2</span>.<span class="ruby-identifier">nil?</span>
552
- 183: <span class="ruby-identifier">srand</span>
553
- 184: <span class="ruby-keyword kw">yield</span>
554
- 185: <span class="ruby-keyword kw">end</span>
555
- 186: <span class="ruby-keyword kw">else</span>
556
- 187: <span class="ruby-identifier">srand</span>
557
- 188: <span class="ruby-keyword kw">yield</span>
558
- 189: <span class="ruby-keyword kw">end</span>
559
- 190: <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>
560
- 191: <span class="ruby-identifier">print_exception</span>(<span class="ruby-identifier">current_location</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>)
561
- 192: <span class="ruby-keyword kw">ensure</span>
562
- 193: <span class="ruby-identifier">exit!</span>
563
- 194: <span class="ruby-keyword kw">end</span>
564
- 195: <span class="ruby-keyword kw">else</span>
565
- 196: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">double_fork</span>
566
- 197: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-identifier">pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
567
- 198: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">pid</span>
568
- 199: <span class="ruby-keyword kw">else</span>
569
- 200: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">pid</span>
570
- 201: <span class="ruby-keyword kw">end</span>
571
- 202: <span class="ruby-keyword kw">end</span>
572
- 203: <span class="ruby-keyword kw">end</span>
573
- </pre>
574
- </div>
575
- </div>
576
- </div>
577
- <div class="method">
578
- <div class="title">
579
- <a name="M000091"></a><b>sanitize_spawn_options</b>(options)
580
- </div>
581
- <div class="sourcecode">
582
- <p class="source-link">[ <a href="javascript:toggleSource('M000091_source')" id="l_M000091_source">show source</a> ]</p>
583
- <div id="M000091_source" class="dyn-source">
584
- <pre>
585
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 392</span>
586
- 392: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
587
- 393: <span class="ruby-identifier">defaults</span> = {
588
- 394: <span class="ruby-value str">&quot;lower_privilege&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>,
589
- 395: <span class="ruby-value str">&quot;lowest_user&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;nobody&quot;</span>,
590
- 396: <span class="ruby-value str">&quot;environment&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;production&quot;</span>,
591
- 397: <span class="ruby-value str">&quot;app_type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;rails&quot;</span>,
592
- 398: <span class="ruby-value str">&quot;spawn_method&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;smart-lv2&quot;</span>,
593
- 399: <span class="ruby-value str">&quot;framework_spawner_timeout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">-1</span>,
594
- 400: <span class="ruby-value str">&quot;app_spawner_timeout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">-1</span>,
595
- 401: <span class="ruby-value str">&quot;print_exceptions&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
596
- 402: }
597
- 403: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
598
- 404: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lower_privilege&quot;</span>] = <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lower_privilege&quot;</span>])
599
- 405: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;framework_spawner_timeout&quot;</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;framework_spawner_timeout&quot;</span>].<span class="ruby-identifier">to_i</span>
600
- 406: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_spawner_timeout&quot;</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_spawner_timeout&quot;</span>].<span class="ruby-identifier">to_i</span>
601
- 407: <span class="ruby-comment cmt"># Force this to be a boolean for easy use with Utils#unmarshal_and_raise_errors.</span>
602
- 408: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;print_exceptions&quot;</span>] = <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;print_exceptions&quot;</span>])
603
- 409: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
604
- 410: <span class="ruby-keyword kw">end</span>
605
- </pre>
606
- </div>
607
- </div>
608
- </div>
609
- <div class="method">
610
- <div class="title">
611
- <a name="M000089"></a><b>switch_to_user</b>(user)
612
- </div>
613
- <div class="sourcecode">
614
- <p class="source-link">[ <a href="javascript:toggleSource('M000089_source')" id="l_M000089_source">show source</a> ]</p>
615
- <div id="M000089_source" class="dyn-source">
616
- <pre>
617
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 355</span>
618
- 355: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">switch_to_user</span>(<span class="ruby-identifier">user</span>)
619
- 356: <span class="ruby-keyword kw">begin</span>
620
- 357: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
621
- 358: <span class="ruby-identifier">pw</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwnam</span>(<span class="ruby-identifier">user</span>)
622
- 359: <span class="ruby-identifier">username</span> = <span class="ruby-identifier">user</span>
623
- 360: <span class="ruby-identifier">uid</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">uid</span>
624
- 361: <span class="ruby-identifier">gid</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">gid</span>
625
- 362: <span class="ruby-keyword kw">else</span>
626
- 363: <span class="ruby-identifier">pw</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwuid</span>(<span class="ruby-identifier">user</span>)
627
- 364: <span class="ruby-identifier">username</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">name</span>
628
- 365: <span class="ruby-identifier">uid</span> = <span class="ruby-identifier">user</span>
629
- 366: <span class="ruby-identifier">gid</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">gid</span>
630
- 367: <span class="ruby-keyword kw">end</span>
631
- 368: <span class="ruby-keyword kw">rescue</span>
632
- 369: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
633
- 370: <span class="ruby-keyword kw">end</span>
634
- 371: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uid</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
635
- 372: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
636
- 373: <span class="ruby-keyword kw">else</span>
637
- 374: <span class="ruby-comment cmt"># Some systems are broken. initgroups can fail because of</span>
638
- 375: <span class="ruby-comment cmt"># all kinds of stupid reasons. So we ignore any errors</span>
639
- 376: <span class="ruby-comment cmt"># raised by initgroups.</span>
640
- 377: <span class="ruby-keyword kw">begin</span>
641
- 378: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">groups</span> = <span class="ruby-constant">Process</span>.<span class="ruby-identifier">initgroups</span>(<span class="ruby-identifier">username</span>, <span class="ruby-identifier">gid</span>)
642
- 379: <span class="ruby-keyword kw">rescue</span>
643
- 380: <span class="ruby-keyword kw">end</span>
644
- 381: <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-constant">Sys</span>.<span class="ruby-identifier">setgid</span>(<span class="ruby-identifier">gid</span>)
645
- 382: <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-constant">Sys</span>.<span class="ruby-identifier">setuid</span>(<span class="ruby-identifier">uid</span>)
646
- 383: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'HOME'</span>] = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">dir</span>
647
- 384: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
648
- 385: <span class="ruby-keyword kw">end</span>
649
- 386: <span class="ruby-keyword kw">end</span>
650
- </pre>
651
- </div>
652
- </div>
653
- </div>
654
- <div class="method">
655
- <div class="title">
656
- <a name="M000090"></a><b>to_boolean</b>(value)
657
- </div>
658
- <div class="sourcecode">
659
- <p class="source-link">[ <a href="javascript:toggleSource('M000090_source')" id="l_M000090_source">show source</a> ]</p>
660
- <div id="M000090_source" class="dyn-source">
661
- <pre>
662
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 388</span>
663
- 388: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">value</span>)
664
- 389: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;false&quot;</span>)
665
- 390: <span class="ruby-keyword kw">end</span>
666
- </pre>
667
- </div>
668
- </div>
669
- </div>
670
- <div class="method">
671
- <div class="title">
672
- <a name="M000087"></a><b>unmarshal_and_raise_errors</b>(channel, print_exception = nil, app_type = &quot;rails&quot;)
673
- </div>
674
- <div class="description">
675
- <p>
676
- Receive status information that was sent to <tt>channel</tt> by <a
677
- href="Utils.html#M000086">report_app_init_status</a>. If an error occured
678
- according to the received information, then an appropriate exception will
679
- be raised.
680
- </p>
681
- <p>
682
- If <tt><a href="Utils.html#M000084">print_exception</a></tt> evaluates to
683
- true, then the exception message and the backtrace will also be printed.
684
- Where it is printed to depends on the type of <tt><a
685
- href="Utils.html#M000084">print_exception</a></tt>:
686
- </p>
687
- <ul>
688
- <li>If it responds to #puts, then the exception information will be printed
689
- using this method.
690
-
691
- </li>
692
- <li>If it responds to #to_str, then the exception information will be appended
693
- to the file whose filename equals the return value of the #to_str call.
694
-
695
- </li>
696
- <li>Otherwise, it will be printed to STDERR.
697
-
698
- </li>
699
- </ul>
700
- <p>
701
- Raises:
702
- </p>
703
- <ul>
704
- <li><a href="AppInitError.html">AppInitError</a>: this class wraps the
705
- exception information received through the channel.
706
-
707
- </li>
708
- <li>IOError, SystemCallError, SocketError: these errors are raised if an error
709
- occurred while receiving the information through the channel.
710
-
711
- </li>
712
- </ul>
713
- </div>
714
- <div class="sourcecode">
715
- <p class="source-link">[ <a href="javascript:toggleSource('M000087_source')" id="l_M000087_source">show source</a> ]</p>
716
- <div id="M000087_source" class="dyn-source">
717
- <pre>
718
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 303</span>
719
- 303: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unmarshal_and_raise_errors</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">print_exception</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">app_type</span> = <span class="ruby-value str">&quot;rails&quot;</span>)
720
- 304: <span class="ruby-identifier">args</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read</span>
721
- 305: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
722
- 306: <span class="ruby-identifier">raise</span> <span class="ruby-constant">EOFError</span>, <span class="ruby-value str">&quot;Unexpected end-of-file detected.&quot;</span>
723
- 307: <span class="ruby-keyword kw">end</span>
724
- 308: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
725
- 309: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'exception'</span>
726
- 310: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>)
727
- 311: <span class="ruby-identifier">stderr</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>
728
- 312: <span class="ruby-identifier">exception</span> = <span class="ruby-constant">AppInitError</span>.<span class="ruby-identifier">new</span>(
729
- 313: <span class="ruby-node">&quot;Application '#{@app_root}' raised an exception: &quot;</span> <span class="ruby-operator">&lt;&lt;</span>
730
- 314: <span class="ruby-node">&quot;#{child_exception.class} (#{child_exception.message})&quot;</span>,
731
- 315: <span class="ruby-identifier">child_exception</span>,
732
- 316: <span class="ruby-identifier">app_type</span>,
733
- 317: <span class="ruby-identifier">stderr</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">stderr</span>)
734
- 318: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'exit'</span>
735
- 319: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>)
736
- 320: <span class="ruby-identifier">stderr</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>
737
- 321: <span class="ruby-identifier">exception</span> = <span class="ruby-constant">AppInitError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;Application '#{@app_root}' exited during startup&quot;</span>,
738
- 322: <span class="ruby-identifier">child_exception</span>, <span class="ruby-identifier">app_type</span>, <span class="ruby-identifier">stderr</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">stderr</span>)
739
- 323: <span class="ruby-keyword kw">else</span>
740
- 324: <span class="ruby-identifier">exception</span> = <span class="ruby-keyword kw">nil</span>
741
- 325: <span class="ruby-keyword kw">end</span>
742
- 326:
743
- 327: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">print_exception</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">exception</span>
744
- 328: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">print_exception</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:puts</span>)
745
- 329: <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">child_exception</span>, <span class="ruby-identifier">print_exception</span>)
746
- 330: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">print_exception</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_str</span>)
747
- 331: <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">print_exception</span>.<span class="ruby-identifier">to_str</span>
748
- 332: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'a'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
749
- 333: <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">child_exception</span>, <span class="ruby-identifier">f</span>)
750
- 334: <span class="ruby-keyword kw">end</span>
751
- 335: <span class="ruby-keyword kw">else</span>
752
- 336: <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">child_exception</span>)
753
- 337: <span class="ruby-keyword kw">end</span>
754
- 338: <span class="ruby-keyword kw">end</span>
755
- 339: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">exception</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exception</span>
756
- 340: <span class="ruby-keyword kw">end</span>
757
- </pre>
758
- </div>
759
- </div>
760
- </div>
761
- <div class="method">
762
- <div class="title">
763
- <a name="M000083"></a><b>unmarshal_exception</b>(data)
764
- </div>
765
- <div class="sourcecode">
766
- <p class="source-link">[ <a href="javascript:toggleSource('M000083_source')" id="l_M000083_source">show source</a> ]</p>
767
- <div id="M000083_source" class="dyn-source">
768
- <pre>
769
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 128</span>
770
- 128: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">data</span>)
771
- 129: <span class="ruby-identifier">hash</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">data</span>)
772
- 130: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:is_initialization_error</span>]
773
- 131: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:child_exception</span>]
774
- 132: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:child_exception</span>])
775
- 133: <span class="ruby-keyword kw">else</span>
776
- 134: <span class="ruby-identifier">child_exception</span> = <span class="ruby-keyword kw">nil</span>
777
- 135: <span class="ruby-keyword kw">end</span>
778
- 136:
779
- 137: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:class</span>]
780
- 138: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">AppInitError</span>.<span class="ruby-identifier">to_s</span>
781
- 139: <span class="ruby-identifier">exception_class</span> = <span class="ruby-constant">AppInitError</span>
782
- 140: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">FrameworkInitError</span>.<span class="ruby-identifier">to_s</span>
783
- 141: <span class="ruby-identifier">exception_class</span> = <span class="ruby-constant">FrameworkInitError</span>
784
- 142: <span class="ruby-keyword kw">else</span>
785
- 143: <span class="ruby-identifier">exception_class</span> = <span class="ruby-constant">InitializationError</span>
786
- 144: <span class="ruby-keyword kw">end</span>
787
- 145: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">exception_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:message</span>], <span class="ruby-identifier">child_exception</span>)
788
- 146: <span class="ruby-keyword kw">else</span>
789
- 147: <span class="ruby-keyword kw">begin</span>
790
- 148: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:exception</span>])
791
- 149: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">TypeError</span>
792
- 150: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">UnknownError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:message</span>], <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:class</span>], <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:backtrace</span>])
793
- 151: <span class="ruby-keyword kw">end</span>
794
- 152: <span class="ruby-keyword kw">end</span>
795
- 153: <span class="ruby-keyword kw">end</span>
796
- </pre>
797
- </div>
798
- </div>
799
- </div>
800
- </div>
801
-
802
- </div>
803
-
804
- </body>
805
- </html>