passenger 2.2.1 → 2.2.2

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 (216) hide show
  1. data/Rakefile +66 -79
  2. data/bin/passenger-install-nginx-module +1 -1
  3. data/bin/passenger-memory-stats +1 -1
  4. data/bin/passenger-spawn-server +8 -2
  5. data/doc/Users guide Apache.html +33 -49
  6. data/doc/Users guide Apache.txt +28 -27
  7. data/doc/Users guide Nginx.html +9 -19
  8. data/doc/Users guide Nginx.txt +8 -20
  9. data/doc/cxxapi/Bucket_8h-source.html +1 -1
  10. data/doc/cxxapi/Configuration_8h-source.html +297 -300
  11. data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
  12. data/doc/cxxapi/Hooks_8h-source.html +1 -1
  13. data/doc/cxxapi/annotated.html +1 -1
  14. data/doc/cxxapi/classHooks-members.html +1 -1
  15. data/doc/cxxapi/classHooks.html +1 -1
  16. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
  17. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
  18. data/doc/cxxapi/classes.html +1 -1
  19. data/doc/cxxapi/definitions_8h-source.html +1 -1
  20. data/doc/cxxapi/files.html +1 -1
  21. data/doc/cxxapi/functions.html +1 -1
  22. data/doc/cxxapi/functions_func.html +1 -1
  23. data/doc/cxxapi/graph_legend.html +1 -1
  24. data/doc/cxxapi/group__Configuration.html +1 -23
  25. data/doc/cxxapi/group__Core.html +1 -1
  26. data/doc/cxxapi/group__Hooks.html +1 -1
  27. data/doc/cxxapi/group__Support.html +1 -1
  28. data/doc/cxxapi/main.html +1 -1
  29. data/doc/cxxapi/modules.html +1 -1
  30. data/doc/users_guide_snippets/rackup_specifications.txt +4 -2
  31. data/ext/apache2/Configuration.h +0 -3
  32. data/ext/apache2/Hooks.cpp +5 -3
  33. data/ext/common/ApplicationPoolServer.h +1 -0
  34. data/ext/common/ApplicationPoolServerExecutable.cpp +5 -2
  35. data/ext/common/SpawnManager.h +1 -0
  36. data/ext/common/Utils.cpp +22 -23
  37. data/ext/common/Utils.h +32 -21
  38. data/ext/common/Version.h +31 -0
  39. data/ext/nginx/ContentHandler.c +61 -8
  40. data/ext/nginx/HelperServer.cpp +3 -0
  41. data/ext/nginx/HttpStatusExtractor.h +185 -0
  42. data/ext/nginx/StaticContentHandler.c +18 -3
  43. data/ext/nginx/config +2 -1
  44. data/ext/nginx/ngx_http_passenger_module.c +21 -15
  45. data/ext/oxt/backtrace.cpp +4 -2
  46. data/ext/oxt/spin_lock.hpp +3 -3
  47. data/lib/phusion_passenger/abstract_request_handler.rb +5 -3
  48. data/lib/phusion_passenger/admin_tools/control_process.rb +6 -1
  49. data/lib/phusion_passenger/constants.rb +2 -2
  50. data/lib/phusion_passenger/rack/application_spawner.rb +2 -1
  51. data/lib/phusion_passenger/rack/request_handler.rb +45 -35
  52. data/lib/phusion_passenger/templates/nginx/config_snippets.txt.erb +1 -1
  53. data/lib/phusion_passenger/utils.rb +13 -3
  54. data/misc/rake/cplusplus.rb +7 -0
  55. data/test/ApplicationPoolServer_ApplicationPoolTest.cpp +2 -0
  56. data/test/ApplicationPoolTest.cpp +39 -62
  57. data/test/CxxTestMain.cpp +6 -6
  58. data/test/HttpStatusExtractorTest.cpp +17 -0
  59. data/test/StandardApplicationPoolTest.cpp +2 -0
  60. data/test/UtilsTest.cpp +17 -28
  61. data/test/ruby/abstract_request_handler_spec.rb +3 -7
  62. data/test/ruby/utils_spec.rb +18 -13
  63. data/test/ruby/wsgi/application_spawner_spec.rb +5 -9
  64. data/test/stub/railsapp/app/controllers/{bar_controller_1.rb → bar_controller.rb} +0 -0
  65. data/test/stub/railsapp/app/controllers/bar_controller_1.txt +5 -0
  66. data/test/stub/railsapp/app/controllers/{bar_controller_2.rb → bar_controller_2.txt} +0 -0
  67. data/test/support/Support.h +20 -0
  68. data/test/support/config.rb +13 -0
  69. data/vendor/README +4 -3
  70. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/COPYING +1 -1
  71. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/KNOWN-ISSUES +0 -0
  72. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/README +54 -7
  73. data/vendor/rack-1.0.0-git/Rakefile +164 -0
  74. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack.rb +7 -3
  75. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/adapter/camping.rb +0 -0
  76. data/vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb +37 -0
  77. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/abstract/request.rb +0 -0
  78. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/basic.rb +0 -0
  79. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/md5.rb +1 -1
  80. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/nonce.rb +0 -0
  81. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/params.rb +0 -0
  82. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/request.rb +2 -2
  83. data/vendor/rack-1.0.0-git/lib/rack/auth/openid.rb +480 -0
  84. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/builder.rb +1 -5
  85. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/cascade.rb +0 -0
  86. data/vendor/rack-1.0.0-git/lib/rack/chunked.rb +49 -0
  87. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/commonlogger.rb +0 -0
  88. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/conditionalget.rb +4 -0
  89. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/content_length.rb +7 -3
  90. data/vendor/rack-1.0.0-git/lib/rack/content_type.rb +23 -0
  91. data/vendor/rack-1.0.0-git/lib/rack/deflater.rb +96 -0
  92. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/directory.rb +5 -2
  93. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/file.rb +4 -1
  94. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler.rb +22 -1
  95. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/cgi.rb +7 -3
  96. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/evented_mongrel.rb +0 -0
  97. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/fastcgi.rb +26 -24
  98. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/lsws.rb +7 -4
  99. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/mongrel.rb +5 -3
  100. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/scgi.rb +5 -3
  101. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/swiftiplied_mongrel.rb +0 -0
  102. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/thin.rb +3 -0
  103. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/webrick.rb +11 -5
  104. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/head.rb +0 -0
  105. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/lint.rb +138 -66
  106. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/lobster.rb +0 -0
  107. data/vendor/rack-1.0.0-git/lib/rack/lock.rb +16 -0
  108. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/methodoverride.rb +0 -0
  109. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/mime.rb +4 -4
  110. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/mock.rb +42 -5
  111. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/recursive.rb +0 -0
  112. data/vendor/rack-1.0.0-git/lib/rack/reloader.rb +106 -0
  113. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/request.rb +46 -10
  114. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/response.rb +15 -3
  115. data/vendor/rack-1.0.0-git/lib/rack/rewindable_input.rb +98 -0
  116. data/vendor/rack-1.0.0-git/lib/rack/session/abstract/id.rb +142 -0
  117. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/session/cookie.rb +2 -0
  118. data/vendor/rack-1.0.0-git/lib/rack/session/memcache.rb +109 -0
  119. data/vendor/rack-1.0.0-git/lib/rack/session/pool.rb +100 -0
  120. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/showexceptions.rb +2 -1
  121. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/showstatus.rb +1 -1
  122. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/static.rb +0 -0
  123. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/urlmap.rb +12 -5
  124. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/utils.rb +212 -65
  125. metadata +71 -170
  126. data/doc/rdoc/classes/ConditionVariable.html +0 -194
  127. data/doc/rdoc/classes/Exception.html +0 -120
  128. data/doc/rdoc/classes/GC.html +0 -113
  129. data/doc/rdoc/classes/IO.html +0 -169
  130. data/doc/rdoc/classes/PhusionPassenger.html +0 -238
  131. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -153
  132. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -506
  133. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -692
  134. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  135. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
  136. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
  137. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
  138. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -598
  139. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -140
  140. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +0 -264
  141. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess/Instance.html +0 -138
  142. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -154
  143. data/doc/rdoc/classes/PhusionPassenger/Application.html +0 -283
  144. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
  145. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
  146. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -175
  147. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
  148. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
  149. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -489
  150. data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +0 -350
  151. data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
  152. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -185
  153. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -184
  154. data/doc/rdoc/classes/PhusionPassenger/Railz.html +0 -95
  155. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +0 -419
  156. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner/Error.html +0 -98
  157. data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +0 -200
  158. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +0 -443
  159. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner/Error.html +0 -98
  160. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +0 -154
  161. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -402
  162. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
  163. data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -694
  164. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
  165. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
  166. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -188
  167. data/doc/rdoc/classes/PlatformInfo.html +0 -831
  168. data/doc/rdoc/classes/RakeExtensions.html +0 -197
  169. data/doc/rdoc/classes/Signal.html +0 -134
  170. data/doc/rdoc/created.rid +0 -1
  171. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -240
  172. data/doc/rdoc/files/README.html +0 -157
  173. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +0 -92
  174. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -129
  175. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -131
  176. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
  177. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -130
  178. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +0 -129
  179. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
  180. data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +0 -127
  181. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
  182. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
  183. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -134
  184. data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +0 -122
  185. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
  186. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -126
  187. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -122
  188. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
  189. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -127
  190. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -133
  191. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -126
  192. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +0 -143
  193. data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +0 -126
  194. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +0 -145
  195. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +0 -127
  196. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
  197. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -161
  198. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -175
  199. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -129
  200. data/doc/rdoc/files/misc/rake/extensions_rb.html +0 -130
  201. data/doc/rdoc/fr_class_index.html +0 -90
  202. data/doc/rdoc/fr_file_index.html +0 -76
  203. data/doc/rdoc/fr_method_index.html +0 -195
  204. data/doc/rdoc/index.html +0 -26
  205. data/doc/rdoc/rdoc-style.css +0 -187
  206. data/vendor/rack-0.9.1/AUTHORS +0 -8
  207. data/vendor/rack-0.9.1/ChangeLog +0 -1423
  208. data/vendor/rack-0.9.1/Rakefile +0 -188
  209. data/vendor/rack-0.9.1/SPEC +0 -129
  210. data/vendor/rack-0.9.1/lib/rack/auth/abstract/handler.rb +0 -28
  211. data/vendor/rack-0.9.1/lib/rack/auth/openid.rb +0 -438
  212. data/vendor/rack-0.9.1/lib/rack/deflater.rb +0 -87
  213. data/vendor/rack-0.9.1/lib/rack/reloader.rb +0 -64
  214. data/vendor/rack-0.9.1/lib/rack/session/abstract/id.rb +0 -153
  215. data/vendor/rack-0.9.1/lib/rack/session/memcache.rb +0 -97
  216. data/vendor/rack-0.9.1/lib/rack/session/pool.rb +0 -73
