passenger 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data/LICENSE +3 -1
- data/Rakefile +17 -12
- data/bin/passenger-config +22 -0
- data/bin/passenger-install-apache2-module +2 -31
- data/bin/passenger-make-enterprisey +66 -0
- data/bin/passenger-memory-stats +192 -0
- data/doc/Users guide.html +150 -66
- data/doc/Users guide.txt +141 -51
- data/doc/cxxapi/ApplicationPoolClientServer_8h-source.html +1 -1
- data/doc/cxxapi/ApplicationPoolServer_8h-source.html +545 -0
- data/doc/cxxapi/ApplicationPool_8h-source.html +1 -1
- data/doc/cxxapi/Application_8h-source.html +1 -1
- data/doc/cxxapi/Configuration_8h-source.html +2 -2
- data/doc/cxxapi/DummySpawnManager_8h-source.html +1 -1
- data/doc/cxxapi/Exceptions_8h-source.html +1 -1
- data/doc/cxxapi/Hooks_8h-source.html +1 -1
- data/doc/cxxapi/Logging_8h-source.html +1 -1
- data/doc/cxxapi/MessageChannel_8h-source.html +210 -205
- data/doc/cxxapi/SpawnManager_8h-source.html +1 -1
- data/doc/cxxapi/StandardApplicationPool_8h-source.html +1 -1
- data/doc/cxxapi/Utils_8h-source.html +1 -1
- data/doc/cxxapi/annotated.html +1 -1
- data/doc/cxxapi/classClient-members.html +30 -0
- data/doc/cxxapi/classClient.html +112 -0
- data/doc/cxxapi/classPassenger_1_1Application-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +28 -0
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +41 -0
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnManager.html +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException.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/functions_type.html +1 -1
- data/doc/cxxapi/graph_legend.html +1 -1
- data/doc/cxxapi/graph_legend.png +0 -0
- data/doc/cxxapi/group__Configuration.html +3 -3
- data/doc/cxxapi/group__Configuration.png +0 -0
- data/doc/cxxapi/group__Core.html +1 -1
- data/doc/cxxapi/group__Core.png +0 -0
- data/doc/cxxapi/group__Exceptions.html +1 -1
- data/doc/cxxapi/group__Hooks.html +1 -1
- data/doc/cxxapi/group__Hooks.png +0 -0
- data/doc/cxxapi/group__Support.html +1 -1
- data/doc/cxxapi/hierarchy.html +1 -1
- data/doc/cxxapi/inherit__graph__0.png +0 -0
- data/doc/cxxapi/inherit__graph__1.png +0 -0
- data/doc/cxxapi/inherit__graph__10.map +1 -0
- data/doc/cxxapi/inherit__graph__10.md5 +1 -0
- data/doc/cxxapi/inherit__graph__10.png +0 -0
- data/doc/cxxapi/inherit__graph__2.png +0 -0
- data/doc/cxxapi/inherit__graph__3.png +0 -0
- data/doc/cxxapi/inherit__graph__4.png +0 -0
- data/doc/cxxapi/inherit__graph__5.png +0 -0
- data/doc/cxxapi/inherit__graph__6.png +0 -0
- data/doc/cxxapi/inherit__graph__7.png +0 -0
- data/doc/cxxapi/inherit__graph__8.png +0 -0
- data/doc/cxxapi/inherit__graph__9.png +0 -0
- data/doc/cxxapi/inherits.html +1 -1
- data/doc/cxxapi/main.html +1 -1
- data/doc/cxxapi/modules.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +1 -1
- data/doc/rdoc/classes/Passenger/RequestHandler.html +84 -74
- data/doc/rdoc/classes/Passenger/SpawnManager.html +54 -49
- data/doc/rdoc/classes/PlatformInfo.html +25 -12
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +1 -1
- data/doc/rdoc/files/ext/passenger/native_support_c.html +1 -1
- data/doc/rdoc/files/lib/passenger/abstract_server_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/application_spawner_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/dependencies_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/framework_spawner_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/platform_info_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/request_handler_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/spawn_manager_rb.html +1 -1
- data/ext/apache2/Configuration.h +1 -1
- data/ext/apache2/Hooks.cpp +68 -16
- data/ext/apache2/Logging.cpp +1 -1
- data/ext/apache2/MessageChannel.h +48 -43
- data/ext/passenger/native_support.c +46 -43
- data/lib/passenger/application_spawner.rb +37 -4
- data/lib/passenger/dependencies.rb +5 -1
- data/lib/passenger/framework_spawner.rb +2 -0
- data/lib/passenger/platform_info.rb +32 -17
- data/lib/passenger/request_handler.rb +10 -1
- data/lib/passenger/spawn_manager.rb +14 -8
- data/lib/passenger/templates/error_layout.html.erb +2 -2
- data/test/CxxTestMain.cpp +1 -0
- data/test/MessageChannelTest.cpp +3 -1
- data/test/application_spawner_spec.rb +2 -0
- data/test/framework_spawner_spec.rb +2 -0
- data/test/integration_tests.rb +1 -0
- data/test/spawn_manager_spec.rb +2 -0
- data/test/spawner_privilege_lowering_spec.rb +1 -0
- data/test/stub/minimal-railsapp/vendor/rails/actionpack/lib/action_controller.rb +4 -0
- data/test/stub/minimal-railsapp/vendor/rails/activerecord/lib/active_record.rb +7 -0
- data/test/stub/rails_apps/foobar/config/environments/test.rb +22 -0
- metadata +28 -22
- data/lib/passenger/templates/osx_broken_apache_warning.txt.erb +0 -23
@@ -182,7 +182,7 @@
|
|
182
182
|
<a name="l00167"></a>00167 }; <span class="comment">// namespace Passenger</span>
|
183
183
|
<a name="l00168"></a>00168
|
184
184
|
<a name="l00169"></a>00169 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_APPLICATION_POOL_H_ */</span>
|
185
|
-
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on
|
185
|
+
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Tue Apr 29 15:25:32 2008 for Passenger by
|
186
186
|
<a href="http://www.doxygen.org/index.html">
|
187
187
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
|
188
188
|
</body>
|
@@ -395,7 +395,7 @@
|
|
395
395
|
<a name="l00380"></a>00380 } <span class="comment">// namespace Passenger</span>
|
396
396
|
<a name="l00381"></a>00381
|
397
397
|
<a name="l00382"></a>00382 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_APPLICATION_H_ */</span>
|
398
|
-
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on
|
398
|
+
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Tue Apr 29 15:25:32 2008 for Passenger by
|
399
399
|
<a href="http://www.doxygen.org/index.html">
|
400
400
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
|
401
401
|
</body>
|
@@ -44,7 +44,7 @@
|
|
44
44
|
<a name="l00029"></a>00029 <span class="comment"> */</span>
|
45
45
|
<a name="l00030"></a>00030 <span class="comment"></span>
|
46
46
|
<a name="l00031"></a>00031 <span class="comment">/** Module version number. */</span>
|
47
|
-
<a name="l00032"></a><a class="code" href="group__Configuration.html#ga19398896775408d6ab7fd8ce2acd992">00032</a> <span class="preprocessor">#define PASSENGER_VERSION "1.0.
|
47
|
+
<a name="l00032"></a><a class="code" href="group__Configuration.html#ga19398896775408d6ab7fd8ce2acd992">00032</a> <span class="preprocessor">#define PASSENGER_VERSION "1.0.2"</span>
|
48
48
|
<a name="l00033"></a>00033 <span class="preprocessor"></span>
|
49
49
|
<a name="l00034"></a>00034 <span class="preprocessor">#ifdef __cplusplus</span>
|
50
50
|
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor"> #include <set></span>
|
@@ -138,7 +138,7 @@
|
|
138
138
|
<a name="l00123"></a>00123 <span class="comment"> */</span>
|
139
139
|
<a name="l00124"></a>00124
|
140
140
|
<a name="l00125"></a>00125 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_CONFIGURATION_H_ */</span>
|
141
|
-
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on
|
141
|
+
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Tue Apr 29 15:25:32 2008 for Passenger by
|
142
142
|
<a href="http://www.doxygen.org/index.html">
|
143
143
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
|
144
144
|
</body>
|
@@ -114,7 +114,7 @@
|
|
114
114
|
<a name="l00099"></a>00099 } <span class="comment">// namespace Passenger</span>
|
115
115
|
<a name="l00100"></a>00100
|
116
116
|
<a name="l00101"></a>00101 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_DUMMY_SPAWN_MANAGER_H_ */</span>
|
117
|
-
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on
|
117
|
+
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Tue Apr 29 15:25:32 2008 for Passenger by
|
118
118
|
<a href="http://www.doxygen.org/index.html">
|
119
119
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
|
120
120
|
</body>
|
@@ -181,7 +181,7 @@
|
|
181
181
|
<a name="l00166"></a>00166 } <span class="comment">// namespace Passenger</span>
|
182
182
|
<a name="l00167"></a>00167
|
183
183
|
<a name="l00168"></a>00168 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_EXCEPTIONS_H_ */</span>
|
184
|
-
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on
|
184
|
+
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Tue Apr 29 15:25:32 2008 for Passenger by
|
185
185
|
<a href="http://www.doxygen.org/index.html">
|
186
186
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
|
187
187
|
</body>
|
@@ -51,7 +51,7 @@
|
|
51
51
|
<a name="l00036"></a>00036 <span class="preprocessor">#endif</span>
|
52
52
|
<a name="l00037"></a>00037 <span class="preprocessor"></span>
|
53
53
|
<a name="l00038"></a>00038 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_HOOKS_H_ */</span>
|
54
|
-
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on
|
54
|
+
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Tue Apr 29 15:25:32 2008 for Passenger by
|
55
55
|
<a href="http://www.doxygen.org/index.html">
|
56
56
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
|
57
57
|
</body>
|
@@ -96,7 +96,7 @@
|
|
96
96
|
<a name="l00081"></a>00081
|
97
97
|
<a name="l00082"></a>00082 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_LOGGING_H_ */</span>
|
98
98
|
<a name="l00083"></a>00083
|
99
|
-
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on
|
99
|
+
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Tue Apr 29 15:25:32 2008 for Passenger by
|
100
100
|
<a href="http://www.doxygen.org/index.html">
|
101
101
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
|
102
102
|
</body>
|
@@ -271,212 +271,217 @@
|
|
271
271
|
<a name="l00256"></a>00256 <span class="comment"> * @see readFileDescriptor()</span>
|
272
272
|
<a name="l00257"></a>00257 <span class="comment"> */</span>
|
273
273
|
<a name="l00258"></a><a class="code" href="classPassenger_1_1MessageChannel.html#73e3f3cda384c085a2af0e820ccd3e98">00258</a> <span class="keywordtype">void</span> <a class="code" href="classPassenger_1_1MessageChannel.html#73e3f3cda384c085a2af0e820ccd3e98" title="Pass a file descriptor.">writeFileDescriptor</a>(<span class="keywordtype">int</span> fileDescriptor) {
|
274
|
-
<a name="l00259"></a>00259 <span class="keyword">struct </span>
|
275
|
-
<a name="l00260"></a>00260
|
276
|
-
<a name="l00261"></a>00261
|
277
|
-
<a name="l00262"></a>00262
|
278
|
-
<a name="l00263"></a>00263
|
279
|
-
<a name="l00264"></a>00264
|
280
|
-
<a name="l00265"></a>00265
|
281
|
-
<a name="l00266"></a>00266
|
282
|
-
<a name="l00267"></a>00267
|
283
|
-
<a name="l00268"></a>00268
|
284
|
-
<a name="l00269"></a>00269
|
285
|
-
<a name="l00270"></a>00270 <span class="
|
286
|
-
<a name="l00271"></a>00271
|
287
|
-
<a name="l00272"></a>00272
|
288
|
-
<a name="l00273"></a>00273
|
289
|
-
<a name="l00274"></a>00274 msg.
|
290
|
-
<a name="l00275"></a>00275
|
291
|
-
<a name="l00276"></a>00276
|
292
|
-
<a name="l00277"></a>00277
|
293
|
-
<a name="l00278"></a>00278
|
294
|
-
<a name="l00279"></a>00279
|
295
|
-
<a name="l00280"></a>00280
|
296
|
-
<a name="l00281"></a>00281
|
297
|
-
<a name="l00282"></a>00282
|
298
|
-
<a name="l00283"></a>00283
|
299
|
-
<a name="l00284"></a>00284
|
300
|
-
<a name="l00285"></a>00285
|
301
|
-
<a name="l00286"></a>00286
|
302
|
-
<a name="l00287"></a>00287
|
303
|
-
<a name="l00288"></a>00288
|
304
|
-
<a name="l00289"></a>00289
|
305
|
-
<a name="l00290"></a>00290
|
306
|
-
<a name="l00291"></a>00291
|
307
|
-
<a name="l00292"></a>00292 <span class="comment">
|
308
|
-
<a name="l00293"></a>00293 <span class="comment"> *
|
309
|
-
<a name="l00294"></a>00294 <span class="comment">
|
310
|
-
<a name="l00295"></a>00295 <span class="comment"> *
|
311
|
-
<a name="l00296"></a>00296 <span class="comment"> * @
|
312
|
-
<a name="l00297"></a>00297 <span class="comment"> *
|
313
|
-
<a name="l00298"></a>00298 <span class="comment">
|
314
|
-
<a name="l00299"></a
|
315
|
-
<a name="l00300"></a>00300
|
316
|
-
<a name="l00301"></a>00301
|
317
|
-
<a name="l00302"></a>00302
|
318
|
-
<a name="l00303"></a>00303
|
319
|
-
<a name="l00304"></a>00304 <span class="
|
320
|
-
<a name="l00305"></a>00305
|
321
|
-
<a name="l00306"></a>00306
|
322
|
-
<a name="l00307"></a>00307
|
323
|
-
<a name="l00308"></a>00308
|
324
|
-
<a name="l00309"></a>00309
|
325
|
-
<a name="l00310"></a>00310
|
326
|
-
<a name="l00311"></a>00311 <span class="keywordflow">
|
327
|
-
<a name="l00312"></a>00312 }
|
328
|
-
<a name="l00313"></a>00313
|
329
|
-
<a name="l00314"></a>00314
|
330
|
-
<a name="l00315"></a>00315
|
331
|
-
<a name="l00316"></a>00316
|
332
|
-
<a name="l00317"></a>00317
|
333
|
-
<a name="l00318"></a>00318
|
334
|
-
<a name="l00319"></a>00319 buffer
|
335
|
-
<a name="l00320"></a>00320
|
336
|
-
<a name="l00321"></a>00321
|
337
|
-
<a name="l00322"></a>00322
|
338
|
-
<a name="l00323"></a>00323
|
339
|
-
<a name="l00324"></a>00324
|
340
|
-
<a name="l00325"></a>00325
|
341
|
-
<a name="l00326"></a>00326
|
342
|
-
<a name="l00327"></a>00327
|
343
|
-
<a name="l00328"></a>00328 <span class="keywordflow">
|
344
|
-
<a name="l00329"></a>00329 }
|
345
|
-
<a name="l00330"></a>00330
|
346
|
-
<a name="l00331"></a>00331
|
347
|
-
<a name="l00332"></a>00332
|
348
|
-
<a name="l00333"></a>00333
|
349
|
-
<a name="l00334"></a>00334
|
350
|
-
<a name="l00335"></a>00335
|
351
|
-
<a name="l00336"></a>00336
|
352
|
-
<a name="l00337"></a>00337
|
353
|
-
<a name="l00338"></a>00338
|
354
|
-
<a name="l00339"></a>00339
|
355
|
-
<a name="l00340"></a>00340
|
356
|
-
<a name="l00341"></a>00341
|
357
|
-
<a name="l00342"></a>00342
|
358
|
-
<a name="l00343"></a>00343
|
359
|
-
<a name="l00344"></a>00344
|
360
|
-
<a name="l00345"></a>00345
|
361
|
-
<a name="l00346"></a>00346 <span class="comment">
|
362
|
-
<a name="l00347"></a>00347 <span class="comment"> *
|
363
|
-
<a name="l00348"></a>00348 <span class="comment">
|
364
|
-
<a name="l00349"></a>00349 <span class="comment"> * @
|
365
|
-
<a name="l00350"></a>00350 <span class="comment"> * @
|
366
|
-
<a name="l00351"></a>00351 <span class="comment">
|
367
|
-
<a name="l00352"></a
|
368
|
-
<a name="l00353"></a>00353
|
369
|
-
<a name="l00354"></a>00354
|
370
|
-
<a name="l00355"></a>00355
|
371
|
-
<a name="l00356"></a>00356 <span class="
|
372
|
-
<a name="l00357"></a>00357
|
373
|
-
<a name="l00358"></a>00358
|
374
|
-
<a name="l00359"></a>00359
|
375
|
-
<a name="l00360"></a>00360
|
376
|
-
<a name="l00361"></a>00361
|
377
|
-
<a name="l00362"></a>00362
|
378
|
-
<a name="l00363"></a>00363
|
379
|
-
<a name="l00364"></a>00364
|
380
|
-
<a name="l00365"></a>00365
|
381
|
-
<a name="l00366"></a>00366
|
382
|
-
<a name="l00367"></a>00367
|
383
|
-
<a name="l00368"></a>00368 <span class="
|
384
|
-
<a name="l00369"></a>00369
|
385
|
-
<a name="l00370"></a>00370
|
386
|
-
<a name="l00371"></a>00371
|
387
|
-
<a name="l00372"></a>00372
|
388
|
-
<a name="l00373"></a>00373
|
389
|
-
<a name="l00374"></a>00374
|
390
|
-
<a name="l00375"></a>00375
|
391
|
-
<a name="l00376"></a>00376
|
392
|
-
<a name="l00377"></a>00377
|
393
|
-
<a name="l00378"></a>00378
|
394
|
-
<a name="l00379"></a>00379 <span class="comment">
|
395
|
-
<a name="l00380"></a>00380 <span class="comment"> *
|
396
|
-
<a name="l00381"></a>00381 <span class="comment"> * <tt>
|
397
|
-
<a name="l00382"></a>00382 <span class="comment"> * <tt>
|
398
|
-
<a name="l00383"></a>00383 <span class="comment">
|
399
|
-
<a name="l00384"></a>00384 <span class="comment"> *
|
400
|
-
<a name="l00385"></a>00385 <span class="comment">
|
401
|
-
<a name="l00386"></a>00386 <span class="comment"> * @param
|
402
|
-
<a name="l00387"></a>00387 <span class="comment"> *
|
403
|
-
<a name="l00388"></a>00388 <span class="comment"> * @
|
404
|
-
<a name="l00389"></a>00389 <span class="comment"> * @
|
405
|
-
<a name="l00390"></a>00390 <span class="comment"> * @
|
406
|
-
<a name="l00391"></a>00391 <span class="comment">
|
407
|
-
<a name="l00392"></a
|
408
|
-
<a name="l00393"></a>00393
|
409
|
-
<a name="l00394"></a>00394
|
410
|
-
<a name="l00395"></a>00395
|
411
|
-
<a name="l00396"></a>00396 <span class="
|
412
|
-
<a name="l00397"></a>00397
|
413
|
-
<a name="l00398"></a>00398
|
414
|
-
<a name="l00399"></a>00399
|
415
|
-
<a name="l00400"></a>00400
|
416
|
-
<a name="l00401"></a>00401
|
417
|
-
<a name="l00402"></a>00402
|
418
|
-
<a name="l00403"></a>00403 <span class="keywordflow">
|
419
|
-
<a name="l00404"></a>00404 } <span class="keywordflow">else</span> {
|
420
|
-
<a name="l00405"></a>00405
|
421
|
-
<a name="l00406"></a>00406 }
|
422
|
-
<a name="l00407"></a>00407
|
423
|
-
<a name="l00408"></a>00408
|
424
|
-
<a name="l00409"></a>00409
|
425
|
-
<a name="l00410"></a>00410
|
426
|
-
<a name="l00411"></a>00411
|
427
|
-
<a name="l00412"></a>00412
|
428
|
-
<a name="l00413"></a>00413 <span class="comment">
|
429
|
-
<a name="l00414"></a>00414 <span class="comment">
|
430
|
-
<a name="l00415"></a>00415 <span class="comment"> *
|
431
|
-
<a name="l00416"></a>00416 <span class="comment">
|
432
|
-
<a name="l00417"></a>00417 <span class="comment"> *
|
433
|
-
<a name="l00418"></a>00418 <span class="comment"> *
|
434
|
-
<a name="l00419"></a>00419 <span class="comment"> *
|
435
|
-
<a name="l00420"></a>00420 <span class="comment"> * file descriptor.</span>
|
436
|
-
<a name="l00421"></a>00421 <span class="comment">
|
437
|
-
<a name="l00422"></a
|
438
|
-
<a name="l00423"></a>00423
|
439
|
-
<a name="l00424"></a>00424
|
440
|
-
<a name="l00425"></a>00425 <span class="
|
441
|
-
<a name="l00426"></a>00426
|
442
|
-
<a name="l00427"></a>00427 <span class="
|
443
|
-
<a name="l00428"></a>00428
|
444
|
-
<a name="l00429"></a>00429
|
445
|
-
<a name="l00430"></a>00430
|
446
|
-
<a name="l00431"></a>00431
|
447
|
-
<a name="l00432"></a>00432
|
448
|
-
<a name="l00433"></a>00433
|
449
|
-
<a name="l00434"></a>00434
|
450
|
-
<a name="l00435"></a>00435
|
451
|
-
<a name="l00436"></a>00436
|
452
|
-
<a name="l00437"></a>00437
|
274
|
+
<a name="l00259"></a>00259 <span class="keyword">struct </span>{
|
275
|
+
<a name="l00260"></a>00260 <span class="keyword">struct </span>cmsghdr header;
|
276
|
+
<a name="l00261"></a>00261 <span class="keywordtype">int</span> fd;
|
277
|
+
<a name="l00262"></a>00262 } control;
|
278
|
+
<a name="l00263"></a>00263
|
279
|
+
<a name="l00264"></a>00264 control.header.cmsg_len = <span class="keyword">sizeof</span>(control);
|
280
|
+
<a name="l00265"></a>00265 control.header.cmsg_level = SOL_SOCKET;
|
281
|
+
<a name="l00266"></a>00266 control.header.cmsg_type = SCM_RIGHTS;
|
282
|
+
<a name="l00267"></a>00267 control.fd = fileDescriptor;
|
283
|
+
<a name="l00268"></a>00268
|
284
|
+
<a name="l00269"></a>00269 <span class="keyword">struct </span>msghdr msg;
|
285
|
+
<a name="l00270"></a>00270 <span class="keyword">struct </span>iovec vec;
|
286
|
+
<a name="l00271"></a>00271 <span class="keywordtype">char</span> dummy[1];
|
287
|
+
<a name="l00272"></a>00272
|
288
|
+
<a name="l00273"></a>00273 msg.msg_name = NULL;
|
289
|
+
<a name="l00274"></a>00274 msg.msg_namelen = 0;
|
290
|
+
<a name="l00275"></a>00275
|
291
|
+
<a name="l00276"></a>00276 <span class="comment">/* Linux and Solaris require msg_iov to be non-NULL.. */</span>
|
292
|
+
<a name="l00277"></a>00277 dummy[0] = <span class="charliteral">'\0'</span>;
|
293
|
+
<a name="l00278"></a>00278 vec.iov_base = dummy;
|
294
|
+
<a name="l00279"></a>00279 vec.iov_len = <span class="keyword">sizeof</span>(dummy);
|
295
|
+
<a name="l00280"></a>00280 msg.msg_iov = &vec;
|
296
|
+
<a name="l00281"></a>00281 msg.msg_iovlen = 1;
|
297
|
+
<a name="l00282"></a>00282
|
298
|
+
<a name="l00283"></a>00283 msg.msg_control = (caddr_t) &control;
|
299
|
+
<a name="l00284"></a>00284 msg.msg_controllen = <span class="keyword">sizeof</span>(control);
|
300
|
+
<a name="l00285"></a>00285 msg.msg_flags = 0;
|
301
|
+
<a name="l00286"></a>00286
|
302
|
+
<a name="l00287"></a>00287 <span class="keywordflow">if</span> (sendmsg(fd, &msg, 0) == -1) {
|
303
|
+
<a name="l00288"></a>00288 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a>(<span class="stringliteral">"Cannot send file descriptor with sendmsg()"</span>, errno);
|
304
|
+
<a name="l00289"></a>00289 }
|
305
|
+
<a name="l00290"></a>00290 }
|
306
|
+
<a name="l00291"></a>00291 <span class="comment"></span>
|
307
|
+
<a name="l00292"></a>00292 <span class="comment"> /**</span>
|
308
|
+
<a name="l00293"></a>00293 <span class="comment"> * Read an array message from the underlying file descriptor.</span>
|
309
|
+
<a name="l00294"></a>00294 <span class="comment"> *</span>
|
310
|
+
<a name="l00295"></a>00295 <span class="comment"> * @param args The message will be put in this variable.</span>
|
311
|
+
<a name="l00296"></a>00296 <span class="comment"> * @return Whether end-of-file has been reached. If so, then the contents</span>
|
312
|
+
<a name="l00297"></a>00297 <span class="comment"> * of <tt>args</tt> will be undefined.</span>
|
313
|
+
<a name="l00298"></a>00298 <span class="comment"> * @throws SystemException If an error occured while receiving the message.</span>
|
314
|
+
<a name="l00299"></a>00299 <span class="comment"> * @see write()</span>
|
315
|
+
<a name="l00300"></a>00300 <span class="comment"> */</span>
|
316
|
+
<a name="l00301"></a><a class="code" href="classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e">00301</a> <span class="keywordtype">bool</span> <a class="code" href="classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e" title="Read an array message from the underlying file descriptor.">read</a>(vector<string> &args) {
|
317
|
+
<a name="l00302"></a>00302 uint16_t size;
|
318
|
+
<a name="l00303"></a>00303 <span class="keywordtype">int</span> ret;
|
319
|
+
<a name="l00304"></a>00304 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> alreadyRead = 0;
|
320
|
+
<a name="l00305"></a>00305
|
321
|
+
<a name="l00306"></a>00306 <span class="keywordflow">do</span> {
|
322
|
+
<a name="l00307"></a>00307 <span class="keywordflow">do</span> {
|
323
|
+
<a name="l00308"></a>00308 ret =<a class="code" href="classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e" title="Read an array message from the underlying file descriptor."> ::read</a>(fd, (<span class="keywordtype">char</span> *) &size + alreadyRead, <span class="keyword">sizeof</span>(size) - alreadyRead);
|
324
|
+
<a name="l00309"></a>00309 } <span class="keywordflow">while</span> (ret == -1 && errno == EINTR);
|
325
|
+
<a name="l00310"></a>00310 <span class="keywordflow">if</span> (ret == -1) {
|
326
|
+
<a name="l00311"></a>00311 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a>(<span class="stringliteral">"read() failed"</span>, errno);
|
327
|
+
<a name="l00312"></a>00312 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ret == 0) {
|
328
|
+
<a name="l00313"></a>00313 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
329
|
+
<a name="l00314"></a>00314 }
|
330
|
+
<a name="l00315"></a>00315 alreadyRead += ret;
|
331
|
+
<a name="l00316"></a>00316 } <span class="keywordflow">while</span> (alreadyRead < <span class="keyword">sizeof</span>(size));
|
332
|
+
<a name="l00317"></a>00317 size = ntohs(size);
|
333
|
+
<a name="l00318"></a>00318
|
334
|
+
<a name="l00319"></a>00319 <span class="keywordtype">string</span> buffer;
|
335
|
+
<a name="l00320"></a>00320 args.clear();
|
336
|
+
<a name="l00321"></a>00321 buffer.reserve(size);
|
337
|
+
<a name="l00322"></a>00322 <span class="keywordflow">while</span> (buffer.size() < size) {
|
338
|
+
<a name="l00323"></a>00323 <span class="keywordtype">char</span> tmp[1024 * 8];
|
339
|
+
<a name="l00324"></a>00324 <span class="keywordflow">do</span> {
|
340
|
+
<a name="l00325"></a>00325 ret =<a class="code" href="classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e" title="Read an array message from the underlying file descriptor."> ::read</a>(fd, tmp, min(size - buffer.size(), <span class="keyword">sizeof</span>(tmp)));
|
341
|
+
<a name="l00326"></a>00326 } <span class="keywordflow">while</span> (ret == -1 && errno == EINTR);
|
342
|
+
<a name="l00327"></a>00327 <span class="keywordflow">if</span> (ret == -1) {
|
343
|
+
<a name="l00328"></a>00328 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a>(<span class="stringliteral">"read() failed"</span>, errno);
|
344
|
+
<a name="l00329"></a>00329 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ret == 0) {
|
345
|
+
<a name="l00330"></a>00330 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
346
|
+
<a name="l00331"></a>00331 }
|
347
|
+
<a name="l00332"></a>00332 buffer.append(tmp, ret);
|
348
|
+
<a name="l00333"></a>00333 }
|
349
|
+
<a name="l00334"></a>00334
|
350
|
+
<a name="l00335"></a>00335 <span class="keywordflow">if</span> (!buffer.empty()) {
|
351
|
+
<a name="l00336"></a>00336 string::size_type start = 0, pos;
|
352
|
+
<a name="l00337"></a>00337 <span class="keyword">const</span> <span class="keywordtype">string</span> &const_buffer(buffer);
|
353
|
+
<a name="l00338"></a>00338 <span class="keywordflow">while</span> ((pos = const_buffer.find(<span class="charliteral">'\0'</span>, start)) != string::npos) {
|
354
|
+
<a name="l00339"></a>00339 args.push_back(const_buffer.substr(start, pos - start));
|
355
|
+
<a name="l00340"></a>00340 start = pos + 1;
|
356
|
+
<a name="l00341"></a>00341 }
|
357
|
+
<a name="l00342"></a>00342 }
|
358
|
+
<a name="l00343"></a>00343 <span class="keywordflow">return</span> <span class="keyword">true</span>;
|
359
|
+
<a name="l00344"></a>00344 }
|
360
|
+
<a name="l00345"></a>00345 <span class="comment"></span>
|
361
|
+
<a name="l00346"></a>00346 <span class="comment"> /**</span>
|
362
|
+
<a name="l00347"></a>00347 <span class="comment"> * Read a scalar message from the underlying file descriptor.</span>
|
363
|
+
<a name="l00348"></a>00348 <span class="comment"> *</span>
|
364
|
+
<a name="l00349"></a>00349 <span class="comment"> * @param output The message will be put in here.</span>
|
365
|
+
<a name="l00350"></a>00350 <span class="comment"> * @returns Whether end-of-file was reached during reading.</span>
|
366
|
+
<a name="l00351"></a>00351 <span class="comment"> * @throws SystemException An error occured while writing the data to the file descriptor.</span>
|
367
|
+
<a name="l00352"></a>00352 <span class="comment"> * @see writeScalar()</span>
|
368
|
+
<a name="l00353"></a>00353 <span class="comment"> */</span>
|
369
|
+
<a name="l00354"></a><a class="code" href="classPassenger_1_1MessageChannel.html#4ce6a0e751b5e3563bee583c231569bc">00354</a> <span class="keywordtype">bool</span> <a class="code" href="classPassenger_1_1MessageChannel.html#4ce6a0e751b5e3563bee583c231569bc" title="Read a scalar message from the underlying file descriptor.">readScalar</a>(<span class="keywordtype">string</span> &output) {
|
370
|
+
<a name="l00355"></a>00355 uint32_t size;
|
371
|
+
<a name="l00356"></a>00356 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> remaining;
|
372
|
+
<a name="l00357"></a>00357
|
373
|
+
<a name="l00358"></a>00358 <span class="keywordflow">if</span> (!<a class="code" href="classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479" title="Read exactly size bytes of data from the underlying file descriptor, and put the...">readRaw</a>(&size, <span class="keyword">sizeof</span>(uint32_t))) {
|
374
|
+
<a name="l00359"></a>00359 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
375
|
+
<a name="l00360"></a>00360 }
|
376
|
+
<a name="l00361"></a>00361 size = ntohl(size);
|
377
|
+
<a name="l00362"></a>00362
|
378
|
+
<a name="l00363"></a>00363 output.clear();
|
379
|
+
<a name="l00364"></a>00364 output.reserve(size);
|
380
|
+
<a name="l00365"></a>00365 remaining = size;
|
381
|
+
<a name="l00366"></a>00366 <span class="keywordflow">while</span> (remaining > 0) {
|
382
|
+
<a name="l00367"></a>00367 <span class="keywordtype">char</span> buf[1024 * 32];
|
383
|
+
<a name="l00368"></a>00368 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> blockSize = min((<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) <span class="keyword">sizeof</span>(buf), remaining);
|
384
|
+
<a name="l00369"></a>00369
|
385
|
+
<a name="l00370"></a>00370 <span class="keywordflow">if</span> (!<a class="code" href="classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479" title="Read exactly size bytes of data from the underlying file descriptor, and put the...">readRaw</a>(buf, blockSize)) {
|
386
|
+
<a name="l00371"></a>00371 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
387
|
+
<a name="l00372"></a>00372 }
|
388
|
+
<a name="l00373"></a>00373 output.append(buf, blockSize);
|
389
|
+
<a name="l00374"></a>00374 remaining -= blockSize;
|
390
|
+
<a name="l00375"></a>00375 }
|
391
|
+
<a name="l00376"></a>00376 <span class="keywordflow">return</span> <span class="keyword">true</span>;
|
392
|
+
<a name="l00377"></a>00377 }
|
393
|
+
<a name="l00378"></a>00378 <span class="comment"></span>
|
394
|
+
<a name="l00379"></a>00379 <span class="comment"> /**</span>
|
395
|
+
<a name="l00380"></a>00380 <span class="comment"> * Read exactly <tt>size</tt> bytes of data from the underlying file descriptor,</span>
|
396
|
+
<a name="l00381"></a>00381 <span class="comment"> * and put the result in <tt>buf</tt>. If end-of-file has been reached, or if</span>
|
397
|
+
<a name="l00382"></a>00382 <span class="comment"> * end-of-file was encountered before <tt>size</tt> bytes have been read, then</span>
|
398
|
+
<a name="l00383"></a>00383 <span class="comment"> * <tt>false</tt> will be returned. Otherwise (i.e. if the read was successful),</span>
|
399
|
+
<a name="l00384"></a>00384 <span class="comment"> * <tt>true</tt> will be returned.</span>
|
400
|
+
<a name="l00385"></a>00385 <span class="comment"> *</span>
|
401
|
+
<a name="l00386"></a>00386 <span class="comment"> * @param buf The buffer to place the read data in. This buffer must be at least</span>
|
402
|
+
<a name="l00387"></a>00387 <span class="comment"> * <tt>size</tt> bytes long.</span>
|
403
|
+
<a name="l00388"></a>00388 <span class="comment"> * @param size The number of bytes to read.</span>
|
404
|
+
<a name="l00389"></a>00389 <span class="comment"> * @return Whether reading was successful or whether EOF was reached.</span>
|
405
|
+
<a name="l00390"></a>00390 <span class="comment"> * @pre buf != NULL</span>
|
406
|
+
<a name="l00391"></a>00391 <span class="comment"> * @throws SystemException Something went wrong during reading.</span>
|
407
|
+
<a name="l00392"></a>00392 <span class="comment"> * @see writeRaw()</span>
|
408
|
+
<a name="l00393"></a>00393 <span class="comment"> */</span>
|
409
|
+
<a name="l00394"></a><a class="code" href="classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479">00394</a> <span class="keywordtype">bool</span> <a class="code" href="classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479" title="Read exactly size bytes of data from the underlying file descriptor, and put the...">readRaw</a>(<span class="keywordtype">void</span> *buf, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size) {
|
410
|
+
<a name="l00395"></a>00395 ssize_t ret;
|
411
|
+
<a name="l00396"></a>00396 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> alreadyRead = 0;
|
412
|
+
<a name="l00397"></a>00397
|
413
|
+
<a name="l00398"></a>00398 <span class="keywordflow">while</span> (alreadyRead < size) {
|
414
|
+
<a name="l00399"></a>00399 <span class="keywordflow">do</span> {
|
415
|
+
<a name="l00400"></a>00400 ret =<a class="code" href="classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e" title="Read an array message from the underlying file descriptor."> ::read</a>(fd, (<span class="keywordtype">char</span> *) buf + alreadyRead, size - alreadyRead);
|
416
|
+
<a name="l00401"></a>00401 } <span class="keywordflow">while</span> (ret == -1 && errno == EINTR);
|
417
|
+
<a name="l00402"></a>00402 <span class="keywordflow">if</span> (ret == -1) {
|
418
|
+
<a name="l00403"></a>00403 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a>(<span class="stringliteral">"read() failed"</span>, errno);
|
419
|
+
<a name="l00404"></a>00404 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ret == 0) {
|
420
|
+
<a name="l00405"></a>00405 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
421
|
+
<a name="l00406"></a>00406 } <span class="keywordflow">else</span> {
|
422
|
+
<a name="l00407"></a>00407 alreadyRead += ret;
|
423
|
+
<a name="l00408"></a>00408 }
|
424
|
+
<a name="l00409"></a>00409 }
|
425
|
+
<a name="l00410"></a>00410 <span class="keywordflow">return</span> <span class="keyword">true</span>;
|
426
|
+
<a name="l00411"></a>00411 }
|
427
|
+
<a name="l00412"></a>00412 <span class="comment"></span>
|
428
|
+
<a name="l00413"></a>00413 <span class="comment"> /**</span>
|
429
|
+
<a name="l00414"></a>00414 <span class="comment"> * Receive a file descriptor, which had been passed over the underlying</span>
|
430
|
+
<a name="l00415"></a>00415 <span class="comment"> * file descriptor.</span>
|
431
|
+
<a name="l00416"></a>00416 <span class="comment"> *</span>
|
432
|
+
<a name="l00417"></a>00417 <span class="comment"> * @return The passed file descriptor.</span>
|
433
|
+
<a name="l00418"></a>00418 <span class="comment"> * @throws SystemException If something went wrong during the</span>
|
434
|
+
<a name="l00419"></a>00419 <span class="comment"> * receiving of a file descriptor. Perhaps the underlying</span>
|
435
|
+
<a name="l00420"></a>00420 <span class="comment"> * file descriptor isn't a Unix socket.</span>
|
436
|
+
<a name="l00421"></a>00421 <span class="comment"> * @throws IOException Whatever was received doesn't seem to be a</span>
|
437
|
+
<a name="l00422"></a>00422 <span class="comment"> * file descriptor.</span>
|
438
|
+
<a name="l00423"></a>00423 <span class="comment"> */</span>
|
439
|
+
<a name="l00424"></a><a class="code" href="classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488">00424</a> <span class="keywordtype">int</span> <a class="code" href="classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488" title="Receive a file descriptor, which had been passed over the underlying file descriptor...">readFileDescriptor</a>() {
|
440
|
+
<a name="l00425"></a>00425 <span class="keyword">struct </span>{
|
441
|
+
<a name="l00426"></a>00426 <span class="keyword">struct </span>cmsghdr header;
|
442
|
+
<a name="l00427"></a>00427 <span class="keywordtype">int</span> fd;
|
443
|
+
<a name="l00428"></a>00428 } control;
|
444
|
+
<a name="l00429"></a>00429
|
445
|
+
<a name="l00430"></a>00430 control.header.cmsg_len = <span class="keyword">sizeof</span>(control);
|
446
|
+
<a name="l00431"></a>00431 control.header.cmsg_level = SOL_SOCKET;
|
447
|
+
<a name="l00432"></a>00432 control.header.cmsg_type = SCM_RIGHTS;
|
448
|
+
<a name="l00433"></a>00433 control.fd = -1;
|
449
|
+
<a name="l00434"></a>00434
|
450
|
+
<a name="l00435"></a>00435 <span class="keyword">struct </span>msghdr msg;
|
451
|
+
<a name="l00436"></a>00436 <span class="keyword">struct </span>iovec vec;
|
452
|
+
<a name="l00437"></a>00437 <span class="keywordtype">char</span> dummy[1];
|
453
453
|
<a name="l00438"></a>00438
|
454
|
-
<a name="l00439"></a>00439 msg.
|
455
|
-
<a name="l00440"></a>00440 msg.
|
456
|
-
<a name="l00441"></a>00441
|
457
|
-
<a name="l00442"></a>00442
|
458
|
-
<a name="l00443"></a>00443
|
459
|
-
<a name="l00444"></a>00444
|
460
|
-
<a name="l00445"></a>00445
|
461
|
-
<a name="l00446"></a>00446
|
462
|
-
<a name="l00447"></a>00447
|
463
|
-
<a name="l00448"></a>00448
|
464
|
-
<a name="l00449"></a>00449
|
465
|
-
<a name="l00450"></a>00450
|
466
|
-
<a name="l00451"></a>00451
|
467
|
-
<a name="l00452"></a>00452
|
468
|
-
<a name="l00453"></a>00453
|
469
|
-
<a name="l00454"></a>00454
|
470
|
-
<a name="l00455"></a>00455
|
471
|
-
<a name="l00456"></a>00456
|
472
|
-
<a name="l00457"></a>00457
|
473
|
-
<a name="l00458"></a>00458
|
474
|
-
<a name="l00459"></a>00459
|
475
|
-
<a name="l00460"></a>00460
|
476
|
-
<a name="l00461"></a>00461
|
477
|
-
<a name="l00462"></a>00462
|
478
|
-
<a name="l00463"></a>00463
|
479
|
-
|
454
|
+
<a name="l00439"></a>00439 msg.msg_name = NULL;
|
455
|
+
<a name="l00440"></a>00440 msg.msg_namelen = 0;
|
456
|
+
<a name="l00441"></a>00441
|
457
|
+
<a name="l00442"></a>00442 dummy[0] = <span class="charliteral">'\0'</span>;
|
458
|
+
<a name="l00443"></a>00443 vec.iov_base = dummy;
|
459
|
+
<a name="l00444"></a>00444 vec.iov_len = <span class="keyword">sizeof</span>(dummy);
|
460
|
+
<a name="l00445"></a>00445 msg.msg_iov = &vec;
|
461
|
+
<a name="l00446"></a>00446 msg.msg_iovlen = 1;
|
462
|
+
<a name="l00447"></a>00447
|
463
|
+
<a name="l00448"></a>00448 msg.msg_control = (caddr_t) &control;
|
464
|
+
<a name="l00449"></a>00449 msg.msg_controllen = <span class="keyword">sizeof</span>(control);
|
465
|
+
<a name="l00450"></a>00450 msg.msg_flags = 0;
|
466
|
+
<a name="l00451"></a>00451
|
467
|
+
<a name="l00452"></a>00452 <span class="keywordflow">if</span> (recvmsg(fd, &msg, 0) == -1) {
|
468
|
+
<a name="l00453"></a>00453 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a>(<span class="stringliteral">"Cannot read file descriptor with recvmsg()"</span>, errno);
|
469
|
+
<a name="l00454"></a>00454 }
|
470
|
+
<a name="l00455"></a>00455
|
471
|
+
<a name="l00456"></a>00456 <span class="keywordflow">if</span> (msg.msg_controllen != <span class="keyword">sizeof</span>(control)
|
472
|
+
<a name="l00457"></a>00457 || control.header.cmsg_len != <span class="keyword">sizeof</span>(control)
|
473
|
+
<a name="l00458"></a>00458 || control.header.cmsg_level != SOL_SOCKET
|
474
|
+
<a name="l00459"></a>00459 || control.header.cmsg_type != SCM_RIGHTS) {
|
475
|
+
<a name="l00460"></a>00460 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a>(<span class="stringliteral">"No valid file descriptor received."</span>);
|
476
|
+
<a name="l00461"></a>00461 }
|
477
|
+
<a name="l00462"></a>00462 <span class="keywordflow">return</span> control.fd;
|
478
|
+
<a name="l00463"></a>00463 }
|
479
|
+
<a name="l00464"></a>00464 };
|
480
|
+
<a name="l00465"></a>00465
|
481
|
+
<a name="l00466"></a>00466 } <span class="comment">// namespace Passenger</span>
|
482
|
+
<a name="l00467"></a>00467
|
483
|
+
<a name="l00468"></a>00468 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_MESSAGE_CHANNEL_H_ */</span>
|
484
|
+
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Tue Apr 29 15:25:32 2008 for Passenger by
|
480
485
|
<a href="http://www.doxygen.org/index.html">
|
481
486
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
|
482
487
|
</body>
|