passenger 1.0.4 → 1.0.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/Rakefile +7 -4
- data/bin/passenger-install-apache2-module +3 -1
- data/doc/Users guide.html +1 -1
- data/doc/cxxapi/ApplicationPoolClientServer_8h-source.html +1 -1
- data/doc/cxxapi/ApplicationPoolServer_8h-source.html +497 -496
- 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 +224 -198
- 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 +1 -1
- data/doc/cxxapi/classClient.html +1 -1
- 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 +1 -1
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +1 -1
- 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__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/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/request_handler_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/spawn_manager_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/utils_rb.html +1 -1
- data/ext/apache2/Configuration.h +1 -1
- data/ext/apache2/MessageChannel.h +37 -11
- data/ext/passenger/native_support.c +36 -10
- data/lib/passenger/templates/app_exited_during_initialization.html.erb +3 -2
- data/lib/passenger/templates/welcome.txt.erb +1 -1
- data/misc/render_error_pages.rb +3 -0
- data/test/stub/{mycook → rails_apps/mycook}/config/environments/test.rb +0 -0
- metadata +12 -14
- data/test/stub/apache2/httpd.conf +0 -75
- data/test/stub/railsapp-without-version-spec/config/environments/test.rb +0 -22
@@ -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 Wed May 7 20:28:18 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 Wed May 7 20:28:18 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.5"</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 Wed May 7 20:28:18 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 Wed May 7 20:28:18 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 Wed May 7 20:28:18 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 Wed May 7 20:28:18 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 Wed May 7 20:28:18 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>
|
@@ -274,205 +274,231 @@
|
|
274
274
|
<a name="l00259"></a>00259 <span class="keyword">struct </span>msghdr msg;
|
275
275
|
<a name="l00260"></a>00260 <span class="keyword">struct </span>iovec vec;
|
276
276
|
<a name="l00261"></a>00261 <span class="keywordtype">char</span> dummy[1];
|
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
|
286
|
-
<a name="l00271"></a>00271
|
287
|
-
<a name="l00272"></a>00272 msg.
|
288
|
-
<a name="l00273"></a>00273 msg.
|
277
|
+
<a name="l00262"></a>00262 <span class="preprocessor"> #ifdef __APPLE__</span>
|
278
|
+
<a name="l00263"></a>00263 <span class="preprocessor"></span> <span class="keyword">struct </span>{
|
279
|
+
<a name="l00264"></a>00264 <span class="keyword">struct </span>cmsghdr header;
|
280
|
+
<a name="l00265"></a>00265 <span class="keywordtype">int</span> fd;
|
281
|
+
<a name="l00266"></a>00266 } control_data;
|
282
|
+
<a name="l00267"></a>00267 <span class="preprocessor"> #else</span>
|
283
|
+
<a name="l00268"></a>00268 <span class="preprocessor"></span> <span class="keywordtype">char</span> control_data[CMSG_SPACE(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>))];
|
284
|
+
<a name="l00269"></a>00269 <span class="preprocessor"> #endif</span>
|
285
|
+
<a name="l00270"></a>00270 <span class="preprocessor"></span> <span class="keyword">struct </span>cmsghdr *control_header;
|
286
|
+
<a name="l00271"></a>00271
|
287
|
+
<a name="l00272"></a>00272 msg.msg_name = NULL;
|
288
|
+
<a name="l00273"></a>00273 msg.msg_namelen = 0;
|
289
289
|
<a name="l00274"></a>00274
|
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 <span class="
|
306
|
-
<a name="l00291"></a>00291
|
307
|
-
<a name="l00292"></a>00292 <span class="
|
308
|
-
<a name="l00293"></a>00293 <span class="
|
309
|
-
<a name="l00294"></a>00294 <span class="
|
310
|
-
<a name="l00295"></a>00295 <span class="
|
311
|
-
<a name="l00296"></a>00296 <span class="
|
312
|
-
<a name="l00297"></a>00297
|
313
|
-
<a name="l00298"></a>00298 <span class="
|
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
|
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
|
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
|
335
|
-
<a name="l00320"></a>00320
|
336
|
-
<a name="l00321"></a>00321
|
337
|
-
<a name="l00322"></a>00322 <span class="keywordflow">
|
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
|
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 <span class="keywordflow">while</span> (
|
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
|
362
|
-
<a name="l00347"></a>00347
|
363
|
-
<a name="l00348"></a>00348
|
364
|
-
<a name="l00349"></a>00349
|
365
|
-
<a name="l00350"></a>00350
|
366
|
-
<a name="l00351"></a>00351
|
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
|
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
|
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
|
395
|
-
<a name="l00380"></a>00380
|
396
|
-
<a name="l00381"></a>00381 <span class="
|
397
|
-
<a name="l00382"></a>00382
|
398
|
-
<a name="l00383"></a>00383
|
399
|
-
<a name="l00384"></a>00384
|
400
|
-
<a name="l00385"></a>00385
|
401
|
-
<a name="l00386"></a>00386
|
402
|
-
<a name="l00387"></a>00387
|
403
|
-
<a name="l00388"></a>00388
|
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
|
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
|
419
|
-
<a name="l00404"></a>00404
|
420
|
-
<a name="l00405"></a>00405
|
421
|
-
<a name="l00406"></a>00406
|
422
|
-
<a name="l00407"></a>00407
|
423
|
-
<a name="l00408"></a>00408 <span class="keywordflow">
|
424
|
-
<a name="l00409"></a>00409
|
425
|
-
<a name="l00410"></a>00410
|
426
|
-
<a name="l00411"></a>00411 <span class="
|
427
|
-
<a name="l00412"></a>00412
|
428
|
-
<a name="l00413"></a>00413
|
429
|
-
<a name="l00414"></a>00414 <span class="
|
430
|
-
<a name="l00415"></a>00415
|
431
|
-
<a name="l00416"></a>00416 <span class="
|
432
|
-
<a name="l00417"></a>00417
|
433
|
-
<a name="l00418"></a>00418
|
434
|
-
<a name="l00419"></a>00419
|
435
|
-
<a name="l00420"></a>00420
|
436
|
-
<a name="l00421"></a>00421
|
437
|
-
<a name="l00422"></a
|
438
|
-
<a name="l00423"></a>00423
|
439
|
-
<a name="l00424"></a>00424
|
440
|
-
<a name="l00425"></a>00425
|
441
|
-
<a name="l00426"></a>00426
|
442
|
-
<a name="l00427"></a>00427
|
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
|
453
|
-
<a name="l00438"></a>00438
|
454
|
-
<a name="l00439"></a>00439
|
455
|
-
<a name="l00440"></a>00440
|
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
|
-
|
290
|
+
<a name="l00275"></a>00275 <span class="comment">/* Linux and Solaris require msg_iov to be non-NULL. */</span>
|
291
|
+
<a name="l00276"></a>00276 dummy[0] = <span class="charliteral">'\0'</span>;
|
292
|
+
<a name="l00277"></a>00277 vec.iov_base = dummy;
|
293
|
+
<a name="l00278"></a>00278 vec.iov_len = <span class="keyword">sizeof</span>(dummy);
|
294
|
+
<a name="l00279"></a>00279 msg.msg_iov = &vec;
|
295
|
+
<a name="l00280"></a>00280 msg.msg_iovlen = 1;
|
296
|
+
<a name="l00281"></a>00281
|
297
|
+
<a name="l00282"></a>00282 msg.msg_control = (caddr_t) &control_data;
|
298
|
+
<a name="l00283"></a>00283 msg.msg_controllen = <span class="keyword">sizeof</span>(control_data);
|
299
|
+
<a name="l00284"></a>00284 msg.msg_flags = 0;
|
300
|
+
<a name="l00285"></a>00285
|
301
|
+
<a name="l00286"></a>00286 control_header = CMSG_FIRSTHDR(&msg);
|
302
|
+
<a name="l00287"></a>00287 control_header->cmsg_level = SOL_SOCKET;
|
303
|
+
<a name="l00288"></a>00288 control_header->cmsg_type = SCM_RIGHTS;
|
304
|
+
<a name="l00289"></a>00289 <span class="preprocessor"> #ifdef __APPLE__</span>
|
305
|
+
<a name="l00290"></a>00290 <span class="preprocessor"></span> control_header->cmsg_len = <span class="keyword">sizeof</span>(control_data);
|
306
|
+
<a name="l00291"></a>00291 control_data.fd = fileDescriptor;
|
307
|
+
<a name="l00292"></a>00292 <span class="preprocessor"> #else</span>
|
308
|
+
<a name="l00293"></a>00293 <span class="preprocessor"></span> control_header->cmsg_len = CMSG_LEN(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
|
309
|
+
<a name="l00294"></a>00294 memcpy(CMSG_DATA(control_header), &fileDescriptor, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
|
310
|
+
<a name="l00295"></a>00295 <span class="preprocessor"> #endif</span>
|
311
|
+
<a name="l00296"></a>00296 <span class="preprocessor"></span>
|
312
|
+
<a name="l00297"></a>00297 <span class="keywordflow">if</span> (sendmsg(fd, &msg, 0) == -1) {
|
313
|
+
<a name="l00298"></a>00298 <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);
|
314
|
+
<a name="l00299"></a>00299 }
|
315
|
+
<a name="l00300"></a>00300 }
|
316
|
+
<a name="l00301"></a>00301 <span class="comment"></span>
|
317
|
+
<a name="l00302"></a>00302 <span class="comment"> /**</span>
|
318
|
+
<a name="l00303"></a>00303 <span class="comment"> * Read an array message from the underlying file descriptor.</span>
|
319
|
+
<a name="l00304"></a>00304 <span class="comment"> *</span>
|
320
|
+
<a name="l00305"></a>00305 <span class="comment"> * @param args The message will be put in this variable.</span>
|
321
|
+
<a name="l00306"></a>00306 <span class="comment"> * @return Whether end-of-file has been reached. If so, then the contents</span>
|
322
|
+
<a name="l00307"></a>00307 <span class="comment"> * of <tt>args</tt> will be undefined.</span>
|
323
|
+
<a name="l00308"></a>00308 <span class="comment"> * @throws SystemException If an error occured while receiving the message.</span>
|
324
|
+
<a name="l00309"></a>00309 <span class="comment"> * @see write()</span>
|
325
|
+
<a name="l00310"></a>00310 <span class="comment"> */</span>
|
326
|
+
<a name="l00311"></a><a class="code" href="classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e">00311</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) {
|
327
|
+
<a name="l00312"></a>00312 uint16_t size;
|
328
|
+
<a name="l00313"></a>00313 <span class="keywordtype">int</span> ret;
|
329
|
+
<a name="l00314"></a>00314 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> alreadyRead = 0;
|
330
|
+
<a name="l00315"></a>00315
|
331
|
+
<a name="l00316"></a>00316 <span class="keywordflow">do</span> {
|
332
|
+
<a name="l00317"></a>00317 <span class="keywordflow">do</span> {
|
333
|
+
<a name="l00318"></a>00318 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);
|
334
|
+
<a name="l00319"></a>00319 } <span class="keywordflow">while</span> (ret == -1 && errno == EINTR);
|
335
|
+
<a name="l00320"></a>00320 <span class="keywordflow">if</span> (ret == -1) {
|
336
|
+
<a name="l00321"></a>00321 <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);
|
337
|
+
<a name="l00322"></a>00322 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ret == 0) {
|
338
|
+
<a name="l00323"></a>00323 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
339
|
+
<a name="l00324"></a>00324 }
|
340
|
+
<a name="l00325"></a>00325 alreadyRead += ret;
|
341
|
+
<a name="l00326"></a>00326 } <span class="keywordflow">while</span> (alreadyRead < <span class="keyword">sizeof</span>(size));
|
342
|
+
<a name="l00327"></a>00327 size = ntohs(size);
|
343
|
+
<a name="l00328"></a>00328
|
344
|
+
<a name="l00329"></a>00329 <span class="keywordtype">string</span> buffer;
|
345
|
+
<a name="l00330"></a>00330 args.clear();
|
346
|
+
<a name="l00331"></a>00331 buffer.reserve(size);
|
347
|
+
<a name="l00332"></a>00332 <span class="keywordflow">while</span> (buffer.size() < size) {
|
348
|
+
<a name="l00333"></a>00333 <span class="keywordtype">char</span> tmp[1024 * 8];
|
349
|
+
<a name="l00334"></a>00334 <span class="keywordflow">do</span> {
|
350
|
+
<a name="l00335"></a>00335 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)));
|
351
|
+
<a name="l00336"></a>00336 } <span class="keywordflow">while</span> (ret == -1 && errno == EINTR);
|
352
|
+
<a name="l00337"></a>00337 <span class="keywordflow">if</span> (ret == -1) {
|
353
|
+
<a name="l00338"></a>00338 <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);
|
354
|
+
<a name="l00339"></a>00339 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ret == 0) {
|
355
|
+
<a name="l00340"></a>00340 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
356
|
+
<a name="l00341"></a>00341 }
|
357
|
+
<a name="l00342"></a>00342 buffer.append(tmp, ret);
|
358
|
+
<a name="l00343"></a>00343 }
|
359
|
+
<a name="l00344"></a>00344
|
360
|
+
<a name="l00345"></a>00345 <span class="keywordflow">if</span> (!buffer.empty()) {
|
361
|
+
<a name="l00346"></a>00346 string::size_type start = 0, pos;
|
362
|
+
<a name="l00347"></a>00347 <span class="keyword">const</span> <span class="keywordtype">string</span> &const_buffer(buffer);
|
363
|
+
<a name="l00348"></a>00348 <span class="keywordflow">while</span> ((pos = const_buffer.find(<span class="charliteral">'\0'</span>, start)) != string::npos) {
|
364
|
+
<a name="l00349"></a>00349 args.push_back(const_buffer.substr(start, pos - start));
|
365
|
+
<a name="l00350"></a>00350 start = pos + 1;
|
366
|
+
<a name="l00351"></a>00351 }
|
367
|
+
<a name="l00352"></a>00352 }
|
368
|
+
<a name="l00353"></a>00353 <span class="keywordflow">return</span> <span class="keyword">true</span>;
|
369
|
+
<a name="l00354"></a>00354 }
|
370
|
+
<a name="l00355"></a>00355 <span class="comment"></span>
|
371
|
+
<a name="l00356"></a>00356 <span class="comment"> /**</span>
|
372
|
+
<a name="l00357"></a>00357 <span class="comment"> * Read a scalar message from the underlying file descriptor.</span>
|
373
|
+
<a name="l00358"></a>00358 <span class="comment"> *</span>
|
374
|
+
<a name="l00359"></a>00359 <span class="comment"> * @param output The message will be put in here.</span>
|
375
|
+
<a name="l00360"></a>00360 <span class="comment"> * @returns Whether end-of-file was reached during reading.</span>
|
376
|
+
<a name="l00361"></a>00361 <span class="comment"> * @throws SystemException An error occured while writing the data to the file descriptor.</span>
|
377
|
+
<a name="l00362"></a>00362 <span class="comment"> * @see writeScalar()</span>
|
378
|
+
<a name="l00363"></a>00363 <span class="comment"> */</span>
|
379
|
+
<a name="l00364"></a><a class="code" href="classPassenger_1_1MessageChannel.html#4ce6a0e751b5e3563bee583c231569bc">00364</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) {
|
380
|
+
<a name="l00365"></a>00365 uint32_t size;
|
381
|
+
<a name="l00366"></a>00366 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> remaining;
|
382
|
+
<a name="l00367"></a>00367
|
383
|
+
<a name="l00368"></a>00368 <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))) {
|
384
|
+
<a name="l00369"></a>00369 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
385
|
+
<a name="l00370"></a>00370 }
|
386
|
+
<a name="l00371"></a>00371 size = ntohl(size);
|
387
|
+
<a name="l00372"></a>00372
|
388
|
+
<a name="l00373"></a>00373 output.clear();
|
389
|
+
<a name="l00374"></a>00374 output.reserve(size);
|
390
|
+
<a name="l00375"></a>00375 remaining = size;
|
391
|
+
<a name="l00376"></a>00376 <span class="keywordflow">while</span> (remaining > 0) {
|
392
|
+
<a name="l00377"></a>00377 <span class="keywordtype">char</span> buf[1024 * 32];
|
393
|
+
<a name="l00378"></a>00378 <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);
|
394
|
+
<a name="l00379"></a>00379
|
395
|
+
<a name="l00380"></a>00380 <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)) {
|
396
|
+
<a name="l00381"></a>00381 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
397
|
+
<a name="l00382"></a>00382 }
|
398
|
+
<a name="l00383"></a>00383 output.append(buf, blockSize);
|
399
|
+
<a name="l00384"></a>00384 remaining -= blockSize;
|
400
|
+
<a name="l00385"></a>00385 }
|
401
|
+
<a name="l00386"></a>00386 <span class="keywordflow">return</span> <span class="keyword">true</span>;
|
402
|
+
<a name="l00387"></a>00387 }
|
403
|
+
<a name="l00388"></a>00388 <span class="comment"></span>
|
404
|
+
<a name="l00389"></a>00389 <span class="comment"> /**</span>
|
405
|
+
<a name="l00390"></a>00390 <span class="comment"> * Read exactly <tt>size</tt> bytes of data from the underlying file descriptor,</span>
|
406
|
+
<a name="l00391"></a>00391 <span class="comment"> * and put the result in <tt>buf</tt>. If end-of-file has been reached, or if</span>
|
407
|
+
<a name="l00392"></a>00392 <span class="comment"> * end-of-file was encountered before <tt>size</tt> bytes have been read, then</span>
|
408
|
+
<a name="l00393"></a>00393 <span class="comment"> * <tt>false</tt> will be returned. Otherwise (i.e. if the read was successful),</span>
|
409
|
+
<a name="l00394"></a>00394 <span class="comment"> * <tt>true</tt> will be returned.</span>
|
410
|
+
<a name="l00395"></a>00395 <span class="comment"> *</span>
|
411
|
+
<a name="l00396"></a>00396 <span class="comment"> * @param buf The buffer to place the read data in. This buffer must be at least</span>
|
412
|
+
<a name="l00397"></a>00397 <span class="comment"> * <tt>size</tt> bytes long.</span>
|
413
|
+
<a name="l00398"></a>00398 <span class="comment"> * @param size The number of bytes to read.</span>
|
414
|
+
<a name="l00399"></a>00399 <span class="comment"> * @return Whether reading was successful or whether EOF was reached.</span>
|
415
|
+
<a name="l00400"></a>00400 <span class="comment"> * @pre buf != NULL</span>
|
416
|
+
<a name="l00401"></a>00401 <span class="comment"> * @throws SystemException Something went wrong during reading.</span>
|
417
|
+
<a name="l00402"></a>00402 <span class="comment"> * @see writeRaw()</span>
|
418
|
+
<a name="l00403"></a>00403 <span class="comment"> */</span>
|
419
|
+
<a name="l00404"></a><a class="code" href="classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479">00404</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) {
|
420
|
+
<a name="l00405"></a>00405 ssize_t ret;
|
421
|
+
<a name="l00406"></a>00406 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> alreadyRead = 0;
|
422
|
+
<a name="l00407"></a>00407
|
423
|
+
<a name="l00408"></a>00408 <span class="keywordflow">while</span> (alreadyRead < size) {
|
424
|
+
<a name="l00409"></a>00409 <span class="keywordflow">do</span> {
|
425
|
+
<a name="l00410"></a>00410 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);
|
426
|
+
<a name="l00411"></a>00411 } <span class="keywordflow">while</span> (ret == -1 && errno == EINTR);
|
427
|
+
<a name="l00412"></a>00412 <span class="keywordflow">if</span> (ret == -1) {
|
428
|
+
<a name="l00413"></a>00413 <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);
|
429
|
+
<a name="l00414"></a>00414 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ret == 0) {
|
430
|
+
<a name="l00415"></a>00415 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
431
|
+
<a name="l00416"></a>00416 } <span class="keywordflow">else</span> {
|
432
|
+
<a name="l00417"></a>00417 alreadyRead += ret;
|
433
|
+
<a name="l00418"></a>00418 }
|
434
|
+
<a name="l00419"></a>00419 }
|
435
|
+
<a name="l00420"></a>00420 <span class="keywordflow">return</span> <span class="keyword">true</span>;
|
436
|
+
<a name="l00421"></a>00421 }
|
437
|
+
<a name="l00422"></a>00422 <span class="comment"></span>
|
438
|
+
<a name="l00423"></a>00423 <span class="comment"> /**</span>
|
439
|
+
<a name="l00424"></a>00424 <span class="comment"> * Receive a file descriptor, which had been passed over the underlying</span>
|
440
|
+
<a name="l00425"></a>00425 <span class="comment"> * file descriptor.</span>
|
441
|
+
<a name="l00426"></a>00426 <span class="comment"> *</span>
|
442
|
+
<a name="l00427"></a>00427 <span class="comment"> * @return The passed file descriptor.</span>
|
443
|
+
<a name="l00428"></a>00428 <span class="comment"> * @throws SystemException If something went wrong during the</span>
|
444
|
+
<a name="l00429"></a>00429 <span class="comment"> * receiving of a file descriptor. Perhaps the underlying</span>
|
445
|
+
<a name="l00430"></a>00430 <span class="comment"> * file descriptor isn't a Unix socket.</span>
|
446
|
+
<a name="l00431"></a>00431 <span class="comment"> * @throws IOException Whatever was received doesn't seem to be a</span>
|
447
|
+
<a name="l00432"></a>00432 <span class="comment"> * file descriptor.</span>
|
448
|
+
<a name="l00433"></a>00433 <span class="comment"> */</span>
|
449
|
+
<a name="l00434"></a><a class="code" href="classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488">00434</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>() {
|
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
|
+
<a name="l00438"></a>00438 <span class="preprocessor"> #ifdef __APPLE__</span>
|
454
|
+
<a name="l00439"></a>00439 <span class="preprocessor"></span> <span class="comment">// File descriptor passing macros (CMSG_*) seem to be broken</span>
|
455
|
+
<a name="l00440"></a>00440 <span class="comment">// on 64-bit MacOS X. This structure works around the problem.</span>
|
456
|
+
<a name="l00441"></a>00441 <span class="keyword">struct </span>{
|
457
|
+
<a name="l00442"></a>00442 <span class="keyword">struct </span>cmsghdr header;
|
458
|
+
<a name="l00443"></a>00443 <span class="keywordtype">int</span> fd;
|
459
|
+
<a name="l00444"></a>00444 } control_data;
|
460
|
+
<a name="l00445"></a>00445 <span class="preprocessor"> #define EXPECTED_CMSG_LEN sizeof(control_data)</span>
|
461
|
+
<a name="l00446"></a>00446 <span class="preprocessor"></span><span class="preprocessor"> #else</span>
|
462
|
+
<a name="l00447"></a>00447 <span class="preprocessor"></span> <span class="keywordtype">char</span> control_data[CMSG_SPACE(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>))];
|
463
|
+
<a name="l00448"></a>00448 <span class="preprocessor"> #define EXPECTED_CMSG_LEN CMSG_LEN(sizeof(int))</span>
|
464
|
+
<a name="l00449"></a>00449 <span class="preprocessor"></span><span class="preprocessor"> #endif</span>
|
465
|
+
<a name="l00450"></a>00450 <span class="preprocessor"></span> <span class="keyword">struct </span>cmsghdr *control_header;
|
466
|
+
<a name="l00451"></a>00451
|
467
|
+
<a name="l00452"></a>00452 msg.msg_name = NULL;
|
468
|
+
<a name="l00453"></a>00453 msg.msg_namelen = 0;
|
469
|
+
<a name="l00454"></a>00454
|
470
|
+
<a name="l00455"></a>00455 dummy[0] = <span class="charliteral">'\0'</span>;
|
471
|
+
<a name="l00456"></a>00456 vec.iov_base = dummy;
|
472
|
+
<a name="l00457"></a>00457 vec.iov_len = <span class="keyword">sizeof</span>(dummy);
|
473
|
+
<a name="l00458"></a>00458 msg.msg_iov = &vec;
|
474
|
+
<a name="l00459"></a>00459 msg.msg_iovlen = 1;
|
475
|
+
<a name="l00460"></a>00460
|
476
|
+
<a name="l00461"></a>00461 msg.msg_control = (caddr_t) &control_data;
|
477
|
+
<a name="l00462"></a>00462 msg.msg_controllen = <span class="keyword">sizeof</span>(control_data);
|
478
|
+
<a name="l00463"></a>00463 msg.msg_flags = 0;
|
479
|
+
<a name="l00464"></a>00464
|
480
|
+
<a name="l00465"></a>00465 <span class="keywordflow">if</span> (recvmsg(fd, &msg, 0) == -1) {
|
481
|
+
<a name="l00466"></a>00466 <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);
|
482
|
+
<a name="l00467"></a>00467 }
|
483
|
+
<a name="l00468"></a>00468
|
484
|
+
<a name="l00469"></a>00469 control_header = CMSG_FIRSTHDR(&msg);
|
485
|
+
<a name="l00470"></a>00470 <span class="keywordflow">if</span> (control_header->cmsg_len != EXPECTED_CMSG_LEN
|
486
|
+
<a name="l00471"></a>00471 || control_header->cmsg_level != SOL_SOCKET
|
487
|
+
<a name="l00472"></a>00472 || control_header->cmsg_type != SCM_RIGHTS) {
|
488
|
+
<a name="l00473"></a>00473 <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>);
|
489
|
+
<a name="l00474"></a>00474 }
|
490
|
+
<a name="l00475"></a>00475 <span class="preprocessor"> #ifdef __APPLE__</span>
|
491
|
+
<a name="l00476"></a>00476 <span class="preprocessor"></span> <span class="keywordflow">return</span> control_data.fd;
|
492
|
+
<a name="l00477"></a>00477 <span class="preprocessor"> #else</span>
|
493
|
+
<a name="l00478"></a>00478 <span class="preprocessor"></span> <span class="keywordflow">return</span> *((<span class="keywordtype">int</span> *) CMSG_DATA(control_header));
|
494
|
+
<a name="l00479"></a>00479 <span class="preprocessor"> #endif</span>
|
495
|
+
<a name="l00480"></a>00480 <span class="preprocessor"></span> }
|
496
|
+
<a name="l00481"></a>00481 };
|
497
|
+
<a name="l00482"></a>00482
|
498
|
+
<a name="l00483"></a>00483 } <span class="comment">// namespace Passenger</span>
|
499
|
+
<a name="l00484"></a>00484
|
500
|
+
<a name="l00485"></a>00485 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_MESSAGE_CHANNEL_H_ */</span>
|
501
|
+
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Wed May 7 20:28:18 2008 for Passenger by
|
476
502
|
<a href="http://www.doxygen.org/index.html">
|
477
503
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
|
478
504
|
</body>
|