passenger 2.2.2 → 2.2.3

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 (254) hide show
  1. data/DEVELOPERS.TXT +13 -3
  2. data/Rakefile +42 -33
  3. data/bin/passenger-install-apache2-module +1 -2
  4. data/bin/passenger-install-nginx-module +7 -19
  5. data/bin/passenger-status +64 -15
  6. data/bin/passenger-stress-test +2 -2
  7. data/doc/ApplicationPool algorithm.txt +26 -22
  8. data/doc/Users guide Apache.html +374 -149
  9. data/doc/Users guide Apache.txt +318 -51
  10. data/doc/Users guide Nginx.html +13 -13
  11. data/doc/Users guide Nginx.txt +7 -2
  12. data/doc/cxxapi/Bucket_8h-source.html +62 -25
  13. data/doc/cxxapi/Configuration_8h-source.html +343 -326
  14. data/doc/cxxapi/DirectoryMapper_8h-source.html +12 -12
  15. data/doc/cxxapi/Hooks_8h-source.html +1 -1
  16. data/doc/cxxapi/annotated.html +1 -1
  17. data/doc/cxxapi/classHooks-members.html +1 -1
  18. data/doc/cxxapi/classHooks.html +1 -1
  19. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +2 -2
  20. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +9 -9
  21. data/doc/cxxapi/classes.html +1 -1
  22. data/doc/cxxapi/definitions_8h-source.html +1 -1
  23. data/doc/cxxapi/files.html +1 -1
  24. data/doc/cxxapi/functions.html +2 -2
  25. data/doc/cxxapi/functions_func.html +2 -2
  26. data/doc/cxxapi/graph_legend.html +1 -1
  27. data/doc/cxxapi/group__Configuration.html +1 -1
  28. data/doc/cxxapi/group__Core.html +1 -1
  29. data/doc/cxxapi/group__Hooks.html +1 -1
  30. data/doc/cxxapi/group__Support.html +1 -1
  31. data/doc/cxxapi/main.html +1 -1
  32. data/doc/cxxapi/modules.html +1 -1
  33. data/doc/rdoc/classes/ConditionVariable.html +194 -0
  34. data/doc/rdoc/classes/Exception.html +120 -0
  35. data/doc/rdoc/classes/GC.html +113 -0
  36. data/doc/rdoc/classes/IO.html +169 -0
  37. data/doc/rdoc/classes/PhusionPassenger.html +238 -0
  38. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +153 -0
  39. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +517 -0
  40. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +719 -0
  41. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +97 -0
  42. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +96 -0
  43. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +97 -0
  44. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +96 -0
  45. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +598 -0
  46. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +140 -0
  47. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +317 -0
  48. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess/Instance.html +138 -0
  49. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +154 -0
  50. data/doc/rdoc/classes/PhusionPassenger/Application.html +283 -0
  51. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +172 -0
  52. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +145 -0
  53. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +175 -0
  54. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +141 -0
  55. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +92 -0
  56. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +489 -0
  57. data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +350 -0
  58. data/doc/rdoc/classes/PhusionPassenger/Rack.html +91 -0
  59. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +188 -0
  60. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +194 -0
  61. data/doc/rdoc/classes/PhusionPassenger/Railz.html +95 -0
  62. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +442 -0
  63. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner/Error.html +98 -0
  64. data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +200 -0
  65. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +436 -0
  66. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner/Error.html +98 -0
  67. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +155 -0
  68. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +402 -0
  69. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +125 -0
  70. data/doc/rdoc/classes/PhusionPassenger/Utils.html +805 -0
  71. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +140 -0
  72. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +89 -0
  73. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +188 -0
  74. data/doc/rdoc/classes/PlatformInfo.html +831 -0
  75. data/doc/rdoc/classes/RakeExtensions.html +197 -0
  76. data/doc/rdoc/classes/Signal.html +131 -0
  77. data/doc/rdoc/created.rid +1 -0
  78. data/doc/rdoc/files/DEVELOPERS_TXT.html +255 -0
  79. data/doc/rdoc/files/README.html +157 -0
  80. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +92 -0
  81. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +129 -0
  82. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +131 -0
  83. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +126 -0
  84. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +130 -0
  85. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +130 -0
  86. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +122 -0
  87. data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +127 -0
  88. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +126 -0
  89. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +122 -0
  90. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +134 -0
  91. data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +122 -0
  92. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +122 -0
  93. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +126 -0
  94. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +122 -0
  95. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +122 -0
  96. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +127 -0
  97. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +133 -0
  98. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +127 -0
  99. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +143 -0
  100. data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +126 -0
  101. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +145 -0
  102. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +127 -0
  103. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +122 -0
  104. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +161 -0
  105. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +175 -0
  106. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +129 -0
  107. data/doc/rdoc/files/misc/rake/extensions_rb.html +130 -0
  108. data/doc/rdoc/fr_class_index.html +90 -0
  109. data/doc/rdoc/fr_file_index.html +76 -0
  110. data/doc/rdoc/fr_method_index.html +200 -0
  111. data/doc/rdoc/index.html +26 -0
  112. data/doc/rdoc/rdoc-style.css +187 -0
  113. data/doc/users_guide_snippets/rackup_specifications.txt +2 -8
  114. data/ext/apache2/Bucket.cpp +71 -38
  115. data/ext/apache2/Bucket.h +53 -16
  116. data/ext/apache2/Configuration.cpp +15 -0
  117. data/ext/apache2/Configuration.h +19 -2
  118. data/ext/apache2/DirectoryMapper.h +10 -10
  119. data/ext/apache2/Hooks.cpp +334 -74
  120. data/ext/boost/mpl/apply.hpp +5 -1
  121. data/ext/boost/mpl/apply_wrap.hpp +5 -2
  122. data/ext/boost/mpl/aux_/full_lambda.hpp +5 -1
  123. data/ext/boost/mpl/bind.hpp +5 -1
  124. data/ext/common/Application.h +11 -31
  125. data/ext/common/ApplicationPool.h +2 -1
  126. data/ext/common/ApplicationPoolServer.h +61 -20
  127. data/ext/common/ApplicationPoolServerExecutable.cpp +132 -4
  128. data/ext/common/ApplicationPoolStatusReporter.h +189 -65
  129. data/ext/common/Base64.cpp +143 -0
  130. data/ext/common/Base64.h +57 -0
  131. data/ext/common/CachedFileStat.cpp +25 -82
  132. data/ext/common/CachedFileStat.h +11 -125
  133. data/ext/common/CachedFileStat.hpp +243 -0
  134. data/ext/common/Exceptions.h +13 -0
  135. data/ext/common/FileChangeChecker.h +209 -0
  136. data/ext/common/Logging.h +3 -2
  137. data/ext/common/MessageChannel.h +10 -10
  138. data/ext/common/PoolOptions.h +72 -5
  139. data/ext/common/SpawnManager.h +11 -8
  140. data/ext/common/StandardApplicationPool.h +38 -39
  141. data/ext/common/StaticString.h +1 -0
  142. data/ext/common/StringListCreator.h +83 -0
  143. data/ext/common/SystemTime.h +3 -2
  144. data/ext/common/Timer.h +88 -0
  145. data/ext/common/Utils.cpp +161 -42
  146. data/ext/common/Utils.h +62 -31
  147. data/ext/common/Version.h +1 -1
  148. data/ext/nginx/Configuration.c +0 -4
  149. data/ext/nginx/ContentHandler.c +8 -6
  150. data/ext/nginx/HelperServer.cpp +45 -55
  151. data/ext/nginx/HttpStatusExtractor.h +4 -0
  152. data/ext/nginx/StaticContentHandler.c +25 -5
  153. data/ext/nginx/config +3 -0
  154. data/ext/nginx/ngx_http_passenger_module.c +72 -17
  155. data/ext/nginx/ngx_http_passenger_module.h +2 -2
  156. data/lib/phusion_passenger/abstract_request_handler.rb +15 -7
  157. data/lib/phusion_passenger/abstract_server.rb +16 -2
  158. data/lib/phusion_passenger/admin_tools/control_process.rb +36 -25
  159. data/lib/phusion_passenger/constants.rb +1 -1
  160. data/lib/phusion_passenger/dependencies.rb +10 -0
  161. data/lib/phusion_passenger/platform_info.rb +1 -1
  162. data/lib/phusion_passenger/rack/application_spawner.rb +21 -2
  163. data/lib/phusion_passenger/rack/request_handler.rb +10 -0
  164. data/lib/phusion_passenger/railz/application_spawner.rb +38 -2
  165. data/lib/phusion_passenger/railz/framework_spawner.rb +26 -28
  166. data/lib/phusion_passenger/railz/request_handler.rb +5 -1
  167. data/lib/phusion_passenger/spawn_manager.rb +6 -2
  168. data/lib/phusion_passenger/utils.rb +79 -27
  169. data/misc/rake/cplusplus.rb +5 -5
  170. data/test/ApplicationPoolServerTest.cpp +42 -0
  171. data/test/ApplicationPoolTest.cpp +255 -267
  172. data/test/Base64Test.cpp +48 -0
  173. data/test/CachedFileStatTest.cpp +243 -103
  174. data/test/FileChangeCheckerTest.cpp +331 -0
  175. data/test/PoolOptionsTest.cpp +80 -0
  176. data/test/UtilsTest.cpp +5 -17
  177. data/test/integration_tests/apache2_tests.rb +15 -4
  178. data/test/integration_tests/mycook_spec.rb +3 -4
  179. data/test/oxt/syscall_interruption_test.cpp +2 -14
  180. data/test/ruby/abstract_server_collection_spec.rb +1 -1
  181. data/test/ruby/abstract_server_spec.rb +35 -1
  182. data/test/ruby/rack/application_spawner_spec.rb +23 -6
  183. data/test/ruby/rails/application_spawner_spec.rb +6 -6
  184. data/test/ruby/rails/framework_spawner_spec.rb +6 -5
  185. data/test/ruby/rails/minimal_spawner_spec.rb +19 -0
  186. data/test/ruby/rails/spawner_error_handling_spec.rb +62 -7
  187. data/test/ruby/spawn_manager_spec.rb +10 -7
  188. data/test/ruby/spawn_server_spec.rb +1 -1
  189. data/test/ruby/utils_spec.rb +193 -20
  190. data/test/ruby/wsgi/application_spawner_spec.rb +3 -1
  191. data/test/stub/apache2/httpd.conf.erb +3 -0
  192. data/test/stub/rack/config.ru +1 -1
  193. data/test/stub/rails_apps/mycook/app/controllers/welcome_controller.rb +8 -0
  194. data/test/support/Support.cpp +84 -0
  195. data/test/support/Support.h +66 -8
  196. data/test/support/config.rb +14 -2
  197. data/test/support/test_helper.rb +5 -0
  198. data/vendor/rack-1.0.0-git/lib/rack/auth/openid.rb +123 -116
  199. data/vendor/rack-1.0.0-git/lib/rack/cascade.rb +17 -12
  200. data/vendor/rack-1.0.0-git/lib/rack/commonlogger.rb +34 -43
  201. data/vendor/rack-1.0.0-git/lib/rack/handler/cgi.rb +1 -1
  202. data/vendor/rack-1.0.0-git/lib/rack/handler/fastcgi.rb +1 -1
  203. data/vendor/rack-1.0.0-git/lib/rack/handler/lsws.rb +1 -1
  204. data/vendor/rack-1.0.0-git/lib/rack/handler/mongrel.rb +1 -1
  205. data/vendor/rack-1.0.0-git/lib/rack/handler/scgi.rb +1 -1
  206. data/vendor/rack-1.0.0-git/lib/rack/handler/webrick.rb +1 -1
  207. data/vendor/rack-1.0.0-git/lib/rack/mock.rb +4 -17
  208. data/vendor/rack-1.0.0-git/lib/rack/request.rb +3 -9
  209. data/vendor/rack-1.0.0-git/lib/rack/rewindable_input.rb +2 -0
  210. data/vendor/rack-1.0.0-git/lib/rack/utils.rb +38 -12
  211. metadata +231 -186
  212. data/ext/common/FileChecker.h +0 -112
  213. data/test/FileCheckerTest.cpp +0 -79
  214. data/test/stub/minimal-railsapp/README +0 -3
  215. data/test/stub/minimal-railsapp/config/application.rb +0 -0
  216. data/test/stub/minimal-railsapp/config/environment.rb +0 -3
  217. data/test/stub/minimal-railsapp/vendor/rails/actionmailer/lib/action_mailer.rb +0 -0
  218. data/test/stub/minimal-railsapp/vendor/rails/actionpack/lib/action_controller.rb +0 -10
  219. data/test/stub/minimal-railsapp/vendor/rails/actionpack/lib/action_pack.rb +0 -0
  220. data/test/stub/minimal-railsapp/vendor/rails/actionpack/lib/action_view.rb +0 -0
  221. data/test/stub/minimal-railsapp/vendor/rails/activerecord/lib/active_record.rb +0 -7
  222. data/test/stub/minimal-railsapp/vendor/rails/activeresource/lib/active_resource.rb +0 -0
  223. data/test/stub/minimal-railsapp/vendor/rails/activesupport/lib/active_support.rb +0 -17
  224. data/test/stub/minimal-railsapp/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +0 -0
  225. data/test/stub/minimal-railsapp/vendor/rails/railties/lib/dispatcher.rb +0 -0
  226. data/test/stub/minimal-railsapp/vendor/rails/railties/lib/initializer.rb +0 -8
  227. data/test/stub/minimal-railsapp/vendor/rails/railties/lib/ruby_version_check.rb +0 -1
  228. data/test/stub/railsapp/app/controllers/application.rb +0 -12
  229. data/test/stub/railsapp/app/controllers/bar_controller.rb +0 -5
  230. data/test/stub/railsapp/app/controllers/bar_controller_1.txt +0 -5
  231. data/test/stub/railsapp/app/controllers/bar_controller_2.txt +0 -5
  232. data/test/stub/railsapp/app/controllers/foo_controller.rb +0 -9
  233. data/test/stub/railsapp/app/helpers/application_helper.rb +0 -3
  234. data/test/stub/railsapp/config/boot.rb +0 -108
  235. data/test/stub/railsapp/config/database.yml +0 -19
  236. data/test/stub/railsapp/config/environment.rb +0 -59
  237. data/test/stub/railsapp/config/environments/development.rb +0 -18
  238. data/test/stub/railsapp/config/environments/production.rb +0 -19
  239. data/test/stub/railsapp/config/initializers/inflections.rb +0 -10
  240. data/test/stub/railsapp/config/initializers/mime_types.rb +0 -5
  241. data/test/stub/railsapp/config/routes.rb +0 -35
  242. data/test/stub/railsapp/public/useless.txt +0 -1
  243. data/test/stub/railsapp2/app/controllers/application.rb +0 -12
  244. data/test/stub/railsapp2/app/controllers/foo_controller.rb +0 -5
  245. data/test/stub/railsapp2/app/helpers/application_helper.rb +0 -3
  246. data/test/stub/railsapp2/config/boot.rb +0 -108
  247. data/test/stub/railsapp2/config/database.yml +0 -19
  248. data/test/stub/railsapp2/config/environment.rb +0 -59
  249. data/test/stub/railsapp2/config/environments/development.rb +0 -18
  250. data/test/stub/railsapp2/config/environments/production.rb +0 -19
  251. data/test/stub/railsapp2/config/initializers/inflections.rb +0 -10
  252. data/test/stub/railsapp2/config/initializers/mime_types.rb +0 -5
  253. data/test/stub/railsapp2/config/routes.rb +0 -35
  254. data/test/stub/railsapp2/public/useless.txt +0 -1
