passenger 2.2.4 → 2.2.5
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.
- data/NEWS +137 -0
- data/Rakefile +101 -19
- data/bin/passenger-install-nginx-module +10 -3
- data/bin/passenger-make-enterprisey +1 -1
- data/doc/Users guide Apache.html +227 -92
- data/doc/Users guide Apache.txt +169 -75
- data/doc/Users guide Nginx.html +1 -1
- data/doc/cxxapi/Bucket_8h-source.html +1 -1
- data/doc/cxxapi/Configuration_8h-source.html +373 -338
- data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
- data/doc/cxxapi/Hooks_8h-source.html +1 -1
- data/doc/cxxapi/annotated.html +1 -1
- data/doc/cxxapi/classHooks-members.html +1 -1
- data/doc/cxxapi/classHooks.html +2 -2
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
- data/doc/cxxapi/classes.html +1 -1
- data/doc/cxxapi/definitions_8h-source.html +1 -1
- data/doc/cxxapi/files.html +1 -1
- data/doc/cxxapi/functions.html +1 -1
- data/doc/cxxapi/functions_func.html +1 -1
- data/doc/cxxapi/graph_legend.html +1 -1
- data/doc/cxxapi/group__Configuration.html +1 -1
- data/doc/cxxapi/group__Core.html +1 -1
- data/doc/cxxapi/group__Hooks.html +1 -1
- data/doc/cxxapi/group__Support.html +1 -1
- data/doc/cxxapi/main.html +1 -1
- data/doc/cxxapi/modules.html +1 -1
- data/doc/rdoc/classes/ConditionVariable.html +59 -59
- data/doc/rdoc/classes/Exception.html +11 -11
- data/doc/rdoc/classes/GC.html +4 -4
- data/doc/rdoc/classes/IO.html +14 -14
- data/doc/rdoc/classes/PhusionPassenger.html +1 -1
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +8 -8
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +136 -136
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +254 -254
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +61 -61
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +4 -4
- data/doc/rdoc/classes/PhusionPassenger/Application.html +14 -14
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +12 -12
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +4 -4
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +12 -12
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +5 -5
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +139 -139
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +61 -56
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +3 -3
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +7 -7
- data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +15 -15
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +119 -119
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +4 -4
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +310 -312
- data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +169 -0
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +4 -4
- data/doc/rdoc/classes/PlatformInfo.html +165 -164
- data/doc/rdoc/classes/Signal.html +23 -23
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +26 -28
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +26 -28
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +26 -28
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +26 -28
- data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +1 -2
- data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +26 -28
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +26 -28
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +34 -36
- data/doc/rdoc/fr_class_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +72 -68
- data/ext/apache2/Configuration.cpp +69 -15
- data/ext/apache2/Configuration.h +37 -2
- data/ext/apache2/Hooks.cpp +167 -59
- data/ext/common/ApplicationPoolServerExecutable.cpp +1 -1
- data/ext/common/MessageChannel.h +4 -4
- data/ext/common/StandardApplicationPool.h +1 -1
- data/ext/common/Timer.h +2 -0
- data/ext/common/Version.h +1 -1
- data/ext/nginx/Configuration.c +3 -3
- data/ext/nginx/ContentHandler.c +16 -4
- data/ext/nginx/HelperServer.cpp +1 -1
- data/ext/oxt/system_calls.cpp +6 -1
- data/ext/oxt/thread.hpp +17 -2
- data/ext/phusion_passenger/native_support.c +4 -4
- data/lib/phusion_passenger/abstract_request_handler.rb +3 -3
- data/lib/phusion_passenger/abstract_server.rb +1 -0
- data/lib/phusion_passenger/constants.rb +1 -1
- data/lib/phusion_passenger/message_channel.rb +1 -0
- data/lib/phusion_passenger/platform_info.rb +3 -2
- data/lib/phusion_passenger/rack/request_handler.rb +11 -7
- data/lib/phusion_passenger/railz/application_spawner.rb +7 -4
- data/lib/phusion_passenger/railz/request_handler.rb +1 -0
- data/lib/phusion_passenger/spawn_manager.rb +1 -0
- data/lib/phusion_passenger/utils.rb +38 -20
- data/test/integration_tests/apache2_tests.rb +162 -100
- data/test/integration_tests/mycook_spec.rb +63 -62
- data/test/integration_tests/nginx_tests.rb +12 -5
- data/test/ruby/utils_spec.rb +98 -14
- data/test/stub/apache2/httpd.conf.erb +2 -1
- data/test/stub/rails_apps/mycook/app/controllers/welcome_controller.rb +8 -0
- data/test/support/apache2_controller.rb +5 -1
- data/test/support/test_helper.rb +42 -13
- metadata +7 -137
@@ -90,7 +90,7 @@ attribute is guaranteed non-nil.
|
|
90
90
|
|
91
91
|
<div class="sectiontitle">Methods</div>
|
92
92
|
<ul>
|
93
|
-
<li><a href="#
|
93
|
+
<li><a href="#M000113">new</a></li>
|
94
94
|
</ul>
|
95
95
|
|
96
96
|
|
@@ -118,11 +118,11 @@ attribute is guaranteed non-nil.
|
|
118
118
|
<div class="sectiontitle">Public Class methods</div>
|
119
119
|
<div class="method">
|
120
120
|
<div class="title">
|
121
|
-
<a name="
|
121
|
+
<a name="M000113"></a><b>new</b>(message, child_exception, options)
|
122
122
|
</div>
|
123
123
|
<div class="sourcecode">
|
124
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
125
|
-
<div id="
|
124
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000113_source')" id="l_M000113_source">show source</a> ]</p>
|
125
|
+
<div id="M000113_source" class="dyn-source">
|
126
126
|
<pre>
|
127
127
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/exceptions.rb, line 80</span>
|
128
128
|
80: <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-identifier">options</span>)
|
@@ -84,9 +84,9 @@ A convenience utility class for rendering our error pages.
|
|
84
84
|
|
85
85
|
<div class="sectiontitle">Methods</div>
|
86
86
|
<ul>
|
87
|
-
<li><a href="#
|
88
|
-
<li><a href="#
|
89
|
-
<li><a href="#
|
87
|
+
<li><a href="#M000115">[]=</a></li>
|
88
|
+
<li><a href="#M000114">new</a></li>
|
89
|
+
<li><a href="#M000116">result</a></li>
|
90
90
|
</ul>
|
91
91
|
|
92
92
|
<div class="sectiontitle">Included Modules</div>
|
@@ -114,11 +114,11 @@ A convenience utility class for rendering our error pages.
|
|
114
114
|
<div class="sectiontitle">Public Class methods</div>
|
115
115
|
<div class="method">
|
116
116
|
<div class="title">
|
117
|
-
<a name="
|
117
|
+
<a name="M000114"></a><b>new</b>(template_name, options = {})
|
118
118
|
</div>
|
119
119
|
<div class="sourcecode">
|
120
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
121
|
-
<div id="
|
120
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000114_source')" id="l_M000114_source">show source</a> ]</p>
|
121
|
+
<div id="M000114_source" class="dyn-source">
|
122
122
|
<pre>
|
123
123
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/html_template.rb, line 33</span>
|
124
124
|
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">template_name</span>, <span class="ruby-identifier">options</span> = {})
|
@@ -136,11 +136,11 @@ A convenience utility class for rendering our error pages.
|
|
136
136
|
<div class="sectiontitle">Public Instance methods</div>
|
137
137
|
<div class="method">
|
138
138
|
<div class="title">
|
139
|
-
<a name="
|
139
|
+
<a name="M000115"></a><b>[]=</b>(name, value)
|
140
140
|
</div>
|
141
141
|
<div class="sourcecode">
|
142
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
143
|
-
<div id="
|
142
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000115_source')" id="l_M000115_source">show source</a> ]</p>
|
143
|
+
<div id="M000115_source" class="dyn-source">
|
144
144
|
<pre>
|
145
145
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/html_template.rb, line 42</span>
|
146
146
|
42: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>)
|
@@ -153,11 +153,11 @@ A convenience utility class for rendering our error pages.
|
|
153
153
|
</div>
|
154
154
|
<div class="method">
|
155
155
|
<div class="title">
|
156
|
-
<a name="
|
156
|
+
<a name="M000116"></a><b>result</b>()
|
157
157
|
</div>
|
158
158
|
<div class="sourcecode">
|
159
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
160
|
-
<div id="
|
159
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000116_source')" id="l_M000116_source">show source</a> ]</p>
|
160
|
+
<div id="M000116_source" class="dyn-source">
|
161
161
|
<pre>
|
162
162
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/html_template.rb, line 47</span>
|
163
163
|
47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">result</span>
|
@@ -86,7 +86,7 @@ the failure when initializing something.
|
|
86
86
|
|
87
87
|
<div class="sectiontitle">Methods</div>
|
88
88
|
<ul>
|
89
|
-
<li><a href="#
|
89
|
+
<li><a href="#M000100">new</a></li>
|
90
90
|
</ul>
|
91
91
|
|
92
92
|
|
@@ -110,19 +110,19 @@ The exception that caused initialization to fail. This may be nil.
|
|
110
110
|
<div class="sectiontitle">Public Class methods</div>
|
111
111
|
<div class="method">
|
112
112
|
<div class="title">
|
113
|
-
<a name="
|
113
|
+
<a name="M000100"></a><b>new</b>(message, child_exception = nil)
|
114
114
|
</div>
|
115
115
|
<div class="description">
|
116
116
|
<p>
|
117
|
-
Create a <a href="InitializationError.html#
|
117
|
+
Create a <a href="InitializationError.html#M000100">new</a> <a
|
118
118
|
href="InitializationError.html">InitializationError</a>. <tt>message</tt>
|
119
119
|
is the error message, and <tt>child_exception</tt> is the exception that
|
120
120
|
caused initialization to fail.
|
121
121
|
</p>
|
122
122
|
</div>
|
123
123
|
<div class="sourcecode">
|
124
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
125
|
-
<div id="
|
124
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000100_source')" id="l_M000100_source">show source</a> ]</p>
|
125
|
+
<div id="M000100_source" class="dyn-source">
|
126
126
|
<pre>
|
127
127
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/exceptions.rb, line 48</span>
|
128
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>)
|
@@ -134,8 +134,8 @@ The life time of a <a href="MessageChannel.html">MessageChannel</a> is
|
|
134
134
|
independent from that of the wrapped <a href="../IO.html">IO</a> object. If
|
135
135
|
a <a href="MessageChannel.html">MessageChannel</a> object is destroyed, the
|
136
136
|
underlying <a href="../IO.html">IO</a> object is not automatically closed.
|
137
|
-
Call <a href="MessageChannel.html#
|
138
|
-
href="MessageChannel.html#
|
137
|
+
Call <a href="MessageChannel.html#M000156">close</a>() if you want to <a
|
138
|
+
href="MessageChannel.html#M000156">close</a> the underlying <a
|
139
139
|
href="../IO.html">IO</a> object.
|
140
140
|
</p>
|
141
141
|
<p>
|
@@ -154,15 +154,15 @@ things in the wrong order then bad things will happen.
|
|
154
154
|
|
155
155
|
<div class="sectiontitle">Methods</div>
|
156
156
|
<ul>
|
157
|
-
<li><a href="#
|
158
|
-
<li><a href="#
|
159
|
-
<li><a href="#
|
160
|
-
<li><a href="#
|
161
|
-
<li><a href="#
|
162
|
-
<li><a href="#
|
163
|
-
<li><a href="#
|
164
|
-
<li><a href="#
|
165
|
-
<li><a href="#
|
157
|
+
<li><a href="#M000156">close</a></li>
|
158
|
+
<li><a href="#M000155">fileno</a></li>
|
159
|
+
<li><a href="#M000148">new</a></li>
|
160
|
+
<li><a href="#M000149">read</a></li>
|
161
|
+
<li><a href="#M000150">read_scalar</a></li>
|
162
|
+
<li><a href="#M000153">recv_io</a></li>
|
163
|
+
<li><a href="#M000154">send_io</a></li>
|
164
|
+
<li><a href="#M000151">write</a></li>
|
165
|
+
<li><a href="#M000152">write_scalar</a></li>
|
166
166
|
</ul>
|
167
167
|
|
168
168
|
|
@@ -186,23 +186,23 @@ The wrapped <a href="../IO.html">IO</a> object.
|
|
186
186
|
<div class="sectiontitle">Public Class methods</div>
|
187
187
|
<div class="method">
|
188
188
|
<div class="title">
|
189
|
-
<a name="
|
189
|
+
<a name="M000148"></a><b>new</b>(io)
|
190
190
|
</div>
|
191
191
|
<div class="description">
|
192
192
|
<p>
|
193
|
-
Create a <a href="MessageChannel.html#
|
193
|
+
Create a <a href="MessageChannel.html#M000148">new</a> <a
|
194
194
|
href="MessageChannel.html">MessageChannel</a> by wrapping the given <a
|
195
195
|
href="../IO.html">IO</a> object.
|
196
196
|
</p>
|
197
197
|
</div>
|
198
198
|
<div class="sourcecode">
|
199
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
200
|
-
<div id="
|
199
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000148_source')" id="l_M000148_source">show source</a> ]</p>
|
200
|
+
<div id="M000148_source" class="dyn-source">
|
201
201
|
<pre>
|
202
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line
|
203
|
-
|
204
|
-
|
205
|
-
|
202
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 83</span>
|
203
|
+
83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">io</span>)
|
204
|
+
84: <span class="ruby-ivar">@io</span> = <span class="ruby-identifier">io</span>
|
205
|
+
85: <span class="ruby-keyword kw">end</span>
|
206
206
|
</pre>
|
207
207
|
</div>
|
208
208
|
</div>
|
@@ -210,7 +210,7 @@ href="../IO.html">IO</a> object.
|
|
210
210
|
<div class="sectiontitle">Public Instance methods</div>
|
211
211
|
<div class="method">
|
212
212
|
<div class="title">
|
213
|
-
<a name="
|
213
|
+
<a name="M000156"></a><b>close</b>()
|
214
214
|
</div>
|
215
215
|
<div class="description">
|
216
216
|
<p>
|
@@ -219,20 +219,20 @@ SystemCallError or IOError when something goes wrong.
|
|
219
219
|
</p>
|
220
220
|
</div>
|
221
221
|
<div class="sourcecode">
|
222
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
223
|
-
<div id="
|
222
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000156_source')" id="l_M000156_source">show source</a> ]</p>
|
223
|
+
<div id="M000156_source" class="dyn-source">
|
224
224
|
<pre>
|
225
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line
|
226
|
-
|
227
|
-
|
228
|
-
|
225
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 217</span>
|
226
|
+
217: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
|
227
|
+
218: <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">close</span>
|
228
|
+
219: <span class="ruby-keyword kw">end</span>
|
229
229
|
</pre>
|
230
230
|
</div>
|
231
231
|
</div>
|
232
232
|
</div>
|
233
233
|
<div class="method">
|
234
234
|
<div class="title">
|
235
|
-
<a name="
|
235
|
+
<a name="M000155"></a><b>fileno</b>()
|
236
236
|
</div>
|
237
237
|
<div class="description">
|
238
238
|
<p>
|
@@ -241,20 +241,20 @@ object.
|
|
241
241
|
</p>
|
242
242
|
</div>
|
243
243
|
<div class="sourcecode">
|
244
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
245
|
-
<div id="
|
244
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000155_source')" id="l_M000155_source">show source</a> ]</p>
|
245
|
+
<div id="M000155_source" class="dyn-source">
|
246
246
|
<pre>
|
247
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line
|
248
|
-
|
249
|
-
|
250
|
-
|
247
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 211</span>
|
248
|
+
211: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fileno</span>
|
249
|
+
212: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">fileno</span>
|
250
|
+
213: <span class="ruby-keyword kw">end</span>
|
251
251
|
</pre>
|
252
252
|
</div>
|
253
253
|
</div>
|
254
254
|
</div>
|
255
255
|
<div class="method">
|
256
256
|
<div class="title">
|
257
|
-
<a name="
|
257
|
+
<a name="M000149"></a><b>read</b>()
|
258
258
|
</div>
|
259
259
|
<div class="description">
|
260
260
|
<p>
|
@@ -267,52 +267,52 @@ wrong.
|
|
267
267
|
</p>
|
268
268
|
</div>
|
269
269
|
<div class="sourcecode">
|
270
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
271
|
-
<div id="
|
270
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000149_source')" id="l_M000149_source">show source</a> ]</p>
|
271
|
+
<div id="M000149_source" class="dyn-source">
|
272
272
|
<pre>
|
273
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
273
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 93</span>
|
274
|
+
93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span>
|
275
|
+
94: <span class="ruby-identifier">buffer</span> = <span class="ruby-value str">''</span>
|
276
|
+
95: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><</span> <span class="ruby-constant">HEADER_SIZE</span>
|
277
|
+
96: <span class="ruby-identifier">buffer</span> <span class="ruby-operator"><<</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
|
+
97: <span class="ruby-keyword kw">end</span>
|
279
|
+
98:
|
280
|
+
99: <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
|
+
100: <span class="ruby-identifier">buffer</span> = <span class="ruby-value str">''</span>
|
282
|
+
101: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">chunk_size</span>
|
283
|
+
102: <span class="ruby-identifier">buffer</span> <span class="ruby-operator"><<</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
|
+
103: <span class="ruby-keyword kw">end</span>
|
285
|
+
104:
|
286
|
+
105: <span class="ruby-identifier">message</span> = []
|
287
|
+
106: <span class="ruby-identifier">offset</span> = <span class="ruby-value">0</span>
|
288
|
+
107: <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
|
+
108: <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
|
+
109: <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
|
+
110: <span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">""</span>
|
292
|
+
111: <span class="ruby-keyword kw">else</span>
|
293
|
+
112: <span class="ruby-identifier">message</span> <span class="ruby-operator"><<</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
|
+
113: <span class="ruby-keyword kw">end</span>
|
295
|
+
114: <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
|
+
115: <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
|
+
116: <span class="ruby-keyword kw">end</span>
|
298
|
+
117: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">message</span>
|
299
|
+
118: <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
|
+
119: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
301
|
+
120: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>
|
302
|
+
121: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
303
|
+
122: <span class="ruby-keyword kw">end</span>
|
304
304
|
</pre>
|
305
305
|
</div>
|
306
306
|
</div>
|
307
307
|
</div>
|
308
308
|
<div class="method">
|
309
309
|
<div class="title">
|
310
|
-
<a name="
|
310
|
+
<a name="M000150"></a><b>read_scalar</b>(max_size = nil)
|
311
311
|
</div>
|
312
312
|
<div class="description">
|
313
313
|
<p>
|
314
314
|
Read a scalar message from the underlying <a href="../IO.html">IO</a>
|
315
|
-
object. Returns the <a href="MessageChannel.html#
|
315
|
+
object. Returns the <a href="MessageChannel.html#M000149">read</a> message,
|
316
316
|
or nil on end-of-stream.
|
317
317
|
</p>
|
318
318
|
<p>
|
@@ -326,49 +326,49 @@ larger than <tt>max_size</tt>, then a SecurityError will be raised.
|
|
326
326
|
</p>
|
327
327
|
</div>
|
328
328
|
<div class="sourcecode">
|
329
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
330
|
-
<div id="
|
329
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000150_source')" id="l_M000150_source">show source</a> ]</p>
|
330
|
+
<div id="M000150_source" class="dyn-source">
|
331
331
|
<pre>
|
332
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
332
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 133</span>
|
333
|
+
133: <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
|
+
134: <span class="ruby-identifier">buffer</span> = <span class="ruby-value str">''</span>
|
335
|
+
135: <span class="ruby-identifier">temp</span> = <span class="ruby-value str">''</span>
|
336
|
+
136: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><</span> <span class="ruby-value">4</span>
|
337
|
+
137: <span class="ruby-identifier">buffer</span> <span class="ruby-operator"><<</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
|
+
138: <span class="ruby-keyword kw">end</span>
|
339
|
+
139: <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
|
+
140: <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
|
+
141: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">''</span>
|
342
|
+
142: <span class="ruby-keyword kw">else</span>
|
343
|
+
143: <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">&&</span> <span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-identifier">max_size</span>
|
344
|
+
144: <span class="ruby-identifier">raise</span> <span class="ruby-constant">SecurityError</span>, <span class="ruby-node">"Scalar message size (#{size}) "</span> <span class="ruby-operator"><<</span>
|
345
|
+
145: <span class="ruby-node">"exceeds maximum allowed size (#{max_size})."</span>
|
346
|
+
146: <span class="ruby-keyword kw">end</span>
|
347
|
+
147: <span class="ruby-identifier">buffer</span> = <span class="ruby-value str">''</span>
|
348
|
+
148: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">size</span>
|
349
|
+
149: <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
|
+
150: <span class="ruby-identifier">buffer</span> <span class="ruby-operator"><<</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
|
+
151: <span class="ruby-keyword kw">end</span>
|
352
|
+
152: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">buffer</span>
|
353
|
+
153: <span class="ruby-keyword kw">end</span>
|
354
|
+
154: <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
|
+
155: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
356
|
+
156: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>
|
357
|
+
157: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
358
|
+
158: <span class="ruby-keyword kw">end</span>
|
359
359
|
</pre>
|
360
360
|
</div>
|
361
361
|
</div>
|
362
362
|
</div>
|
363
363
|
<div class="method">
|
364
364
|
<div class="title">
|
365
|
-
<a name="
|
365
|
+
<a name="M000153"></a><b>recv_io</b>()
|
366
366
|
</div>
|
367
367
|
<div class="description">
|
368
368
|
<p>
|
369
369
|
Receive an <a href="../IO.html">IO</a> object (a file descriptor) from the
|
370
370
|
channel. The other side must have sent an <a href="../IO.html">IO</a>
|
371
|
-
object by calling <a href="MessageChannel.html#
|
371
|
+
object by calling <a href="MessageChannel.html#M000154">send_io</a>(). Note
|
372
372
|
that this only works on Unix sockets.
|
373
373
|
</p>
|
374
374
|
<p>
|
@@ -377,26 +377,26 @@ wrong.
|
|
377
377
|
</p>
|
378
378
|
</div>
|
379
379
|
<div class="sourcecode">
|
380
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
381
|
-
<div id="
|
380
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000153_source')" id="l_M000153_source">show source</a> ]</p>
|
381
|
+
<div id="M000153_source" class="dyn-source">
|
382
382
|
<pre>
|
383
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line
|
384
|
-
|
385
|
-
|
386
|
-
|
383
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 196</span>
|
384
|
+
196: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">recv_io</span>
|
385
|
+
197: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">recv_io</span>
|
386
|
+
198: <span class="ruby-keyword kw">end</span>
|
387
387
|
</pre>
|
388
388
|
</div>
|
389
389
|
</div>
|
390
390
|
</div>
|
391
391
|
<div class="method">
|
392
392
|
<div class="title">
|
393
|
-
<a name="
|
393
|
+
<a name="M000154"></a><b>send_io</b>(io)
|
394
394
|
</div>
|
395
395
|
<div class="description">
|
396
396
|
<p>
|
397
397
|
Send an <a href="../IO.html">IO</a> object (a file descriptor) over the
|
398
398
|
channel. The other side must receive the <a href="../IO.html">IO</a> object
|
399
|
-
by calling <a href="MessageChannel.html#
|
399
|
+
by calling <a href="MessageChannel.html#M000153">recv_io</a>(). Note that
|
400
400
|
this only works on Unix sockets.
|
401
401
|
</p>
|
402
402
|
<p>
|
@@ -405,20 +405,20 @@ wrong.
|
|
405
405
|
</p>
|
406
406
|
</div>
|
407
407
|
<div class="sourcecode">
|
408
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
409
|
-
<div id="
|
408
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000154_source')" id="l_M000154_source">show source</a> ]</p>
|
409
|
+
<div id="M000154_source" class="dyn-source">
|
410
410
|
<pre>
|
411
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line
|
412
|
-
|
413
|
-
|
414
|
-
|
411
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 206</span>
|
412
|
+
206: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_io</span>(<span class="ruby-identifier">io</span>)
|
413
|
+
207: <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">send_io</span>(<span class="ruby-identifier">io</span>)
|
414
|
+
208: <span class="ruby-keyword kw">end</span>
|
415
415
|
</pre>
|
416
416
|
</div>
|
417
417
|
</div>
|
418
418
|
</div>
|
419
419
|
<div class="method">
|
420
420
|
<div class="title">
|
421
|
-
<a name="
|
421
|
+
<a name="M000151"></a><b>write</b>(name, *args)
|
422
422
|
</div>
|
423
423
|
<div class="description">
|
424
424
|
<p>
|
@@ -433,30 +433,30 @@ wrong.
|
|
433
433
|
</p>
|
434
434
|
</div>
|
435
435
|
<div class="sourcecode">
|
436
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
437
|
-
<div id="
|
436
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000151_source')" id="l_M000151_source">show source</a> ]</p>
|
437
|
+
<div id="M000151_source" class="dyn-source">
|
438
438
|
<pre>
|
439
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
439
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 167</span>
|
440
|
+
167: <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
|
+
168: <span class="ruby-identifier">check_argument</span>(<span class="ruby-identifier">name</span>)
|
442
|
+
169: <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
|
+
170: <span class="ruby-identifier">check_argument</span>(<span class="ruby-identifier">arg</span>)
|
444
|
+
171: <span class="ruby-keyword kw">end</span>
|
445
|
+
172:
|
446
|
+
173: <span class="ruby-identifier">message</span> = <span class="ruby-node">"#{name}#{DELIMITER}"</span>
|
447
|
+
174: <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
|
+
175: <span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">DELIMITER</span>
|
449
|
+
176: <span class="ruby-keyword kw">end</span>
|
450
|
+
177: <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"><<</span> <span class="ruby-identifier">message</span>)
|
451
|
+
178: <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">flush</span>
|
452
|
+
179: <span class="ruby-keyword kw">end</span>
|
453
453
|
</pre>
|
454
454
|
</div>
|
455
455
|
</div>
|
456
456
|
</div>
|
457
457
|
<div class="method">
|
458
458
|
<div class="title">
|
459
|
-
<a name="
|
459
|
+
<a name="M000152"></a><b>write_scalar</b>(data)
|
460
460
|
</div>
|
461
461
|
<div class="description">
|
462
462
|
<p>
|
@@ -469,14 +469,14 @@ wrong.
|
|
469
469
|
</p>
|
470
470
|
</div>
|
471
471
|
<div class="sourcecode">
|
472
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
473
|
-
<div id="
|
472
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000152_source')" id="l_M000152_source">show source</a> ]</p>
|
473
|
+
<div id="M000152_source" class="dyn-source">
|
474
474
|
<pre>
|
475
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
475
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 185</span>
|
476
|
+
185: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">data</span>)
|
477
|
+
186: <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"><<</span> <span class="ruby-identifier">data</span>)
|
478
|
+
187: <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">flush</span>
|
479
|
+
188: <span class="ruby-keyword kw">end</span>
|
480
480
|
</pre>
|
481
481
|
</div>
|
482
482
|
</div>
|