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,141 @@
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::InitializationError</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::InitializationError</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
+ <div class="description"><p>
79
+ An abstract base class for <a href="AppInitError.html">AppInitError</a> and
80
+ <a href="FrameworkInitError.html">FrameworkInitError</a>. This represents
81
+ the failure when initializing something.
82
+ </p>
83
+ </div>
84
+
85
+
86
+
87
+ <div class="sectiontitle">Methods</div>
88
+ <ul>
89
+ <li><a href="#M000096">new</a></li>
90
+ </ul>
91
+
92
+
93
+
94
+
95
+
96
+ <div class="sectiontitle">Attributes</div>
97
+ <table border='0' cellpadding='5'>
98
+ <tr valign='top'>
99
+ <td class='attr-rw'>
100
+ [RW]
101
+ </td>
102
+ <td class='attr-name'>child_exception</td>
103
+ <td class='attr-desc'>
104
+ The exception that caused initialization to fail. This may be nil.
105
+
106
+ </td>
107
+ </tr>
108
+ </table>
109
+
110
+ <div class="sectiontitle">Public Class methods</div>
111
+ <div class="method">
112
+ <div class="title">
113
+ <a name="M000096"></a><b>new</b>(message, child_exception = nil)
114
+ </div>
115
+ <div class="description">
116
+ <p>
117
+ Create a <a href="InitializationError.html#M000096">new</a> <a
118
+ href="InitializationError.html">InitializationError</a>. <tt>message</tt>
119
+ is the error message, and <tt>child_exception</tt> is the exception that
120
+ caused initialization to fail.
121
+ </p>
122
+ </div>
123
+ <div class="sourcecode">
124
+ <p class="source-link">[ <a href="javascript:toggleSource('M000096_source')" id="l_M000096_source">show source</a> ]</p>
125
+ <div id="M000096_source" class="dyn-source">
126
+ <pre>
127
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/exceptions.rb, line 48</span>
128
+ 48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">child_exception</span> = <span class="ruby-keyword kw">nil</span>)
129
+ 49: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">message</span>)
130
+ 50: <span class="ruby-ivar">@child_exception</span> = <span class="ruby-identifier">child_exception</span>
131
+ 51: <span class="ruby-keyword kw">end</span>
132
+ </pre>
133
+ </div>
134
+ </div>
135
+ </div>
136
+ </div>
137
+
138
+ </div>
139
+
140
+ </body>
141
+ </html>
@@ -0,0 +1,92 @@
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::InvalidPath</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::InvalidPath</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
+
82
+
83
+
84
+
85
+
86
+
87
+ </div>
88
+
89
+ </div>
90
+
91
+ </body>
92
+ </html>
@@ -0,0 +1,489 @@
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::MessageChannel</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::MessageChannel</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/message_channel_rb.html">lib/phusion_passenger/message_channel.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
+ This class provides convenience methods for:
80
+ </p>
81
+ <ul>
82
+ <li>sending and receiving raw data over an <a href="../IO.html">IO</a> channel.
83
+
84
+ </li>
85
+ <li>sending and receiving messages over an <a href="../IO.html">IO</a> channel.
86
+
87
+ </li>
88
+ <li>file descriptor (<a href="../IO.html">IO</a> object) passing over a Unix
89
+ socket.
90
+
91
+ </li>
92
+ </ul>
93
+ <p>
94
+ All of these methods use exceptions for error reporting.
95
+ </p>
96
+ <p>
97
+ There are two kinds of messages:
98
+ </p>
99
+ <dl>
100
+ <dt> Array messages </dt><dd>These are just a list of strings, and the message itself has a specific
101
+ length. The contained strings may not contain NUL characters
102
+ (<tt>&#8217;\0&#8216;</tt>). Note that an array message must have at least
103
+ one element.
104
+
105
+ </dd>
106
+ <dt> Scalar messages </dt><dd>These are byte strings which may contain arbitrary binary data. Scalar
107
+ messages also have a specific length.
108
+
109
+ </dd>
110
+ </dl>
111
+ <p>
112
+ The protocol is designed to be low overhead, easy to implement and easy to
113
+ parse.
114
+ </p>
115
+ <p>
116
+ <a href="MessageChannel.html">MessageChannel</a> is to be wrapped around an
117
+ <a href="../IO.html">IO</a> object. For example:
118
+ </p>
119
+ <pre>
120
+ a, b = IO.pipe
121
+ channel1 = MessageChannel.new(a)
122
+ channel2 = MessageChannel.new(b)
123
+
124
+ # Send an array message.
125
+ channel2.write(&quot;hello&quot;, &quot;world !!&quot;)
126
+ channel1.read # =&gt; [&quot;hello&quot;, &quot;world !!&quot;]
127
+
128
+ # Send a scalar message.
129
+ channel2.write_scalar(&quot;some long string which can contain arbitrary binary data&quot;)
130
+ channel1.read_scalar
131
+ </pre>
132
+ <p>
133
+ The life time of a <a href="MessageChannel.html">MessageChannel</a> is
134
+ independent from that of the wrapped <a href="../IO.html">IO</a> object. If
135
+ a <a href="MessageChannel.html">MessageChannel</a> object is destroyed, the
136
+ underlying <a href="../IO.html">IO</a> object is not automatically closed.
137
+ Call <a href="MessageChannel.html#M000152">close</a>() if you want to <a
138
+ href="MessageChannel.html#M000152">close</a> the underlying <a
139
+ href="../IO.html">IO</a> object.
140
+ </p>
141
+ <p>
142
+ Note: Be careful with mixing the sending/receiving of array messages,
143
+ scalar messages and <a href="../IO.html">IO</a> objects. If you send a
144
+ collection of any of these in a specific order, then the receiving side
145
+ must receive them in the exact some order. So suppose you first send a
146
+ message, then an <a href="../IO.html">IO</a> object, then a scalar, then
147
+ the receiving side must first receive a message, then an <a
148
+ href="../IO.html">IO</a> object, then a scalar. If the receiving side does
149
+ things in the wrong order then bad things will happen.
150
+ </p>
151
+ </div>
152
+
153
+
154
+
155
+ <div class="sectiontitle">Methods</div>
156
+ <ul>
157
+ <li><a href="#M000152">close</a></li>
158
+ <li><a href="#M000151">fileno</a></li>
159
+ <li><a href="#M000144">new</a></li>
160
+ <li><a href="#M000145">read</a></li>
161
+ <li><a href="#M000146">read_scalar</a></li>
162
+ <li><a href="#M000149">recv_io</a></li>
163
+ <li><a href="#M000150">send_io</a></li>
164
+ <li><a href="#M000147">write</a></li>
165
+ <li><a href="#M000148">write_scalar</a></li>
166
+ </ul>
167
+
168
+
169
+
170
+
171
+
172
+ <div class="sectiontitle">Attributes</div>
173
+ <table border='0' cellpadding='5'>
174
+ <tr valign='top'>
175
+ <td class='attr-rw'>
176
+ [R]
177
+ </td>
178
+ <td class='attr-name'>io</td>
179
+ <td class='attr-desc'>
180
+ The wrapped <a href="../IO.html">IO</a> object.
181
+
182
+ </td>
183
+ </tr>
184
+ </table>
185
+
186
+ <div class="sectiontitle">Public Class methods</div>
187
+ <div class="method">
188
+ <div class="title">
189
+ <a name="M000144"></a><b>new</b>(io)
190
+ </div>
191
+ <div class="description">
192
+ <p>
193
+ Create a <a href="MessageChannel.html#M000144">new</a> <a
194
+ href="MessageChannel.html">MessageChannel</a> by wrapping the given <a
195
+ href="../IO.html">IO</a> object.
196
+ </p>
197
+ </div>
198
+ <div class="sourcecode">
199
+ <p class="source-link">[ <a href="javascript:toggleSource('M000144_source')" id="l_M000144_source">show source</a> ]</p>
200
+ <div id="M000144_source" class="dyn-source">
201
+ <pre>
202
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 82</span>
203
+ 82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">io</span>)
204
+ 83: <span class="ruby-ivar">@io</span> = <span class="ruby-identifier">io</span>
205
+ 84: <span class="ruby-keyword kw">end</span>
206
+ </pre>
207
+ </div>
208
+ </div>
209
+ </div>
210
+ <div class="sectiontitle">Public Instance methods</div>
211
+ <div class="method">
212
+ <div class="title">
213
+ <a name="M000152"></a><b>close</b>()
214
+ </div>
215
+ <div class="description">
216
+ <p>
217
+ Close the underlying <a href="../IO.html">IO</a> stream. Might raise
218
+ SystemCallError or IOError when something goes wrong.
219
+ </p>
220
+ </div>
221
+ <div class="sourcecode">
222
+ <p class="source-link">[ <a href="javascript:toggleSource('M000152_source')" id="l_M000152_source">show source</a> ]</p>
223
+ <div id="M000152_source" class="dyn-source">
224
+ <pre>
225
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 216</span>
226
+ 216: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
227
+ 217: <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">close</span>
228
+ 218: <span class="ruby-keyword kw">end</span>
229
+ </pre>
230
+ </div>
231
+ </div>
232
+ </div>
233
+ <div class="method">
234
+ <div class="title">
235
+ <a name="M000151"></a><b>fileno</b>()
236
+ </div>
237
+ <div class="description">
238
+ <p>
239
+ Return the file descriptor of the underlying <a href="../IO.html">IO</a>
240
+ object.
241
+ </p>
242
+ </div>
243
+ <div class="sourcecode">
244
+ <p class="source-link">[ <a href="javascript:toggleSource('M000151_source')" id="l_M000151_source">show source</a> ]</p>
245
+ <div id="M000151_source" class="dyn-source">
246
+ <pre>
247
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 210</span>
248
+ 210: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fileno</span>
249
+ 211: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">fileno</span>
250
+ 212: <span class="ruby-keyword kw">end</span>
251
+ </pre>
252
+ </div>
253
+ </div>
254
+ </div>
255
+ <div class="method">
256
+ <div class="title">
257
+ <a name="M000145"></a><b>read</b>()
258
+ </div>
259
+ <div class="description">
260
+ <p>
261
+ Read an array message from the underlying file descriptor. Returns the
262
+ array message as an array, or nil when end-of-stream has been reached.
263
+ </p>
264
+ <p>
265
+ Might raise SystemCallError, IOError or SocketError when something goes
266
+ wrong.
267
+ </p>
268
+ </div>
269
+ <div class="sourcecode">
270
+ <p class="source-link">[ <a href="javascript:toggleSource('M000145_source')" id="l_M000145_source">show source</a> ]</p>
271
+ <div id="M000145_source" class="dyn-source">
272
+ <pre>
273
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 92</span>
274
+ 92: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span>
275
+ 93: <span class="ruby-identifier">buffer</span> = <span class="ruby-value str">''</span>
276
+ 94: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">HEADER_SIZE</span>
277
+ 95: <span class="ruby-identifier">buffer</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-constant">HEADER_SIZE</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span>)
278
+ 96: <span class="ruby-keyword kw">end</span>
279
+ 97:
280
+ 98: <span class="ruby-identifier">chunk_size</span> = <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'n'</span>)[<span class="ruby-value">0</span>]
281
+ 99: <span class="ruby-identifier">buffer</span> = <span class="ruby-value str">''</span>
282
+ 100: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">chunk_size</span>
283
+ 101: <span class="ruby-identifier">buffer</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-identifier">chunk_size</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span>)
284
+ 102: <span class="ruby-keyword kw">end</span>
285
+ 103:
286
+ 104: <span class="ruby-identifier">message</span> = []
287
+ 105: <span class="ruby-identifier">offset</span> = <span class="ruby-value">0</span>
288
+ 106: <span class="ruby-identifier">delimiter_pos</span> = <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">index</span>(<span class="ruby-constant">DELIMITER</span>, <span class="ruby-identifier">offset</span>)
289
+ 107: <span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span><span class="ruby-identifier">delimiter_pos</span>.<span class="ruby-identifier">nil?</span>
290
+ 108: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">delimiter_pos</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
291
+ 109: <span class="ruby-identifier">message</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&quot;</span>
292
+ 110: <span class="ruby-keyword kw">else</span>
293
+ 111: <span class="ruby-identifier">message</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">buffer</span>[<span class="ruby-identifier">offset</span> <span class="ruby-operator">..</span> <span class="ruby-identifier">delimiter_pos</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>]
294
+ 112: <span class="ruby-keyword kw">end</span>
295
+ 113: <span class="ruby-identifier">offset</span> = <span class="ruby-identifier">delimiter_pos</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
296
+ 114: <span class="ruby-identifier">delimiter_pos</span> = <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">index</span>(<span class="ruby-constant">DELIMITER</span>, <span class="ruby-identifier">offset</span>)
297
+ 115: <span class="ruby-keyword kw">end</span>
298
+ 116: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">message</span>
299
+ 117: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNRESET</span>
300
+ 118: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
301
+ 119: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>
302
+ 120: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
303
+ 121: <span class="ruby-keyword kw">end</span>
304
+ </pre>
305
+ </div>
306
+ </div>
307
+ </div>
308
+ <div class="method">
309
+ <div class="title">
310
+ <a name="M000146"></a><b>read_scalar</b>(max_size = nil)
311
+ </div>
312
+ <div class="description">
313
+ <p>
314
+ Read a scalar message from the underlying <a href="../IO.html">IO</a>
315
+ object. Returns the <a href="MessageChannel.html#M000145">read</a> message,
316
+ or nil on end-of-stream.
317
+ </p>
318
+ <p>
319
+ Might raise SystemCallError, IOError or SocketError when something goes
320
+ wrong.
321
+ </p>
322
+ <p>
323
+ The <tt>max_size</tt> argument allows one to specify the maximum allowed
324
+ size for the scalar message. If the received scalar message&#8216;s size is
325
+ larger than <tt>max_size</tt>, then a SecurityError will be raised.
326
+ </p>
327
+ </div>
328
+ <div class="sourcecode">
329
+ <p class="source-link">[ <a href="javascript:toggleSource('M000146_source')" id="l_M000146_source">show source</a> ]</p>
330
+ <div id="M000146_source" class="dyn-source">
331
+ <pre>
332
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 132</span>
333
+ 132: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_scalar</span>(<span class="ruby-identifier">max_size</span> = <span class="ruby-keyword kw">nil</span>)
334
+ 133: <span class="ruby-identifier">buffer</span> = <span class="ruby-value str">''</span>
335
+ 134: <span class="ruby-identifier">temp</span> = <span class="ruby-value str">''</span>
336
+ 135: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">4</span>
337
+ 136: <span class="ruby-identifier">buffer</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-value">4</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">temp</span>)
338
+ 137: <span class="ruby-keyword kw">end</span>
339
+ 138: <span class="ruby-identifier">size</span> = <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'N'</span>)[<span class="ruby-value">0</span>]
340
+ 139: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
341
+ 140: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">''</span>
342
+ 141: <span class="ruby-keyword kw">else</span>
343
+ 142: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">max_size</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">max_size</span>
344
+ 143: <span class="ruby-identifier">raise</span> <span class="ruby-constant">SecurityError</span>, <span class="ruby-node">&quot;Scalar message size (#{size}) &quot;</span> <span class="ruby-operator">&lt;&lt;</span>
345
+ 144: <span class="ruby-node">&quot;exceeds maximum allowed size (#{max_size}).&quot;</span>
346
+ 145: <span class="ruby-keyword kw">end</span>
347
+ 146: <span class="ruby-identifier">buffer</span> = <span class="ruby-value str">''</span>
348
+ 147: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">size</span>
349
+ 148: <span class="ruby-identifier">temp</span> = <span class="ruby-value str">''</span> <span class="ruby-comment cmt"># JRuby doesn't clear the buffer. TODO: remove this when JRuby has been fixed.</span>
350
+ 149: <span class="ruby-identifier">buffer</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">temp</span>)
351
+ 150: <span class="ruby-keyword kw">end</span>
352
+ 151: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">buffer</span>
353
+ 152: <span class="ruby-keyword kw">end</span>
354
+ 153: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNRESET</span>
355
+ 154: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
356
+ 155: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>
357
+ 156: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
358
+ 157: <span class="ruby-keyword kw">end</span>
359
+ </pre>
360
+ </div>
361
+ </div>
362
+ </div>
363
+ <div class="method">
364
+ <div class="title">
365
+ <a name="M000149"></a><b>recv_io</b>()
366
+ </div>
367
+ <div class="description">
368
+ <p>
369
+ Receive an <a href="../IO.html">IO</a> object (a file descriptor) from the
370
+ channel. The other side must have sent an <a href="../IO.html">IO</a>
371
+ object by calling <a href="MessageChannel.html#M000150">send_io</a>(). Note
372
+ that this only works on Unix sockets.
373
+ </p>
374
+ <p>
375
+ Might raise SystemCallError, IOError or SocketError when something goes
376
+ wrong.
377
+ </p>
378
+ </div>
379
+ <div class="sourcecode">
380
+ <p class="source-link">[ <a href="javascript:toggleSource('M000149_source')" id="l_M000149_source">show source</a> ]</p>
381
+ <div id="M000149_source" class="dyn-source">
382
+ <pre>
383
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 195</span>
384
+ 195: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">recv_io</span>
385
+ 196: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">recv_io</span>
386
+ 197: <span class="ruby-keyword kw">end</span>
387
+ </pre>
388
+ </div>
389
+ </div>
390
+ </div>
391
+ <div class="method">
392
+ <div class="title">
393
+ <a name="M000150"></a><b>send_io</b>(io)
394
+ </div>
395
+ <div class="description">
396
+ <p>
397
+ Send an <a href="../IO.html">IO</a> object (a file descriptor) over the
398
+ channel. The other side must receive the <a href="../IO.html">IO</a> object
399
+ by calling <a href="MessageChannel.html#M000149">recv_io</a>(). Note that
400
+ this only works on Unix sockets.
401
+ </p>
402
+ <p>
403
+ Might raise SystemCallError, IOError or SocketError when something goes
404
+ wrong.
405
+ </p>
406
+ </div>
407
+ <div class="sourcecode">
408
+ <p class="source-link">[ <a href="javascript:toggleSource('M000150_source')" id="l_M000150_source">show source</a> ]</p>
409
+ <div id="M000150_source" class="dyn-source">
410
+ <pre>
411
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 205</span>
412
+ 205: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_io</span>(<span class="ruby-identifier">io</span>)
413
+ 206: <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">send_io</span>(<span class="ruby-identifier">io</span>)
414
+ 207: <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="M000147"></a><b>write</b>(name, *args)
422
+ </div>
423
+ <div class="description">
424
+ <p>
425
+ Send an array message, which consists of the given elements, over the
426
+ underlying file descriptor. <em>name</em> is the first element in the
427
+ message, and <em>args</em> are the other elements. These arguments will
428
+ internally be converted to strings by calling to_s().
429
+ </p>
430
+ <p>
431
+ Might raise SystemCallError, IOError or SocketError when something goes
432
+ wrong.
433
+ </p>
434
+ </div>
435
+ <div class="sourcecode">
436
+ <p class="source-link">[ <a href="javascript:toggleSource('M000147_source')" id="l_M000147_source">show source</a> ]</p>
437
+ <div id="M000147_source" class="dyn-source">
438
+ <pre>
439
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 166</span>
440
+ 166: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
441
+ 167: <span class="ruby-identifier">check_argument</span>(<span class="ruby-identifier">name</span>)
442
+ 168: <span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
443
+ 169: <span class="ruby-identifier">check_argument</span>(<span class="ruby-identifier">arg</span>)
444
+ 170: <span class="ruby-keyword kw">end</span>
445
+ 171:
446
+ 172: <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;#{name}#{DELIMITER}&quot;</span>
447
+ 173: <span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
448
+ 174: <span class="ruby-identifier">message</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">DELIMITER</span>
449
+ 175: <span class="ruby-keyword kw">end</span>
450
+ 176: <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">write</span>([<span class="ruby-identifier">message</span>.<span class="ruby-identifier">size</span>].<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'n'</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">message</span>)
451
+ 177: <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">flush</span>
452
+ 178: <span class="ruby-keyword kw">end</span>
453
+ </pre>
454
+ </div>
455
+ </div>
456
+ </div>
457
+ <div class="method">
458
+ <div class="title">
459
+ <a name="M000148"></a><b>write_scalar</b>(data)
460
+ </div>
461
+ <div class="description">
462
+ <p>
463
+ Send a scalar message over the underlying <a href="../IO.html">IO</a>
464
+ object.
465
+ </p>
466
+ <p>
467
+ Might raise SystemCallError, IOError or SocketError when something goes
468
+ wrong.
469
+ </p>
470
+ </div>
471
+ <div class="sourcecode">
472
+ <p class="source-link">[ <a href="javascript:toggleSource('M000148_source')" id="l_M000148_source">show source</a> ]</p>
473
+ <div id="M000148_source" class="dyn-source">
474
+ <pre>
475
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 184</span>
476
+ 184: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">data</span>)
477
+ 185: <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">write</span>([<span class="ruby-identifier">data</span>.<span class="ruby-identifier">size</span>].<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'N'</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">data</span>)
478
+ 186: <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">flush</span>
479
+ 187: <span class="ruby-keyword kw">end</span>
480
+ </pre>
481
+ </div>
482
+ </div>
483
+ </div>
484
+ </div>
485
+
486
+ </div>
487
+
488
+ </body>
489
+ </html>