@@ -0,0 +1,350 @@
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::NativeSupport</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::NativeSupport</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/ext/phusion_passenger/native_support_c.html">ext/phusion_passenger/native_support.c</a>
61
+ </td>
62
+ </tr>
63
+ </table>
64
+ </td>
65
+ </tr>
66
+ </table>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+ <div id="content">
71
+
72
+ <div class="description"><p>
73
+ Utility functions for accessing system functionality.
74
+ </p>
75
+ </div>
76
+
77
+
78
+
79
+ <div class="sectiontitle">Methods</div>
80
+ <ul>
81
+ <li><a href="#M000061">accept</a></li>
82
+ <li><a href="#M000062">close_all_file_descriptors</a></li>
83
+ <li><a href="#M000060">create_unix_socket</a></li>
84
+ <li><a href="#M000063">disable_stdio_buffering</a></li>
85
+ <li><a href="#M000059">recv_fd</a></li>
86
+ <li><a href="#M000058">send_fd</a></li>
87
+ </ul>
88
+
89
+
90
+
91
+
92
+ <div class="sectiontitle">Constants</div>
93
+ <table border='0' cellpadding='5'>
94
+ <tr valign='top'>
95
+ <td class="attr-name">UNIX_PATH_MAX</td>
96
+ <td>=</td>
97
+ <td class="attr-value">INT2NUM(sizeof(addr.sun_path))</td>
98
+ </tr>
99
+ <tr valign='top'>
100
+ <td>&nbsp;</td>
101
+ <td colspan="2" class="attr-desc">
102
+ The maximum length of a Unix socket path, including terminating null.
103
+
104
+ </td>
105
+ </tr>
106
+ </table>
107
+
108
+
109
+ <div class="sectiontitle">Public Class methods</div>
110
+ <div class="method">
111
+ <div class="title">
112
+ <a name="M000061"></a><b> accept(fileno)<br />
113
+ </b>
114
+ </div>
115
+ <div class="description">
116
+ <p>
117
+ Accept a new client from the given socket.
118
+ </p>
119
+ <ul>
120
+ <li><tt>fileno</tt> (integer): The file descriptor of the server socket.
121
+
122
+ </li>
123
+ <li>Returns: The accepted client&#8216;s file descriptor.
124
+
125
+ </li>
126
+ <li>Raises <tt>SystemCallError</tt> if something went wrong.
127
+
128
+ </li>
129
+ </ul>
130
+ </div>
131
+ <div class="sourcecode">
132
+ <p class="source-link">[ <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show source</a> ]</p>
133
+ <div id="M000061_source" class="dyn-source">
134
+ <pre>
135
+ /*
136
+ * call-seq: accept(fileno)
137
+ *
138
+ * Accept a new client from the given socket.
139
+ *
140
+ * - +fileno+ (integer): The file descriptor of the server socket.
141
+ * - Returns: The accepted client's file descriptor.
142
+ * - Raises +SystemCallError+ if something went wrong.
143
+ */
144
+ static VALUE
145
+ f_accept(VALUE self, VALUE fileno) {
146
+
147
+ </pre>
148
+ </div>
149
+ </div>
150
+ </div>
151
+ <div class="method">
152
+ <div class="title">
153
+ <a name="M000062"></a><b> close_all_file_descriptors(exceptions)<br />
154
+ </b>
155
+ </div>
156
+ <div class="description">
157
+ <p>
158
+ Close all file descriptors, except those given in the <tt>exceptions</tt>
159
+ array. For example, the following would close all file descriptors except
160
+ standard input (0) and standard output (1).
161
+ </p>
162
+ <pre>
163
+ close_all_file_descriptors([0, 1])
164
+ </pre>
165
+ </div>
166
+ <div class="sourcecode">
167
+ <p class="source-link">[ <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show source</a> ]</p>
168
+ <div id="M000062_source" class="dyn-source">
169
+ <pre>
170
+ /*
171
+ * call-seq: close_all_file_descriptors(exceptions)
172
+ *
173
+ * Close all file descriptors, except those given in the +exceptions+ array.
174
+ * For example, the following would close all file descriptors except standard
175
+ * input (0) and standard output (1).
176
+ *
177
+ * close_all_file_descriptors([0, 1])
178
+ */
179
+ static VALUE
180
+ close_all_file_descriptors(VALUE self, VALUE exceptions) {
181
+
182
+ </pre>
183
+ </div>
184
+ </div>
185
+ </div>
186
+ <div class="method">
187
+ <div class="title">
188
+ <a name="M000060"></a><b> create_unix_socket(filename, backlog)<br />
189
+ </b>
190
+ </div>
191
+ <div class="description">
192
+ <p>
193
+ Create a SOCK_STREAM server Unix socket. Unlike Ruby&#8216;s UNIXServer
194
+ class, this function is also able to create Unix sockets on the abstract
195
+ namespace by prepending the filename with a null byte.
196
+ </p>
197
+ <ul>
198
+ <li><tt>filename</tt> (string): The filename of the Unix socket to create.
199
+
200
+ </li>
201
+ <li><tt>backlog</tt> (integer): The backlog to use for listening on the socket.
202
+
203
+ </li>
204
+ <li>Returns: The file descriptor of the created Unix socket, as an integer.
205
+
206
+ </li>
207
+ <li>Raises <tt>SystemCallError</tt> if something went wrong.
208
+
209
+ </li>
210
+ </ul>
211
+ </div>
212
+ <div class="sourcecode">
213
+ <p class="source-link">[ <a href="javascript:toggleSource('M000060_source')" id="l_M000060_source">show source</a> ]</p>
214
+ <div id="M000060_source" class="dyn-source">
215
+ <pre>
216
+ /*
217
+ * call-seq: create_unix_socket(filename, backlog)
218
+ *
219
+ * Create a SOCK_STREAM server Unix socket. Unlike Ruby's UNIXServer class,
220
+ * this function is also able to create Unix sockets on the abstract namespace
221
+ * by prepending the filename with a null byte.
222
+ *
223
+ * - +filename+ (string): The filename of the Unix socket to create.
224
+ * - +backlog+ (integer): The backlog to use for listening on the socket.
225
+ * - Returns: The file descriptor of the created Unix socket, as an integer.
226
+ * - Raises +SystemCallError+ if something went wrong.
227
+ */
228
+ static VALUE
229
+ create_unix_socket(VALUE self, VALUE filename, VALUE backlog) {
230
+
231
+ </pre>
232
+ </div>
233
+ </div>
234
+ </div>
235
+ <div class="method">
236
+ <div class="title">
237
+ <a name="M000063"></a><b> disable_stdio_buffering<br />
238
+ </b>
239
+ </div>
240
+ <div class="description">
241
+ <p>
242
+ Disables any kind of buffering on the C <tt>stdout</tt> and <tt>stderr</tt>
243
+ variables, so that +fprintf()+ on <tt>stdout</tt> and <tt>stderr</tt> have
244
+ immediate effect.
245
+ </p>
246
+ </div>
247
+ <div class="sourcecode">
248
+ <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p>
249
+ <div id="M000063_source" class="dyn-source">
250
+ <pre>
251
+ /*
252
+ * call-seq: disable_stdio_buffering
253
+ *
254
+ * Disables any kind of buffering on the C +stdout+ and +stderr+ variables,
255
+ * so that +fprintf()+ on +stdout+ and +stderr+ have immediate effect.
256
+ */
257
+ static VALUE
258
+ disable_stdio_buffering() {
259
+
260
+ </pre>
261
+ </div>
262
+ </div>
263
+ </div>
264
+ <div class="method">
265
+ <div class="title">
266
+ <a name="M000059"></a><b> recv_fd(socket_fd)<br />
267
+ </b>
268
+ </div>
269
+ <div class="description">
270
+ <p>
271
+ Receive a file descriptor from the given Unix socket. Returns the received
272
+ file descriptor as an integer. Raises <tt>SystemCallError</tt> if something
273
+ went wrong.
274
+ </p>
275
+ <p>
276
+ You do not have call this method directly. A convenience wrapper is
277
+ provided by <a href="../IO.html#M000006">IO#recv_io</a>.
278
+ </p>
279
+ </div>
280
+ <div class="sourcecode">
281
+ <p class="source-link">[ <a href="javascript:toggleSource('M000059_source')" id="l_M000059_source">show source</a> ]</p>
282
+ <div id="M000059_source" class="dyn-source">
283
+ <pre>
284
+ /*
285
+ * call-seq: recv_fd(socket_fd)
286
+ *
287
+ * Receive a file descriptor from the given Unix socket. Returns the received
288
+ * file descriptor as an integer. Raises +SystemCallError+ if something went
289
+ * wrong.
290
+ *
291
+ * You do not have call this method directly. A convenience wrapper is
292
+ * provided by IO#recv_io.
293
+ */
294
+ static VALUE
295
+ recv_fd(VALUE self, VALUE socket_fd) {
296
+
297
+ </pre>
298
+ </div>
299
+ </div>
300
+ </div>
301
+ <div class="method">
302
+ <div class="title">
303
+ <a name="M000058"></a><b> send_fd(socket_fd, fd_to_send)<br />
304
+ </b>
305
+ </div>
306
+ <div class="description">
307
+ <p>
308
+ Send a file descriptor over the given Unix socket. You do not have to call
309
+ this function directly. A convenience wrapper is provided by <a
310
+ href="../IO.html#M000005">IO#send_io</a>.
311
+ </p>
312
+ <ul>
313
+ <li><tt>socket_fd</tt> (integer): The file descriptor of the socket.
314
+
315
+ </li>
316
+ <li><tt>fd_to_send</tt> (integer): The file descriptor to send.
317
+
318
+ </li>
319
+ <li>Raises <tt>SystemCallError</tt> if something went wrong.
320
+
321
+ </li>
322
+ </ul>
323
+ </div>
324
+ <div class="sourcecode">
325
+ <p class="source-link">[ <a href="javascript:toggleSource('M000058_source')" id="l_M000058_source">show source</a> ]</p>
326
+ <div id="M000058_source" class="dyn-source">
327
+ <pre>
328
+ /*
329
+ * call-seq: send_fd(socket_fd, fd_to_send)
330
+ *
331
+ * Send a file descriptor over the given Unix socket. You do not have to call
332
+ * this function directly. A convenience wrapper is provided by IO#send_io.
333
+ *
334
+ * - +socket_fd+ (integer): The file descriptor of the socket.
335
+ * - +fd_to_send+ (integer): The file descriptor to send.
336
+ * - Raises +SystemCallError+ if something went wrong.
337
+ */
338
+ static VALUE
339
+ send_fd(VALUE self, VALUE socket_fd, VALUE fd_to_send) {
340
+
341
+ </pre>
342
+ </div>
343
+ </div>
344
+ </div>
345
+ </div>
346
+
347
+ </div>
348
+
349
+ </body>
350
+ </html>
@@ -0,0 +1,91 @@
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::Rack</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::Rack</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/rack/application_spawner_rb.html">lib/phusion_passenger/rack/application_spawner.rb</a>
61
+ <a href="../../files/lib/phusion_passenger/rack/request_handler_rb.html">lib/phusion_passenger/rack/request_handler.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
+
74
+
75
+
76
+
77
+
78
+
79
+ <div class="sectiontitle">Classes and Modules</div>
80
+ Class <a href="Rack/ApplicationSpawner.html" class="link">PhusionPassenger::Rack::ApplicationSpawner</a><br />
81
+ Class <a href="Rack/RequestHandler.html" class="link">PhusionPassenger::Rack::RequestHandler</a><br />
82
+
83
+
84
+
85
+
86
+ </div>
87
+
88
+ </div>
89
+
90
+ </body>
91
+ </html>
@@ -0,0 +1,188 @@
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::Rack::ApplicationSpawner</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::Rack::ApplicationSpawner</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/rack/application_spawner_rb.html">lib/phusion_passenger/rack/application_spawner.rb</a>
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td>Parent:</td>
65
+ <td>
66
+ Object
67
+ </td>
68
+ </tr>
69
+ </table>
70
+ </td>
71
+ </tr>
72
+ </table>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+ <div id="content">
77
+
78
+ <div class="description"><p>
79
+ Class for spawning <a href="../Rack.html">Rack</a> applications.
80
+ </p>
81
+ </div>
82
+
83
+
84
+
85
+ <div class="sectiontitle">Methods</div>
86
+ <ul>
87
+ <li><a href="#M000054">spawn_application</a></li>
88
+ <li><a href="#M000055">spawn_application</a></li>
89
+ </ul>
90
+
91
+ <div class="sectiontitle">Included Modules</div>
92
+ <ul>
93
+ <li><a href="../Utils.html">Utils</a></li>
94
+ </ul>
95
+
96
+
97
+
98
+
99
+
100
+ <div class="sectiontitle">Public Class methods</div>
101
+ <div class="method">
102
+ <div class="title">
103
+ <a name="M000054"></a><b>spawn_application</b>(*args)
104
+ </div>
105
+ <div class="sourcecode">
106
+ <p class="source-link">[ <a href="javascript:toggleSource('M000054_source')" id="l_M000054_source">show source</a> ]</p>
107
+ <div id="M000054_source" class="dyn-source">
108
+ <pre>
109
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 43</span>
110
+ 43: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">spawn_application</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
111
+ 44: <span class="ruby-ivar">@@instance</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">ApplicationSpawner</span>.<span class="ruby-identifier">new</span>
112
+ 45: <span class="ruby-ivar">@@instance</span>.<span class="ruby-identifier">spawn_application</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
113
+ 46: <span class="ruby-keyword kw">end</span>
114
+ </pre>
115
+ </div>
116
+ </div>
117
+ </div>
118
+ <div class="sectiontitle">Public Instance methods</div>
119
+ <div class="method">
120
+ <div class="title">
121
+ <a name="M000055"></a><b>spawn_application</b>(app_root, options = {})
122
+ </div>
123
+ <div class="description">
124
+ <p>
125
+ Spawn an instance of the given <a href="../Rack.html">Rack</a> application.
126
+ When successful, an <a href="../Application.html">Application</a> object
127
+ will be returned, which represents the spawned application.
128
+ </p>
129
+ <p>
130
+ Accepts the same options as Railz::ApplicationSpawner#initialize.
131
+ </p>
132
+ <p>
133
+ Raises:
134
+ </p>
135
+ <ul>
136
+ <li><a href="../AppInitError.html">AppInitError</a>: The <a
137
+ href="../Rack.html">Rack</a> application raised an exception or called
138
+ exit() during startup.
139
+
140
+ </li>
141
+ <li>SystemCallError, IOError, SocketError: Something went wrong.
142
+
143
+ </li>
144
+ </ul>
145
+ </div>
146
+ <div class="sourcecode">
147
+ <p class="source-link">[ <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show source</a> ]</p>
148
+ <div id="M000055_source" class="dyn-source">
149
+ <pre>
150
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 58</span>
151
+ 58: <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> = {})
152
+ 59: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
153
+ 60:
154
+ 61: <span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span> = <span class="ruby-constant">UNIXSocket</span>.<span class="ruby-identifier">pair</span>
155
+ 62: <span class="ruby-identifier">pid</span> = <span class="ruby-identifier">safe_fork</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-keyword kw">true</span>) <span class="ruby-keyword kw">do</span>
156
+ 63: <span class="ruby-identifier">a</span>.<span class="ruby-identifier">close</span>
157
+ 64:
158
+ 65: <span class="ruby-identifier">file_descriptors_to_leave_open</span> = [<span class="ruby-value">0</span>, <span class="ruby-value">1</span>, <span class="ruby-value">2</span>, <span class="ruby-identifier">b</span>.<span class="ruby-identifier">fileno</span>]
159
+ 66: <span class="ruby-constant">NativeSupport</span>.<span class="ruby-identifier">close_all_file_descriptors</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
160
+ 67: <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
161
+ 68:
162
+ 69: <span class="ruby-identifier">run</span>(<span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">b</span>), <span class="ruby-identifier">app_root</span>, <span class="ruby-identifier">options</span>)
163
+ 70: <span class="ruby-keyword kw">end</span>
164
+ 71: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">close</span>
165
+ 72: <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>
166
+ 73:
167
+ 74: <span class="ruby-identifier">channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">a</span>)
168
+ 75: <span class="ruby-identifier">unmarshal_and_raise_errors</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;print_exceptions&quot;</span>], <span class="ruby-value str">&quot;rack&quot;</span>)
169
+ 76:
170
+ 77: <span class="ruby-comment cmt"># No exception was raised, so spawning succeeded.</span>
171
+ 78: <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">socket_name</span>, <span class="ruby-identifier">socket_type</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read</span>
172
+ 79: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>.<span class="ruby-identifier">nil?</span>
173
+ 80: <span class="ruby-identifier">raise</span> <span class="ruby-constant">IOError</span>, <span class="ruby-value str">&quot;Connection closed&quot;</span>
174
+ 81: <span class="ruby-keyword kw">end</span>
175
+ 82: <span class="ruby-identifier">owner_pipe</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">recv_io</span>
176
+ 83: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Application</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@app_root</span>, <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">socket_name</span>,
177
+ 84: <span class="ruby-identifier">socket_type</span>, <span class="ruby-identifier">owner_pipe</span>)
178
+ 85: <span class="ruby-keyword kw">end</span>
179
+ </pre>
180
+ </div>
181
+ </div>
182
+ </div>
183
+ </div>
184
+
185
+ </div>
186
+
187
+ </body>
188
+ </html>