@@ -1,98 +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::Railz::ApplicationSpawner::Error</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::Railz::ApplicationSpawner::Error</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/railz/application_spawner_rb.html">lib/phusion_passenger/railz/application_spawner.rb</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- AbstractServer::ServerError
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
- This exception means that the <a
80
- href="../ApplicationSpawner.html">ApplicationSpawner</a> server process
81
- exited unexpectedly.
82
- </p>
83
- </div>
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
- </div>
94
-
95
- </div>
96
-
97
- </body>
98
- </html>
@@ -1,200 +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::Railz::CGIFixed</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::Railz::CGIFixed</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/railz/cgi_fixed_rb.html">lib/phusion_passenger/railz/cgi_fixed.rb</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- ::CGI
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
- Modifies CGI so that we can use it. Main thing it does is expose the <a
80
- href="CGIFixed.html#M000046">stdinput</a> and <a
81
- href="CGIFixed.html#M000047">stdoutput</a> so <a
82
- href="RequestHandler.html">RequestHandler</a> can connect them to the right
83
- sources. It also exposes the <a href="CGIFixed.html#M000045">env_table</a>
84
- so that <a href="RequestHandler.html">RequestHandler</a> can hook the
85
- request parameters into the environment table.
86
- </p>
87
- <p>
88
- This is partially based on the FastCGI code, but much of the Ruby 1.6
89
- backwards compatibility is removed.
90
- </p>
91
- </div>
92
-
93
-
94
-
95
- <div class="sectiontitle">Methods</div>
96
- <ul>
97
- <li><a href="#M000044">args</a></li>
98
- <li><a href="#M000045">env_table</a></li>
99
- <li><a href="#M000043">new</a></li>
100
- <li><a href="#M000046">stdinput</a></li>
101
- <li><a href="#M000047">stdoutput</a></li>
102
- </ul>
103
-
104
-
105
-
106
-
107
-
108
-
109
- <div class="sectiontitle">Public Class methods</div>
110
- <div class="method">
111
- <div class="title">
112
- <a name="M000043"></a><b>new</b>(params, input, output, *args)
113
- </div>
114
- <div class="sourcecode">
115
- <p class="source-link">[ <a href="javascript:toggleSource('M000043_source')" id="l_M000043_source">show source</a> ]</p>
116
- <div id="M000043_source" class="dyn-source">
117
- <pre>
118
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/cgi_fixed.rb, line 42</span>
119
- 42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
120
- 43: <span class="ruby-ivar">@env_table</span> = <span class="ruby-identifier">params</span>
121
- 44: <span class="ruby-ivar">@args</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
122
- 45: <span class="ruby-ivar">@input</span> = <span class="ruby-identifier">input</span>
123
- 46: <span class="ruby-ivar">@out</span> = <span class="ruby-identifier">output</span>
124
- 47: <span class="ruby-keyword kw">super</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
125
- 48: <span class="ruby-keyword kw">end</span>
126
- </pre>
127
- </div>
128
- </div>
129
- </div>
130
- <div class="sectiontitle">Public Instance methods</div>
131
- <div class="method">
132
- <div class="title">
133
- <a name="M000044"></a><b>args</b>()
134
- </div>
135
- <div class="sourcecode">
136
- <p class="source-link">[ <a href="javascript:toggleSource('M000044_source')" id="l_M000044_source">show source</a> ]</p>
137
- <div id="M000044_source" class="dyn-source">
138
- <pre>
139
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/cgi_fixed.rb, line 50</span>
140
- 50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">args</span>
141
- 51: <span class="ruby-ivar">@args</span>
142
- 52: <span class="ruby-keyword kw">end</span>
143
- </pre>
144
- </div>
145
- </div>
146
- </div>
147
- <div class="method">
148
- <div class="title">
149
- <a name="M000045"></a><b>env_table</b>()
150
- </div>
151
- <div class="sourcecode">
152
- <p class="source-link">[ <a href="javascript:toggleSource('M000045_source')" id="l_M000045_source">show source</a> ]</p>
153
- <div id="M000045_source" class="dyn-source">
154
- <pre>
155
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/cgi_fixed.rb, line 54</span>
156
- 54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">env_table</span>
157
- 55: <span class="ruby-ivar">@env_table</span>
158
- 56: <span class="ruby-keyword kw">end</span>
159
- </pre>
160
- </div>
161
- </div>
162
- </div>
163
- <div class="method">
164
- <div class="title">
165
- <a name="M000046"></a><b>stdinput</b>()
166
- </div>
167
- <div class="sourcecode">
168
- <p class="source-link">[ <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show source</a> ]</p>
169
- <div id="M000046_source" class="dyn-source">
170
- <pre>
171
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/cgi_fixed.rb, line 58</span>
172
- 58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stdinput</span>
173
- 59: <span class="ruby-ivar">@input</span>
174
- 60: <span class="ruby-keyword kw">end</span>
175
- </pre>
176
- </div>
177
- </div>
178
- </div>
179
- <div class="method">
180
- <div class="title">
181
- <a name="M000047"></a><b>stdoutput</b>()
182
- </div>
183
- <div class="sourcecode">
184
- <p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p>
185
- <div id="M000047_source" class="dyn-source">
186
- <pre>
187
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/cgi_fixed.rb, line 62</span>
188
- 62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stdoutput</span>
189
- 63: <span class="ruby-ivar">@out</span>
190
- 64: <span class="ruby-keyword kw">end</span>
191
- </pre>
192
- </div>
193
- </div>
194
- </div>
195
- </div>
196
-
197
- </div>
198
-
199
- </body>
200
- </html>
@@ -1,443 +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::Railz::FrameworkSpawner</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::Railz::FrameworkSpawner</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/railz/framework_spawner_rb.html">lib/phusion_passenger/railz/framework_spawner.rb</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- AbstractServer
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
- This class is capable of spawning Ruby on Rails application instances
80
- quickly. This is done by preloading the Ruby on Rails framework into
81
- memory, before spawning the application instances.
82
- </p>
83
- <p>
84
- A single <a href="FrameworkSpawner.html">FrameworkSpawner</a> instance can
85
- only hold a single Ruby on Rails framework version. So be careful when
86
- using <a href="FrameworkSpawner.html">FrameworkSpawner</a>: the
87
- applications that you spawn through it must require the same RoR version.
88
- To handle multiple RoR versions, use multiple <a
89
- href="FrameworkSpawner.html">FrameworkSpawner</a> instances.
90
- </p>
91
- <p>
92
- <a href="FrameworkSpawner.html">FrameworkSpawner</a> uses <a
93
- href="ApplicationSpawner.html">ApplicationSpawner</a> internally.
94
- </p>
95
- <p>
96
- <b>Note</b>: <a href="FrameworkSpawner.html">FrameworkSpawner</a> may only
97
- be started asynchronously with <a
98
- href="../AbstractServer.html#M000126">AbstractServer#start</a>. Starting it
99
- synchronously with <a
100
- href="../AbstractServer.html#M000127">AbstractServer#start_synchronously</a>
101
- has not been tested.
102
- </p>
103
- </div>
104
-
105
-
106
-
107
- <div class="sectiontitle">Methods</div>
108
- <ul>
109
- <li><a href="#M000039">new</a></li>
110
- <li><a href="#M000042">reload</a></li>
111
- <li><a href="#M000041">spawn_application</a></li>
112
- <li><a href="#M000040">start</a></li>
113
- </ul>
114
-
115
- <div class="sectiontitle">Included Modules</div>
116
- <ul>
117
- <li><a href="../Utils.html">Utils</a></li>
118
- </ul>
119
-
120
-
121
- <div class="sectiontitle">Classes and Modules</div>
122
- Class <a href="FrameworkSpawner/Error.html" class="link">PhusionPassenger::Railz::FrameworkSpawner::Error</a><br />
123
-
124
-
125
-
126
-
127
- <div class="sectiontitle">Public Class methods</div>
128
- <div class="method">
129
- <div class="title">
130
- <a name="M000039"></a><b>new</b>(options = {})
131
- </div>
132
- <div class="description">
133
- <p>
134
- Creates a <a href="FrameworkSpawner.html#M000039">new</a> instance of <a
135
- href="FrameworkSpawner.html">FrameworkSpawner</a>.
136
- </p>
137
- <p>
138
- Valid options are:
139
- </p>
140
- <ul>
141
- <li><tt>:version</tt>: The Ruby on Rails version to use. It is not checked
142
- whether this version is actually installed.
143
-
144
- </li>
145
- <li><tt>:vendor</tt>: The directory to the vendor Rails framework to use. This
146
- is usually something like &quot;/webapps/foo/vendor/rails&quot;.
147
-
148
- </li>
149
- </ul>
150
- <p>
151
- It is not allowed to specify both <tt>version</tt> and <tt>vendor</tt>.
152
- </p>
153
- <p>
154
- All other options will be passed on to <a
155
- href="ApplicationSpawner.html">ApplicationSpawner</a> and <a
156
- href="RequestHandler.html">RequestHandler</a>.
157
- </p>
158
- <p>
159
- Note that the specified Rails framework will be loaded during the entire
160
- life time of the <a href="FrameworkSpawner.html">FrameworkSpawner</a>
161
- server. If you wish to <a href="FrameworkSpawner.html#M000042">reload</a>
162
- the Rails framework&#8216;s code, then restart the server by calling <a
163
- href="../AbstractServer.html#M000128">AbstractServer#stop</a> and <a
164
- href="../AbstractServer.html#M000126">AbstractServer#start</a>.
165
- </p>
166
- </div>
167
- <div class="sourcecode">
168
- <p class="source-link">[ <a href="javascript:toggleSource('M000039_source')" id="l_M000039_source">show source</a> ]</p>
169
- <div id="M000039_source" class="dyn-source">
170
- <pre>
171
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 69</span>
172
- 69: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
173
- 70: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">'[]'</span><span class="ruby-value str">'[]'</span>)
174
- 71: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;The 'options' argument not seem to be an options hash&quot;</span>
175
- 72: <span class="ruby-keyword kw">end</span>
176
- 73: <span class="ruby-ivar">@version</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:version</span>]
177
- 74: <span class="ruby-ivar">@vendor</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:vendor</span>]
178
- 75: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@version</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@vendor</span>
179
- 76: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;Either the 'version' or the 'vendor' option must specified&quot;</span>
180
- 77: <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@version</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@vendor</span>
181
- 78: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;It is not allowed to specify both the 'version' and the 'vendor' options&quot;</span>
182
- 79: <span class="ruby-keyword kw">end</span>
183
- 80:
184
- 81: <span class="ruby-keyword kw">super</span>()
185
- 82: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">max_idle_time</span> = <span class="ruby-constant">DEFAULT_FRAMEWORK_SPAWNER_MAX_IDLE_TIME</span>
186
- 83: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:spawn_application</span>, <span class="ruby-identifier">:handle_spawn_application</span>)
187
- 84: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:reload</span>, <span class="ruby-identifier">:handle_reload</span>)
188
- 85: <span class="ruby-keyword kw">end</span>
189
- </pre>
190
- </div>
191
- </div>
192
- </div>
193
- <div class="sectiontitle">Public Instance methods</div>
194
- <div class="method">
195
- <div class="title">
196
- <a name="M000042"></a><b>reload</b>(app_root = nil)
197
- </div>
198
- <div class="description">
199
- <p>
200
- Remove the cached application instances at the given application root. If
201
- nil is specified as application root, then all cached application instances
202
- will be removed, no matter the application root.
203
- </p>
204
- <p>
205
- <b>Long description:</b> <a href="../Application.html">Application</a> code
206
- might be cached in memory by a <a
207
- href="FrameworkSpawner.html">FrameworkSpawner</a>. But once it a while, it
208
- will be necessary to <a href="FrameworkSpawner.html#M000042">reload</a> the
209
- code for an application, such as after deploying a <a
210
- href="FrameworkSpawner.html#M000039">new</a> version of the application.
211
- This method makes sure that any cached application code is removed, so that
212
- the next time an application instance is spawned, the application code will
213
- be freshly loaded into memory.
214
- </p>
215
- <p>
216
- Raises:
217
- </p>
218
- <ul>
219
- <li>ArgumentError: <tt>app_root</tt> doesn&#8216;t appear to be a valid Ruby on
220
- Rails application root.
221
-
222
- </li>
223
- <li><a href="FrameworkSpawner/Error.html">FrameworkSpawner::Error</a>: The <a
224
- href="FrameworkSpawner.html">FrameworkSpawner</a> server exited
225
- unexpectedly.
226
-
227
- </li>
228
- </ul>
229
- </div>
230
- <div class="sourcecode">
231
- <p class="source-link">[ <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show source</a> ]</p>
232
- <div id="M000042_source" class="dyn-source">
233
- <pre>
234
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 203</span>
235
- 203: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload</span>(<span class="ruby-identifier">app_root</span> = <span class="ruby-keyword kw">nil</span>)
236
- 204: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">app_root</span>.<span class="ruby-identifier">nil?</span>
237
- 205: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;reload&quot;</span>)
238
- 206: <span class="ruby-keyword kw">else</span>
239
- 207: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;reload&quot;</span>, <span class="ruby-identifier">app_root</span>)
240
- 208: <span class="ruby-keyword kw">end</span>
241
- 209: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemCallError</span>, <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SocketError</span>
242
- 210: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-value str">&quot;The framework spawner server exited unexpectedly&quot;</span>
243
- 211: <span class="ruby-keyword kw">end</span>
244
- </pre>
245
- </div>
246
- </div>
247
- </div>
248
- <div class="method">
249
- <div class="title">
250
- <a name="M000041"></a><b>spawn_application</b>(app_root, options = {})
251
- </div>
252
- <div class="description">
253
- <p>
254
- Spawn a RoR application using the Ruby on Rails framework version
255
- associated with this <a href="FrameworkSpawner.html">FrameworkSpawner</a>.
256
- When successful, an <a href="../Application.html">Application</a> object
257
- will be returned, which represents the spawned RoR application.
258
- </p>
259
- <p>
260
- The following options are allowed:
261
- </p>
262
- <ul>
263
- <li><tt>lower_privilege</tt> and <tt>lowest_user</tt>: If
264
- <tt>lower_privilege</tt> is true, then <a
265
- href="ApplicationSpawner.html">ApplicationSpawner</a> will attempt to
266
- switch to the user who owns the application&#8216;s
267
- <tt>config/environment.rb</tt>, and to the default group of that user.
268
-
269
- <p>
270
- If that user doesn&#8216;t exist on the system, or if that user is root,
271
- then <a href="ApplicationSpawner.html">ApplicationSpawner</a> will attempt
272
- to switch to the username given by <tt>lowest_user</tt> (and to the default
273
- group of that user). If <tt>lowest_user</tt> doesn&#8216;t exist either, or
274
- if switching user failed (because the current process does not have the
275
- privilege to do so), then <a
276
- href="ApplicationSpawner.html">ApplicationSpawner</a> will continue without
277
- reporting an error.
278
- </p>
279
- </li>
280
- <li><tt>environment</tt>: Allows one to specify the RAILS_ENV environment to
281
- use.
282
-
283
- </li>
284
- </ul>
285
- <p>
286
- All other options will be passed on to <a
287
- href="ApplicationSpawner.html">ApplicationSpawner</a> and <a
288
- href="RequestHandler.html">RequestHandler</a>.
289
- </p>
290
- <p>
291
- <a href="FrameworkSpawner.html">FrameworkSpawner</a> will internally cache
292
- the code of applications, in order to speed up future spawning attempts.
293
- This implies that, if you&#8216;ve changed the application&#8216;s code,
294
- you must do one of these things:
295
- </p>
296
- <ul>
297
- <li>Restart this <a href="FrameworkSpawner.html">FrameworkSpawner</a> by
298
- calling <a href="../AbstractServer.html#M000128">AbstractServer#stop</a>,
299
- then <a href="../AbstractServer.html#M000126">AbstractServer#start</a>.
300
-
301
- </li>
302
- <li>Reload the application by calling <a
303
- href="FrameworkSpawner.html#M000042">reload</a> with the correct app_root
304
- argument.
305
-
306
- </li>
307
- </ul>
308
- <p>
309
- Raises:
310
- </p>
311
- <ul>
312
- <li><a
313
- href="../AbstractServer/ServerNotStarted.html">AbstractServer::ServerNotStarted</a>:
314
- The <a href="FrameworkSpawner.html">FrameworkSpawner</a> server
315
- hasn&#8216;t already been started.
316
-
317
- </li>
318
- <li>InvalidAppRoot: <tt>app_root</tt> doesn&#8216;t appear to be a valid Ruby
319
- on Rails application root.
320
-
321
- </li>
322
- <li><a href="../AppInitError.html">AppInitError</a>: The application raised an
323
- exception or called exit() during startup.
324
-
325
- </li>
326
- <li><a href="ApplicationSpawner/Error.html">ApplicationSpawner::Error</a>: The
327
- <a href="ApplicationSpawner.html">ApplicationSpawner</a> server exited
328
- unexpectedly.
329
-
330
- </li>
331
- <li><a href="FrameworkSpawner/Error.html">FrameworkSpawner::Error</a>: The <a
332
- href="FrameworkSpawner.html">FrameworkSpawner</a> server exited
333
- unexpectedly.
334
-
335
- </li>
336
- </ul>
337
- </div>
338
- <div class="sourcecode">
339
- <p class="source-link">[ <a href="javascript:toggleSource('M000041_source')" id="l_M000041_source">show source</a> ]</p>
340
- <div id="M000041_source" class="dyn-source">
341
- <pre>
342
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 155</span>
343
- 155: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">app_root</span>, <span class="ruby-identifier">options</span> = {})
344
- 156: <span class="ruby-identifier">assert_valid_app_root</span>(<span class="ruby-identifier">app_root</span>)
345
- 157: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
346
- 158: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>] = <span class="ruby-identifier">app_root</span>
347
- 159:
348
- 160: <span class="ruby-identifier">exception_to_propagate</span> = <span class="ruby-keyword kw">nil</span>
349
- 161: <span class="ruby-keyword kw">begin</span>
350
- 162: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;spawn_application&quot;</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">options</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">flatten</span>)
351
- 163: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">read</span>
352
- 164: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>
353
- 165: <span class="ruby-identifier">raise</span> <span class="ruby-constant">IOError</span>, <span class="ruby-value str">&quot;Connection closed&quot;</span>
354
- 166: <span class="ruby-keyword kw">end</span>
355
- 167: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'exception'</span>
356
- 168: <span class="ruby-identifier">e</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">server</span>.<span class="ruby-identifier">read_scalar</span>)
357
- 169: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:child_exception</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">child_exception</span>
358
- 170: <span class="ruby-comment cmt">#print_exception(self.class.to_s, e.child_exception)</span>
359
- 171: <span class="ruby-keyword kw">end</span>
360
- 172: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
361
- 173: <span class="ruby-keyword kw">else</span>
362
- 174: <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">listen_socket_name</span>, <span class="ruby-identifier">socket_type</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">read</span>
363
- 175: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>.<span class="ruby-identifier">nil?</span>
364
- 176: <span class="ruby-identifier">raise</span> <span class="ruby-constant">IOError</span>, <span class="ruby-value str">&quot;Connection closed&quot;</span>
365
- 177: <span class="ruby-keyword kw">end</span>
366
- 178: <span class="ruby-identifier">owner_pipe</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">recv_io</span>
367
- 179: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Application</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">app_root</span>, <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">listen_socket_name</span>,
368
- 180: <span class="ruby-identifier">socket_type</span>, <span class="ruby-identifier">owner_pipe</span>)
369
- 181: <span class="ruby-keyword kw">end</span>
370
- 182: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemCallError</span>, <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SocketError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
371
- 183: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-value str">&quot;The framework spawner server exited unexpectedly&quot;</span>
372
- 184: <span class="ruby-keyword kw">end</span>
373
- 185: <span class="ruby-keyword kw">end</span>
374
- </pre>
375
- </div>
376
- </div>
377
- </div>
378
- <div class="method">
379
- <div class="title">
380
- <a name="M000040"></a><b>start</b>()
381
- </div>
382
- <div class="description">
383
- <p>
384
- Overrided from <a
385
- href="../AbstractServer.html#M000126">AbstractServer#start</a>.
386
- </p>
387
- <p>
388
- May raise these additional exceptions:
389
- </p>
390
- <ul>
391
- <li><a href="../FrameworkInitError.html">FrameworkInitError</a>: The specified
392
- Ruby on Rails framework could not be loaded.
393
-
394
- </li>
395
- <li><a href="FrameworkSpawner/Error.html">FrameworkSpawner::Error</a>: The <a
396
- href="FrameworkSpawner.html">FrameworkSpawner</a> server exited
397
- unexpectedly.
398
-
399
- </li>
400
- </ul>
401
- </div>
402
- <div class="sourcecode">
403
- <p class="source-link">[ <a href="javascript:toggleSource('M000040_source')" id="l_M000040_source">show source</a> ]</p>
404
- <div id="M000040_source" class="dyn-source">
405
- <pre>
406
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 92</span>
407
- 92: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
408
- 93: <span class="ruby-keyword kw">super</span>
409
- 94: <span class="ruby-keyword kw">begin</span>
410
- 95: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">read</span>
411
- 96: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>
412
- 97: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-value str">&quot;The framework spawner server exited unexpectedly.&quot;</span>
413
- 98: <span class="ruby-keyword kw">else</span>
414
- 99: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">0</span>]
415
- 100: <span class="ruby-keyword kw">end</span>
416
- 101: <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>
417
- 102: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">server</span>.<span class="ruby-identifier">read_scalar</span>)
418
- 103: <span class="ruby-identifier">stop</span>
419
- 104: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@version</span>
420
- 105: <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Could not load Ruby on Rails framework version #{@version}: &quot;</span> <span class="ruby-operator">&lt;&lt;</span>
421
- 106: <span class="ruby-node">&quot;#{child_exception.class} (#{child_exception.message})&quot;</span>
422
- 107: <span class="ruby-keyword kw">else</span>
423
- 108: <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Could not load Ruby on Rails framework at '#{@vendor}': &quot;</span> <span class="ruby-operator">&lt;&lt;</span>
424
- 109: <span class="ruby-node">&quot;#{child_exception.class} (#{child_exception.message})&quot;</span>
425
- 110: <span class="ruby-keyword kw">end</span>
426
- 111: <span class="ruby-identifier">options</span> = { <span class="ruby-identifier">:vendor</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@vendor</span>, <span class="ruby-identifier">:version</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@version</span> }
427
- 112: <span class="ruby-identifier">raise</span> <span class="ruby-constant">FrameworkInitError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">child_exception</span>, <span class="ruby-identifier">options</span>)
428
- 113: <span class="ruby-keyword kw">end</span>
429
- 114: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SystemCallError</span>, <span class="ruby-constant">SocketError</span>
430
- 115: <span class="ruby-identifier">stop</span>
431
- 116: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-value str">&quot;The framework spawner server exited unexpectedly&quot;</span>
432
- 117: <span class="ruby-keyword kw">end</span>
433
- 118: <span class="ruby-keyword kw">end</span>
434
- </pre>
435
- </div>
436
- </div>
437
- </div>
438
- </div>
439
-
440
- </div>
441
-
442
- </body>
443
- </html>