passenger 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (538) hide show
  1. data/DEVELOPERS.TXT +9 -6
  2. data/NEWS +50 -0
  3. data/Rakefile +2 -1
  4. data/bin/passenger-install-apache2-module +4 -4
  5. data/bin/passenger-install-nginx-module +1 -1
  6. data/bin/passenger-make-enterprisey +1 -1
  7. data/build/agents.rb +26 -19
  8. data/build/apache2.rb +49 -46
  9. data/build/basics.rb +37 -13
  10. data/build/common_library.rb +134 -64
  11. data/build/config.rb +18 -11
  12. data/build/cplusplus_support.rb +4 -0
  13. data/build/cxx_tests.rb +26 -12
  14. data/build/documentation.rb +18 -11
  15. data/build/integration_tests.rb +18 -11
  16. data/build/misc.rb +18 -11
  17. data/build/nginx.rb +27 -19
  18. data/build/oxt_tests.rb +18 -11
  19. data/build/packaging.rb +45 -37
  20. data/build/rpm.rb +98 -0
  21. data/build/ruby_extension.rb +19 -13
  22. data/build/ruby_tests.rb +19 -12
  23. data/build/test_basics.rb +23 -11
  24. data/debian/README.Debian +15 -0
  25. data/debian/changelog +185 -0
  26. data/debian/control +47 -19
  27. data/debian/copyright +20 -0
  28. data/debian/libapache2-mod-passenger.install +1 -0
  29. data/debian/libapache2-mod-passenger.postinst +36 -0
  30. data/debian/libapache2-mod-passenger.prerm +15 -0
  31. data/debian/passenger-common.install +4 -0
  32. data/debian/passenger.conf +4 -0
  33. data/debian/passenger.load +1 -0
  34. data/debian/rules +37 -0
  35. data/debian/watch +3 -0
  36. data/{misc → dev}/copy_boost_headers.rb +3 -0
  37. data/{misc → dev}/find_owner_pipe_leaks.rb +0 -0
  38. data/{misc → dev}/render_error_pages.rb +0 -0
  39. data/doc/Users guide Apache.html +39 -1
  40. data/doc/Users guide Apache.txt +40 -0
  41. data/doc/Users guide Nginx.html +1 -1
  42. data/doc/Users guide Standalone.html +1 -1
  43. data/doc/cxxapi/Constants_8h_source.html +1 -1
  44. data/doc/cxxapi/DirectoryMapper_8h_source.html +6 -22
  45. data/doc/cxxapi/EventedClient_8h_source.html +572 -468
  46. data/doc/cxxapi/Exceptions_8h_source.html +142 -129
  47. data/doc/cxxapi/FileDescriptor_8h_source.html +263 -199
  48. data/doc/cxxapi/MessageChannel_8h_source.html +686 -770
  49. data/doc/cxxapi/MessageServer_8h_source.html +1 -1
  50. data/doc/cxxapi/PoolOptions_8h_source.html +79 -78
  51. data/doc/cxxapi/ResourceLocator_8h_source.html +105 -55
  52. data/doc/cxxapi/SafeLibev_8h_source.html +180 -0
  53. data/doc/cxxapi/ServerInstanceDir_8h_source.html +114 -110
  54. data/doc/cxxapi/Session_8h_source.html +1 -1
  55. data/doc/cxxapi/SpawnManager_8h_source.html +208 -208
  56. data/doc/cxxapi/StaticString_8h_source.html +258 -183
  57. data/doc/cxxapi/Utils_8h_source.html +71 -54
  58. data/doc/cxxapi/annotated.html +3 -0
  59. data/doc/cxxapi/classAgentWatcher.html +2 -2
  60. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +0 -1
  61. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +0 -27
  62. data/doc/cxxapi/classPassenger_1_1EventedClient-members.html +5 -0
  63. data/doc/cxxapi/classPassenger_1_1EventedClient.html +102 -7
  64. data/doc/cxxapi/classPassenger_1_1FileDescriptor-members.html +2 -1
  65. data/doc/cxxapi/classPassenger_1_1FileDescriptor.html +34 -8
  66. data/doc/cxxapi/classPassenger_1_1FileDescriptorPair-members.html +36 -0
  67. data/doc/cxxapi/classPassenger_1_1FileDescriptorPair.html +52 -0
  68. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +0 -3
  69. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +0 -120
  70. data/doc/cxxapi/classPassenger_1_1SafeLibev-members.html +36 -0
  71. data/doc/cxxapi/classPassenger_1_1SafeLibev.html +51 -0
  72. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +1 -0
  73. data/doc/cxxapi/classPassenger_1_1SpawnException.html +22 -0
  74. data/doc/cxxapi/classes.html +14 -14
  75. data/doc/cxxapi/files.html +2 -0
  76. data/doc/cxxapi/functions_0x63.html +6 -3
  77. data/doc/cxxapi/functions_0x64.html +9 -2
  78. data/doc/cxxapi/functions_0x67.html +6 -9
  79. data/doc/cxxapi/functions_0x69.html +3 -0
  80. data/doc/cxxapi/functions_0x77.html +8 -8
  81. data/doc/cxxapi/functions_eval.html +6 -0
  82. data/doc/cxxapi/functions_func.html +18 -17
  83. data/doc/cxxapi/functions_vars.html +8 -0
  84. data/doc/cxxapi/graph_legend.png +0 -0
  85. data/doc/cxxapi/group__Core.png +0 -0
  86. data/doc/cxxapi/group__Hooks.png +0 -0
  87. data/doc/cxxapi/hierarchy.html +3 -0
  88. data/doc/cxxapi/inherit__graph__14.map +1 -1
  89. data/doc/cxxapi/inherit__graph__14.md5 +1 -1
  90. data/doc/cxxapi/inherit__graph__14.png +0 -0
  91. data/doc/cxxapi/inherit__graph__15.map +1 -3
  92. data/doc/cxxapi/inherit__graph__15.md5 +1 -1
  93. data/doc/cxxapi/inherit__graph__15.png +0 -0
  94. data/doc/cxxapi/inherit__graph__16.map +3 -1
  95. data/doc/cxxapi/inherit__graph__16.md5 +1 -1
  96. data/doc/cxxapi/inherit__graph__16.png +0 -0
  97. data/doc/cxxapi/inherit__graph__17.map +1 -1
  98. data/doc/cxxapi/inherit__graph__17.md5 +1 -1
  99. data/doc/cxxapi/inherit__graph__17.png +0 -0
  100. data/doc/cxxapi/inherit__graph__18.map +1 -2
  101. data/doc/cxxapi/inherit__graph__18.md5 +1 -1
  102. data/doc/cxxapi/inherit__graph__18.png +0 -0
  103. data/doc/cxxapi/inherit__graph__19.map +2 -1
  104. data/doc/cxxapi/inherit__graph__19.md5 +1 -1
  105. data/doc/cxxapi/inherit__graph__19.png +0 -0
  106. data/doc/cxxapi/inherit__graph__20.map +1 -1
  107. data/doc/cxxapi/inherit__graph__20.md5 +1 -1
  108. data/doc/cxxapi/inherit__graph__20.png +0 -0
  109. data/doc/cxxapi/inherit__graph__21.map +1 -1
  110. data/doc/cxxapi/inherit__graph__21.md5 +1 -1
  111. data/doc/cxxapi/inherit__graph__21.png +0 -0
  112. data/doc/cxxapi/inherit__graph__22.map +1 -1
  113. data/doc/cxxapi/inherit__graph__22.md5 +1 -1
  114. data/doc/cxxapi/inherit__graph__22.png +0 -0
  115. data/doc/cxxapi/inherit__graph__23.map +1 -1
  116. data/doc/cxxapi/inherit__graph__23.md5 +1 -1
  117. data/doc/cxxapi/inherit__graph__23.png +0 -0
  118. data/doc/cxxapi/inherit__graph__24.map +1 -1
  119. data/doc/cxxapi/inherit__graph__24.md5 +1 -1
  120. data/doc/cxxapi/inherit__graph__24.png +0 -0
  121. data/doc/cxxapi/inherit__graph__25.map +1 -1
  122. data/doc/cxxapi/inherit__graph__25.md5 +1 -1
  123. data/doc/cxxapi/inherit__graph__25.png +0 -0
  124. data/doc/cxxapi/inherit__graph__26.map +1 -1
  125. data/doc/cxxapi/inherit__graph__26.md5 +1 -1
  126. data/doc/cxxapi/inherit__graph__26.png +0 -0
  127. data/doc/cxxapi/inherit__graph__27.map +1 -1
  128. data/doc/cxxapi/inherit__graph__27.md5 +1 -1
  129. data/doc/cxxapi/inherit__graph__27.png +0 -0
  130. data/doc/cxxapi/inherit__graph__28.map +1 -2
  131. data/doc/cxxapi/inherit__graph__28.md5 +1 -1
  132. data/doc/cxxapi/inherit__graph__28.png +0 -0
  133. data/doc/cxxapi/inherit__graph__29.map +1 -1
  134. data/doc/cxxapi/inherit__graph__29.md5 +1 -1
  135. data/doc/cxxapi/inherit__graph__29.png +0 -0
  136. data/doc/cxxapi/inherit__graph__30.map +1 -1
  137. data/doc/cxxapi/inherit__graph__30.md5 +1 -1
  138. data/doc/cxxapi/inherit__graph__30.png +0 -0
  139. data/doc/cxxapi/inherit__graph__31.map +2 -1
  140. data/doc/cxxapi/inherit__graph__31.md5 +1 -1
  141. data/doc/cxxapi/inherit__graph__31.png +0 -0
  142. data/doc/cxxapi/inherit__graph__32.map +1 -3
  143. data/doc/cxxapi/inherit__graph__32.md5 +1 -1
  144. data/doc/cxxapi/inherit__graph__32.png +0 -0
  145. data/doc/cxxapi/inherit__graph__33.map +1 -1
  146. data/doc/cxxapi/inherit__graph__33.md5 +1 -1
  147. data/doc/cxxapi/inherit__graph__33.png +0 -0
  148. data/doc/cxxapi/inherit__graph__34.map +1 -1
  149. data/doc/cxxapi/inherit__graph__34.md5 +1 -1
  150. data/doc/cxxapi/inherit__graph__34.png +0 -0
  151. data/doc/cxxapi/inherit__graph__35.map +3 -1
  152. data/doc/cxxapi/inherit__graph__35.md5 +1 -1
  153. data/doc/cxxapi/inherit__graph__35.png +0 -0
  154. data/doc/cxxapi/inherit__graph__36.map +1 -1
  155. data/doc/cxxapi/inherit__graph__36.md5 +1 -1
  156. data/doc/cxxapi/inherit__graph__36.png +0 -0
  157. data/doc/cxxapi/inherit__graph__37.map +1 -1
  158. data/doc/cxxapi/inherit__graph__37.md5 +1 -1
  159. data/doc/cxxapi/inherit__graph__37.png +0 -0
  160. data/doc/cxxapi/inherit__graph__38.map +3 -1
  161. data/doc/cxxapi/inherit__graph__38.md5 +1 -1
  162. data/doc/cxxapi/inherit__graph__38.png +0 -0
  163. data/doc/cxxapi/inherit__graph__39.map +3 -1
  164. data/doc/cxxapi/inherit__graph__39.md5 +1 -1
  165. data/doc/cxxapi/inherit__graph__39.png +0 -0
  166. data/doc/cxxapi/inherits.html +33 -24
  167. data/doc/cxxapi/namespacePassenger.html +52 -0
  168. data/doc/cxxapi/namespacemembers.html +6 -0
  169. data/doc/cxxapi/namespacemembers_func.html +6 -0
  170. data/doc/cxxapi/tree.html +8 -0
  171. data/ext/apache2/Configuration.cpp +30 -8
  172. data/ext/apache2/Configuration.hpp +15 -14
  173. data/ext/apache2/DirectoryMapper.h +0 -16
  174. data/ext/apache2/Hooks.cpp +30 -29
  175. data/ext/boost/algorithm/string/detail/case_conv.hpp +6 -6
  176. data/ext/boost/algorithm/string/detail/find_format.hpp +14 -4
  177. data/ext/boost/algorithm/string/detail/find_format_all.hpp +13 -3
  178. data/ext/boost/algorithm/string/detail/find_format_store.hpp +11 -0
  179. data/ext/boost/algorithm/string/erase.hpp +2 -2
  180. data/ext/boost/bind/placeholders.hpp +2 -2
  181. data/ext/boost/concept/detail/backward_compatibility.hpp +16 -0
  182. data/ext/boost/concept/detail/general.hpp +15 -6
  183. data/ext/boost/concept/detail/has_constraints.hpp +5 -3
  184. data/ext/boost/concept/usage.hpp +5 -4
  185. data/ext/boost/concept_check.hpp +10 -1
  186. data/ext/boost/config/abi/borland_prefix.hpp +1 -1
  187. data/ext/boost/config/auto_link.hpp +68 -21
  188. data/ext/boost/config/compiler/borland.hpp +11 -3
  189. data/ext/boost/config/compiler/clang.hpp +62 -0
  190. data/ext/boost/config/compiler/codegear.hpp +21 -7
  191. data/ext/boost/config/compiler/common_edg.hpp +4 -2
  192. data/ext/boost/config/compiler/digitalmars.hpp +1 -1
  193. data/ext/boost/config/compiler/gcc.hpp +46 -7
  194. data/ext/boost/config/compiler/gcc_xml.hpp +25 -0
  195. data/ext/boost/config/compiler/intel.hpp +23 -0
  196. data/ext/boost/config/compiler/kai.hpp +1 -1
  197. data/ext/boost/config/compiler/metrowerks.hpp +1 -1
  198. data/ext/boost/config/compiler/nvcc.hpp +86 -0
  199. data/ext/boost/config/compiler/pgi.hpp +18 -3
  200. data/ext/boost/config/compiler/sunpro_cc.hpp +19 -5
  201. data/ext/boost/config/compiler/vacpp.hpp +8 -0
  202. data/ext/boost/config/compiler/visualc.hpp +27 -11
  203. data/ext/boost/config/platform/cygwin.hpp +0 -3
  204. data/ext/boost/config/platform/symbian.hpp +94 -0
  205. data/ext/boost/config/platform/win32.hpp +8 -1
  206. data/ext/boost/config/select_compiler_config.hpp +10 -0
  207. data/ext/boost/config/select_platform_config.hpp +4 -0
  208. data/ext/boost/config/stdlib/dinkumware.hpp +11 -1
  209. data/ext/boost/config/stdlib/libcomo.hpp +1 -0
  210. data/ext/boost/config/stdlib/libstdcpp3.hpp +1 -0
  211. data/ext/boost/config/stdlib/modena.hpp +1 -0
  212. data/ext/boost/config/stdlib/msl.hpp +1 -0
  213. data/ext/boost/config/stdlib/roguewave.hpp +1 -0
  214. data/ext/boost/config/stdlib/sgi.hpp +1 -0
  215. data/ext/boost/config/stdlib/stlport.hpp +1 -0
  216. data/ext/boost/config/stdlib/vacpp.hpp +1 -0
  217. data/ext/boost/config/suffix.hpp +40 -2
  218. data/ext/boost/cstdint.hpp +36 -7
  219. data/ext/boost/date_time/gregorian/conversion.hpp +4 -2
  220. data/ext/boost/date_time/microsec_time_clock.hpp +7 -7
  221. data/ext/boost/date_time/posix_time/conversion.hpp +4 -2
  222. data/ext/boost/date_time/time_facet.hpp +43 -4
  223. data/ext/boost/detail/endian.hpp +5 -2
  224. data/ext/boost/detail/lcast_precision.hpp +2 -2
  225. data/ext/boost/detail/sp_typeinfo.hpp +1 -1
  226. data/ext/boost/detail/workaround.hpp +5 -0
  227. data/ext/boost/exception/detail/error_info_impl.hpp +3 -3
  228. data/ext/boost/exception/detail/exception_ptr.hpp +76 -135
  229. data/ext/boost/exception/detail/is_output_streamable.hpp +15 -2
  230. data/ext/boost/exception/detail/type_info.hpp +9 -5
  231. data/ext/boost/exception/diagnostic_information.hpp +5 -3
  232. data/ext/boost/exception/exception.hpp +60 -46
  233. data/ext/boost/exception/info.hpp +47 -14
  234. data/ext/boost/function/function_base.hpp +4 -4
  235. data/ext/boost/integer.hpp +4 -0
  236. data/ext/boost/integer_fwd.hpp +9 -3
  237. data/ext/boost/iterator/iterator_concepts.hpp +284 -0
  238. data/ext/boost/iterator/transform_iterator.hpp +0 -1
  239. data/ext/boost/make_shared.hpp +17 -0
  240. data/ext/boost/mpl/aux_/config/has_xxx.hpp +4 -3
  241. data/ext/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp +2 -6
  242. data/ext/boost/mpl/aux_/template_arity.hpp +4 -4
  243. data/ext/boost/mpl/eval_if.hpp +3 -3
  244. data/ext/boost/mpl/has_xxx.hpp +369 -3
  245. data/ext/boost/optional/optional.hpp +3 -1
  246. data/ext/boost/optional/optional_fwd.hpp +1 -1
  247. data/ext/boost/preprocessor/repetition/enum_trailing_params.hpp +38 -0
  248. data/ext/boost/range/algorithm/equal.hpp +188 -0
  249. data/ext/boost/range/as_literal.hpp +15 -15
  250. data/ext/boost/range/concepts.hpp +331 -0
  251. data/ext/boost/range/const_iterator.hpp +7 -4
  252. data/ext/boost/range/detail/extract_optional_type.hpp +52 -0
  253. data/ext/boost/range/detail/implementation_help.hpp +7 -7
  254. data/ext/boost/range/detail/misc_concept.hpp +33 -0
  255. data/ext/boost/range/iterator.hpp +32 -32
  256. data/ext/boost/range/iterator_range.hpp +8 -651
  257. data/ext/boost/range/iterator_range_core.hpp +542 -0
  258. data/ext/boost/range/iterator_range_io.hpp +93 -0
  259. data/ext/boost/range/mutable_iterator.hpp +7 -4
  260. data/ext/boost/range/size.hpp +1 -1
  261. data/ext/boost/range/size_type.hpp +2 -1
  262. data/ext/boost/shared_array.hpp +19 -0
  263. data/ext/boost/smart_ptr/detail/sp_convertible.hpp +2 -2
  264. data/ext/boost/smart_ptr/detail/yield_k.hpp +1 -1
  265. data/ext/boost/smart_ptr/make_shared.hpp +508 -0
  266. data/ext/boost/smart_ptr/shared_array.hpp +147 -0
  267. data/ext/boost/src/pthread/thread.cpp +16 -21
  268. data/ext/boost/src/pthread/timeconv.inl +7 -4
  269. data/ext/boost/thread/barrier.hpp +2 -1
  270. data/ext/boost/thread/detail/config.hpp +7 -1
  271. data/ext/boost/thread/detail/platform.hpp +1 -1
  272. data/ext/boost/thread/detail/thread.hpp +62 -18
  273. data/ext/boost/thread/detail/thread_group.hpp +5 -2
  274. data/ext/boost/thread/detail/tss_hooks.hpp +8 -25
  275. data/ext/boost/thread/future.hpp +45 -34
  276. data/ext/boost/thread/locks.hpp +184 -55
  277. data/ext/boost/thread/pthread/condition_variable.hpp +7 -7
  278. data/ext/boost/thread/pthread/condition_variable_fwd.hpp +4 -2
  279. data/ext/boost/thread/pthread/mutex.hpp +29 -17
  280. data/ext/boost/thread/pthread/once.hpp +5 -0
  281. data/ext/boost/thread/pthread/recursive_mutex.hpp +97 -18
  282. data/ext/boost/thread/pthread/shared_mutex.hpp +1 -1
  283. data/ext/boost/thread/pthread/thread_heap_alloc.hpp +1 -1
  284. data/ext/boost/thread/tss.hpp +2 -0
  285. data/ext/boost/throw_exception.hpp +21 -5
  286. data/ext/boost/token_functions.hpp +111 -91
  287. data/ext/boost/type_traits/add_reference.hpp +19 -1
  288. data/ext/boost/type_traits/function_traits.hpp +2 -2
  289. data/ext/boost/type_traits/is_const.hpp +24 -5
  290. data/ext/boost/type_traits/is_convertible.hpp +1 -1
  291. data/ext/boost/type_traits/is_function.hpp +3 -0
  292. data/ext/boost/type_traits/is_lvalue_reference.hpp +118 -0
  293. data/ext/boost/type_traits/is_reference.hpp +8 -81
  294. data/ext/boost/type_traits/is_rvalue_reference.hpp +29 -0
  295. data/ext/boost/type_traits/is_same.hpp +2 -2
  296. data/ext/boost/type_traits/is_volatile.hpp +26 -7
  297. data/ext/boost/type_traits/remove_const.hpp +12 -0
  298. data/ext/boost/type_traits/remove_cv.hpp +23 -1
  299. data/ext/boost/type_traits/remove_reference.hpp +21 -1
  300. data/ext/boost/type_traits/type_with_alignment.hpp +10 -10
  301. data/ext/boost/units/detail/utility.hpp +104 -0
  302. data/ext/boost/utility/compare_pointees.hpp +1 -1
  303. data/ext/common/AgentsStarter.hpp +151 -161
  304. data/ext/common/ApplicationPool/Pool.h +16 -4
  305. data/ext/common/Constants.h +1 -1
  306. data/ext/common/EventedClient.h +130 -26
  307. data/ext/common/Exceptions.h +15 -2
  308. data/ext/common/FileDescriptor.h +76 -12
  309. data/ext/common/IniFile.h +488 -0
  310. data/ext/common/LoggingAgent/LoggingServer.h +2 -2
  311. data/ext/common/LoggingAgent/RemoteSender.h +15 -6
  312. data/ext/common/MessageChannel.h +17 -101
  313. data/ext/common/PoolOptions.h +1 -0
  314. data/ext/common/ResourceLocator.h +78 -28
  315. data/ext/common/SafeLibev.h +149 -0
  316. data/ext/common/ServerInstanceDir.h +11 -7
  317. data/ext/common/Session.h +1 -1
  318. data/ext/common/SpawnManager.h +14 -14
  319. data/ext/common/StaticString.h +75 -0
  320. data/ext/common/Utils.cpp +304 -12
  321. data/ext/common/Utils.h +17 -0
  322. data/ext/common/Utils/BufferedIO.h +196 -0
  323. data/ext/common/Utils/IOUtils.cpp +159 -0
  324. data/ext/common/Utils/IOUtils.h +118 -1
  325. data/ext/common/Utils/ProcessMetricsCollector.h +184 -56
  326. data/ext/common/Utils/StrIntUtils.cpp +45 -11
  327. data/ext/common/Utils/StrIntUtils.h +8 -5
  328. data/ext/common/Utils/Timer.h +22 -0
  329. data/ext/common/Utils/utf8.h +35 -0
  330. data/ext/common/Utils/utf8/checked.h +324 -0
  331. data/ext/common/Utils/utf8/core.h +359 -0
  332. data/ext/common/Utils/utf8/unchecked.h +229 -0
  333. data/ext/common/Watchdog.cpp +52 -85
  334. data/ext/libev/config.h +122 -0
  335. data/ext/nginx/Configuration.c +7 -1
  336. data/ext/nginx/HelperAgent.cpp +16 -18
  337. data/ext/nginx/config +6 -4
  338. data/ext/oxt/system_calls.cpp +10 -0
  339. data/ext/oxt/system_calls.hpp +2 -0
  340. data/lib/phusion_passenger.rb +6 -11
  341. data/lib/phusion_passenger/dependencies.rb +2 -0
  342. data/lib/phusion_passenger/packaging.rb +5 -5
  343. data/lib/phusion_passenger/platform_info.rb +88 -0
  344. data/lib/phusion_passenger/platform_info/binary_compatibility.rb +3 -17
  345. data/lib/phusion_passenger/platform_info/compiler.rb +14 -32
  346. data/lib/phusion_passenger/platform_info/curl.rb +6 -1
  347. data/lib/phusion_passenger/platform_info/operating_system.rb +107 -0
  348. data/lib/phusion_passenger/public_api.rb +2 -2
  349. data/lib/phusion_passenger/rails3_extensions/init.rb +5 -2
  350. data/lib/phusion_passenger/standalone/command.rb +6 -2
  351. data/lib/phusion_passenger/standalone/package_runtime_command.rb +2 -2
  352. data/lib/phusion_passenger/standalone/runtime_installer.rb +17 -5
  353. data/lib/phusion_passenger/standalone/start_command.rb +12 -12
  354. data/lib/phusion_passenger/standalone/stop_command.rb +3 -3
  355. data/lib/phusion_passenger/standalone/utils.rb +6 -2
  356. data/lib/phusion_passenger/templates/standalone/config.erb +37 -5
  357. data/lib/phusion_passenger/utils.rb +4 -7
  358. data/resources/mime.types +73 -0
  359. data/{misc → resources}/union_station_gateway.crt +0 -0
  360. data/test/cxx/BufferedIOTest.cpp +364 -0
  361. data/test/cxx/EventedClientTest.cpp +150 -13
  362. data/test/cxx/IOUtilsTest.cpp +399 -1
  363. data/test/cxx/MessageChannelTest.cpp +5 -120
  364. data/test/cxx/ProcessMetricsCollectorTest.cpp +121 -0
  365. data/test/cxx/StaticStringTest.cpp +134 -0
  366. data/test/cxx/UtilsTest.cpp +16 -46
  367. data/test/stub/rails_apps/2.3/mycook/public/dispatch.cgi +2 -2
  368. data/test/stub/rails_apps/2.3/mycook/public/dispatch.fcgi +1 -1
  369. data/test/stub/rails_apps/2.3/mycook/public/dispatch.rb +1 -1
  370. data/test/stub/rails_apps/3.0/empty/Gemfile.lock +73 -0
  371. data/test/support/allocate_memory.c +14 -0
  372. data/test/support/test_helper.rb +3 -0
  373. metadata +57 -174
  374. data/bin/passenger-stress-test +0 -345
  375. data/debian/postinst +0 -24
  376. data/doc/rdoc/classes/ConditionVariable.html +0 -215
  377. data/doc/rdoc/classes/Exception.html +0 -120
  378. data/doc/rdoc/classes/GC.html +0 -113
  379. data/doc/rdoc/classes/IO.html +0 -221
  380. data/doc/rdoc/classes/PhusionPassenger.html +0 -397
  381. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -180
  382. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -647
  383. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -654
  384. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +0 -92
  385. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  386. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
  387. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
  388. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
  389. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -619
  390. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -142
  391. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +0 -368
  392. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +0 -231
  393. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +0 -588
  394. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +0 -92
  395. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +0 -92
  396. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +0 -147
  397. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +0 -279
  398. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +0 -92
  399. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +0 -92
  400. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +0 -123
  401. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +0 -92
  402. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +0 -341
  403. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +0 -294
  404. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +0 -199
  405. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -155
  406. data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +0 -367
  407. data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +0 -95
  408. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +0 -351
  409. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +0 -98
  410. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +0 -200
  411. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +0 -410
  412. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +0 -98
  413. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +0 -156
  414. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +0 -115
  415. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +0 -202
  416. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
  417. data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +0 -273
  418. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
  419. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -162
  420. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
  421. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
  422. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -673
  423. data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +0 -92
  424. data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +0 -415
  425. data/doc/rdoc/classes/PhusionPassenger/NativeSupportLoader.html +0 -134
  426. data/doc/rdoc/classes/PhusionPassenger/Packaging.html +0 -129
  427. data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +0 -1809
  428. data/doc/rdoc/classes/PhusionPassenger/Plugin.html +0 -237
  429. data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
  430. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -312
  431. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +0 -98
  432. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -218
  433. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +0 -114
  434. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +0 -256
  435. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +0 -139
  436. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +0 -118
  437. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +0 -135
  438. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -378
  439. data/doc/rdoc/classes/PhusionPassenger/Standalone.html +0 -111
  440. data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +0 -252
  441. data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +0 -161
  442. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +0 -368
  443. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +0 -132
  444. data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +0 -151
  445. data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +0 -189
  446. data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +0 -177
  447. data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +0 -341
  448. data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +0 -203
  449. data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +0 -156
  450. data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +0 -168
  451. data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +0 -86
  452. data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +0 -135
  453. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
  454. data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -1550
  455. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +0 -204
  456. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +0 -171
  457. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +0 -140
  458. data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +0 -260
  459. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -169
  460. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +0 -265
  461. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +0 -120
  462. data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +0 -561
  463. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
  464. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
  465. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -182
  466. data/doc/rdoc/classes/Process.html +0 -115
  467. data/doc/rdoc/classes/Signal.html +0 -139
  468. data/doc/rdoc/created.rid +0 -1
  469. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -276
  470. data/doc/rdoc/files/README.html +0 -157
  471. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -130
  472. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -135
  473. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
  474. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
  475. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +0 -126
  476. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +0 -132
  477. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
  478. data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +0 -129
  479. data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +0 -127
  480. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +0 -141
  481. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +0 -126
  482. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +0 -146
  483. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +0 -125
  484. data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +0 -132
  485. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
  486. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
  487. data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +0 -122
  488. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -147
  489. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
  490. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -127
  491. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
  492. data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +0 -127
  493. data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +0 -132
  494. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
  495. data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +0 -127
  496. data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +0 -129
  497. data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +0 -126
  498. data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +0 -126
  499. data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +0 -126
  500. data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +0 -126
  501. data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +0 -127
  502. data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +0 -128
  503. data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +0 -126
  504. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -122
  505. data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +0 -127
  506. data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +0 -127
  507. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -137
  508. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
  509. data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +0 -127
  510. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
  511. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -160
  512. data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +0 -127
  513. data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +0 -135
  514. data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +0 -126
  515. data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +0 -126
  516. data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +0 -126
  517. data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +0 -127
  518. data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +0 -133
  519. data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +0 -136
  520. data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +0 -126
  521. data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +0 -126
  522. data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +0 -126
  523. data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +0 -127
  524. data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +0 -126
  525. data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +0 -120
  526. data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +0 -100
  527. data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +0 -122
  528. data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +0 -126
  529. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -179
  530. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -132
  531. data/doc/rdoc/fr_class_index.html +0 -138
  532. data/doc/rdoc/fr_file_index.html +0 -108
  533. data/doc/rdoc/fr_method_index.html +0 -430
  534. data/doc/rdoc/index.html +0 -26
  535. data/doc/rdoc/rdoc-style.css +0 -187
  536. data/ext/apache2/LICENSE-CNRI.TXT +0 -79
  537. data/ext/common/Utils/BlockingScalar.h +0 -50
  538. data/ext/common/Utils/FileHandleGuard.h +0 -81
@@ -380,60 +380,77 @@
380
380
  <a name="l00355"></a>00355 <span class="comment"> * Convert a signal number to its associated name.</span>
381
381
  <a name="l00356"></a>00356 <span class="comment"> */</span>
382
382
  <a name="l00357"></a>00357 <span class="keywordtype">string</span> <a class="code" href="namespacePassenger.html#a979cb43cef743bf261c329b13e712366" title="Convert a signal number to its associated name.">getSignalName</a>(<span class="keywordtype">int</span> sig);
383
- <a name="l00358"></a>00358
384
- <a name="l00359"></a>00359 <span class="comment"></span>
385
- <a name="l00360"></a>00360 <span class="comment">/**</span>
386
- <a name="l00361"></a>00361 <span class="comment"> * Represents a buffered upload file.</span>
387
- <a name="l00362"></a>00362 <span class="comment"> *</span>
388
- <a name="l00363"></a>00363 <span class="comment"> * @ingroup Support</span>
389
- <a name="l00364"></a>00364 <span class="comment"> */</span>
390
- <a name="l00365"></a><a class="code" href="classPassenger_1_1BufferedUpload.html">00365</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1BufferedUpload.html" title="Represents a buffered upload file.">BufferedUpload</a> {
391
- <a name="l00366"></a>00366 <span class="keyword">public</span>:<span class="comment"></span>
392
- <a name="l00367"></a>00367 <span class="comment"> /** The file handle. */</span>
393
- <a name="l00368"></a><a class="code" href="classPassenger_1_1BufferedUpload.html#a0a340f2d972ae791f56f893901109dac">00368</a> FILE *<a class="code" href="classPassenger_1_1BufferedUpload.html#a0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a>;
394
- <a name="l00369"></a>00369 <span class="comment"></span>
395
- <a name="l00370"></a>00370 <span class="comment"> /**</span>
396
- <a name="l00371"></a>00371 <span class="comment"> * Create an empty upload bufer file, and open it for reading and writing.</span>
397
- <a name="l00372"></a>00372 <span class="comment"> *</span>
398
- <a name="l00373"></a>00373 <span class="comment"> * @throws SystemException Something went wrong.</span>
399
- <a name="l00374"></a>00374 <span class="comment"> */</span>
400
- <a name="l00375"></a><a class="code" href="classPassenger_1_1BufferedUpload.html#a51489619731ea95c2ece27faab9e24fc">00375</a> <a class="code" href="classPassenger_1_1BufferedUpload.html#a51489619731ea95c2ece27faab9e24fc" title="Create an empty upload bufer file, and open it for reading and writing.">BufferedUpload</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;dir, <span class="keyword">const</span> <span class="keywordtype">char</span> *identifier = <span class="stringliteral">&quot;temp&quot;</span>) {
401
- <a name="l00376"></a>00376 <span class="keywordtype">char</span> templ[PATH_MAX];
402
- <a name="l00377"></a>00377 <span class="keywordtype">int</span> fd;
403
- <a name="l00378"></a>00378
404
- <a name="l00379"></a>00379 snprintf(templ, <span class="keyword">sizeof</span>(templ), <span class="stringliteral">&quot;%s/%s.XXXXXX&quot;</span>, dir.c_str(), identifier);
405
- <a name="l00380"></a>00380 templ[<span class="keyword">sizeof</span>(templ) - 1] = <span class="charliteral">&#39;\0&#39;</span>;
406
- <a name="l00381"></a>00381 fd = mkstemp(templ);
407
- <a name="l00382"></a>00382 <span class="keywordflow">if</span> (fd == -1) {
408
- <a name="l00383"></a>00383 <span class="keywordtype">char</span> message[1024];
409
- <a name="l00384"></a>00384 <span class="keywordtype">int</span> e = errno;
410
- <a name="l00385"></a>00385
411
- <a name="l00386"></a>00386 snprintf(message, <span class="keyword">sizeof</span>(message), <span class="stringliteral">&quot;Cannot create a temporary file &#39;%s&#39;&quot;</span>, templ);
412
- <a name="l00387"></a>00387 message[<span class="keyword">sizeof</span>(message) - 1] = <span class="charliteral">&#39;\0&#39;</span>;
413
- <a name="l00388"></a>00388 <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>(message, e);
414
- <a name="l00389"></a>00389 }
415
- <a name="l00390"></a>00390
416
- <a name="l00391"></a>00391 <span class="comment">/* We use a POSIX trick here: the file&#39;s permissions are set to &quot;u=,g=,o=&quot;</span>
417
- <a name="l00392"></a>00392 <span class="comment"> * and the file is deleted immediately from the filesystem, while we</span>
418
- <a name="l00393"></a>00393 <span class="comment"> * keep its file handle open. The result is that no other processes</span>
419
- <a name="l00394"></a>00394 <span class="comment"> * will be able to access this file&#39;s contents anymore, except us.</span>
420
- <a name="l00395"></a>00395 <span class="comment"> * We now have an anonymous disk-backed buffer.</span>
421
- <a name="l00396"></a>00396 <span class="comment"> */</span>
422
- <a name="l00397"></a>00397 fchmod(fd, 0000);
423
- <a name="l00398"></a>00398 unlink(templ);
424
- <a name="l00399"></a>00399
425
- <a name="l00400"></a>00400 <a class="code" href="classPassenger_1_1BufferedUpload.html#a0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a> = fdopen(fd, <span class="stringliteral">&quot;w+&quot;</span>);
426
- <a name="l00401"></a>00401 }
427
- <a name="l00402"></a>00402
428
- <a name="l00403"></a>00403 ~<a class="code" href="classPassenger_1_1BufferedUpload.html" title="Represents a buffered upload file.">BufferedUpload</a>() {
429
- <a name="l00404"></a>00404 fclose(<a class="code" href="classPassenger_1_1BufferedUpload.html#a0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a>);
430
- <a name="l00405"></a>00405 }
431
- <a name="l00406"></a>00406 };
432
- <a name="l00407"></a>00407
433
- <a name="l00408"></a>00408 } <span class="comment">// namespace Passenger</span>
434
- <a name="l00409"></a>00409
435
- <a name="l00410"></a>00410 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_UTILS_H_ */</span>
436
- <a name="l00411"></a>00411
383
+ <a name="l00358"></a>00358 <span class="comment"></span>
384
+ <a name="l00359"></a>00359 <span class="comment">/**</span>
385
+ <a name="l00360"></a>00360 <span class="comment"> * Resets the current process&#39;s signal handler disposition and signal mask</span>
386
+ <a name="l00361"></a>00361 <span class="comment"> * to default values. One should call this every time one forks a child process;</span>
387
+ <a name="l00362"></a>00362 <span class="comment"> * non-default signal masks/handler dispositions can cause all kinds of weird quirks,</span>
388
+ <a name="l00363"></a>00363 <span class="comment"> * like waitpid() malfunctioning on OS X.</span>
389
+ <a name="l00364"></a>00364 <span class="comment"> *</span>
390
+ <a name="l00365"></a>00365 <span class="comment"> * This function is async-signal safe.</span>
391
+ <a name="l00366"></a>00366 <span class="comment"> */</span>
392
+ <a name="l00367"></a>00367 <span class="keywordtype">void</span> <a class="code" href="namespacePassenger.html#a2029ad8cb57611ab161b20ef9df39c86" title="Resets the current process&amp;#39;s signal handler disposition and signal mask to default...">resetSignalHandlersAndMask</a>();
393
+ <a name="l00368"></a>00368 <span class="comment"></span>
394
+ <a name="l00369"></a>00369 <span class="comment">/**</span>
395
+ <a name="l00370"></a>00370 <span class="comment"> * Close all file descriptors that are higher than &lt;em&gt;lastToKeepOpen&lt;/em&gt;.</span>
396
+ <a name="l00371"></a>00371 <span class="comment"> * This function is async-signal safe. But make sure there are no other</span>
397
+ <a name="l00372"></a>00372 <span class="comment"> * threads running that might open file descriptors!</span>
398
+ <a name="l00373"></a>00373 <span class="comment"> */</span>
399
+ <a name="l00374"></a>00374 <span class="keywordtype">void</span> <a class="code" href="namespacePassenger.html#af116b11276c90901729b6ce541dd2a07" title="Close all file descriptors that are higher than lastToKeepOpen.">closeAllFileDescriptors</a>(<span class="keywordtype">int</span> lastToKeepOpen);
400
+ <a name="l00375"></a>00375
401
+ <a name="l00376"></a>00376 <span class="comment"></span>
402
+ <a name="l00377"></a>00377 <span class="comment">/**</span>
403
+ <a name="l00378"></a>00378 <span class="comment"> * Represents a buffered upload file.</span>
404
+ <a name="l00379"></a>00379 <span class="comment"> *</span>
405
+ <a name="l00380"></a>00380 <span class="comment"> * @ingroup Support</span>
406
+ <a name="l00381"></a>00381 <span class="comment"> */</span>
407
+ <a name="l00382"></a><a class="code" href="classPassenger_1_1BufferedUpload.html">00382</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1BufferedUpload.html" title="Represents a buffered upload file.">BufferedUpload</a> {
408
+ <a name="l00383"></a>00383 <span class="keyword">public</span>:<span class="comment"></span>
409
+ <a name="l00384"></a>00384 <span class="comment"> /** The file handle. */</span>
410
+ <a name="l00385"></a><a class="code" href="classPassenger_1_1BufferedUpload.html#a0a340f2d972ae791f56f893901109dac">00385</a> FILE *<a class="code" href="classPassenger_1_1BufferedUpload.html#a0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a>;
411
+ <a name="l00386"></a>00386 <span class="comment"></span>
412
+ <a name="l00387"></a>00387 <span class="comment"> /**</span>
413
+ <a name="l00388"></a>00388 <span class="comment"> * Create an empty upload bufer file, and open it for reading and writing.</span>
414
+ <a name="l00389"></a>00389 <span class="comment"> *</span>
415
+ <a name="l00390"></a>00390 <span class="comment"> * @throws SystemException Something went wrong.</span>
416
+ <a name="l00391"></a>00391 <span class="comment"> */</span>
417
+ <a name="l00392"></a><a class="code" href="classPassenger_1_1BufferedUpload.html#a51489619731ea95c2ece27faab9e24fc">00392</a> <a class="code" href="classPassenger_1_1BufferedUpload.html#a51489619731ea95c2ece27faab9e24fc" title="Create an empty upload bufer file, and open it for reading and writing.">BufferedUpload</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;dir, <span class="keyword">const</span> <span class="keywordtype">char</span> *identifier = <span class="stringliteral">&quot;temp&quot;</span>) {
418
+ <a name="l00393"></a>00393 <span class="keywordtype">char</span> templ[PATH_MAX];
419
+ <a name="l00394"></a>00394 <span class="keywordtype">int</span> fd;
420
+ <a name="l00395"></a>00395
421
+ <a name="l00396"></a>00396 snprintf(templ, <span class="keyword">sizeof</span>(templ), <span class="stringliteral">&quot;%s/%s.XXXXXX&quot;</span>, dir.c_str(), identifier);
422
+ <a name="l00397"></a>00397 templ[<span class="keyword">sizeof</span>(templ) - 1] = <span class="charliteral">&#39;\0&#39;</span>;
423
+ <a name="l00398"></a>00398 fd = mkstemp(templ);
424
+ <a name="l00399"></a>00399 <span class="keywordflow">if</span> (fd == -1) {
425
+ <a name="l00400"></a>00400 <span class="keywordtype">char</span> message[1024];
426
+ <a name="l00401"></a>00401 <span class="keywordtype">int</span> e = errno;
427
+ <a name="l00402"></a>00402
428
+ <a name="l00403"></a>00403 snprintf(message, <span class="keyword">sizeof</span>(message), <span class="stringliteral">&quot;Cannot create a temporary file &#39;%s&#39;&quot;</span>, templ);
429
+ <a name="l00404"></a>00404 message[<span class="keyword">sizeof</span>(message) - 1] = <span class="charliteral">&#39;\0&#39;</span>;
430
+ <a name="l00405"></a>00405 <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>(message, e);
431
+ <a name="l00406"></a>00406 }
432
+ <a name="l00407"></a>00407
433
+ <a name="l00408"></a>00408 <span class="comment">/* We use a POSIX trick here: the file&#39;s permissions are set to &quot;u=,g=,o=&quot;</span>
434
+ <a name="l00409"></a>00409 <span class="comment"> * and the file is deleted immediately from the filesystem, while we</span>
435
+ <a name="l00410"></a>00410 <span class="comment"> * keep its file handle open. The result is that no other processes</span>
436
+ <a name="l00411"></a>00411 <span class="comment"> * will be able to access this file&#39;s contents anymore, except us.</span>
437
+ <a name="l00412"></a>00412 <span class="comment"> * We now have an anonymous disk-backed buffer.</span>
438
+ <a name="l00413"></a>00413 <span class="comment"> */</span>
439
+ <a name="l00414"></a>00414 fchmod(fd, 0000);
440
+ <a name="l00415"></a>00415 unlink(templ);
441
+ <a name="l00416"></a>00416
442
+ <a name="l00417"></a>00417 <a class="code" href="classPassenger_1_1BufferedUpload.html#a0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a> = fdopen(fd, <span class="stringliteral">&quot;w+&quot;</span>);
443
+ <a name="l00418"></a>00418 }
444
+ <a name="l00419"></a>00419
445
+ <a name="l00420"></a>00420 ~<a class="code" href="classPassenger_1_1BufferedUpload.html" title="Represents a buffered upload file.">BufferedUpload</a>() {
446
+ <a name="l00421"></a>00421 fclose(<a class="code" href="classPassenger_1_1BufferedUpload.html#a0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a>);
447
+ <a name="l00422"></a>00422 }
448
+ <a name="l00423"></a>00423 };
449
+ <a name="l00424"></a>00424
450
+ <a name="l00425"></a>00425 } <span class="comment">// namespace Passenger</span>
451
+ <a name="l00426"></a>00426
452
+ <a name="l00427"></a>00427 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_UTILS_H_ */</span>
453
+ <a name="l00428"></a>00428
437
454
  </pre></div></div>
438
455
  <hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
439
456
  <a href="http://www.doxygen.org/index.html">
@@ -46,6 +46,7 @@
46
46
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1EventedServer.html">Passenger::EventedServer</a></td><td class="indexvalue">A base class for writing single-threaded, evented servers that use non-blocking I/O </td></tr>
47
47
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1EventFd.html">Passenger::EventFd</a></td><td class="indexvalue">A synchronization mechanism that's implemented with file descriptors, and as such can be used in combination with select() and friends </td></tr>
48
48
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1FileDescriptor.html">Passenger::FileDescriptor</a></td><td class="indexvalue">Wrapper class around a file descriptor integer, for RAII behavior </td></tr>
49
+ <tr><td class="indexkey"><a class="el" href="classPassenger_1_1FileDescriptorPair.html">Passenger::FileDescriptorPair</a></td><td class="indexvalue">A structure containing two <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> objects </td></tr>
49
50
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1FileNotFoundException.html">Passenger::FileNotFoundException</a></td><td class="indexvalue">Thrown when a certain file cannot be found </td></tr>
50
51
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1FileSystemException.html">Passenger::FileSystemException</a></td><td class="indexvalue">A filesystem error, as returned by the operating system </td></tr>
51
52
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1MessageServer_1_1Handler.html">Passenger::MessageServer::Handler</a></td><td class="indexvalue">An abstract message handler class </td></tr>
@@ -58,7 +59,9 @@
58
59
  <tr><td class="indexkey"><a class="el" href="structPassenger_1_1PoolOptions.html">Passenger::PoolOptions</a></td><td class="indexvalue">This struct encapsulates information for ApplicationPool::get() and for <a class="el" href="classPassenger_1_1SpawnManager.html#a88a94ba4d41dab492cb1dc8a0f998973" title="Spawn a new application process.">SpawnManager::spawn()</a>, such as which application is to be spawned </td></tr>
59
60
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1Process.html">Passenger::Process</a></td><td class="indexvalue">Represents a single application process, as spawned by <a class="el" href="classPassenger_1_1SpawnManager.html" title="An AbstractSpawnManager implementation.">SpawnManager</a> or by ApplicationPool::Interface::get() </td></tr>
60
61
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1RandomGenerator.html">Passenger::RandomGenerator</a></td><td class="indexvalue">A random data generator </td></tr>
62
+ <tr><td class="indexkey"><a class="el" href="classPassenger_1_1ResourceLocator.html">Passenger::ResourceLocator</a></td><td class="indexvalue">Locates various Phusion <a class="el" href="namespacePassenger.html" title="Common code for all agents.">Passenger</a> resources on the filesystem </td></tr>
61
63
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1RuntimeException.html">Passenger::RuntimeException</a></td><td class="indexvalue">A generic runtime exception </td></tr>
64
+ <tr><td class="indexkey"><a class="el" href="classPassenger_1_1SafeLibev.html">Passenger::SafeLibev</a></td><td class="indexvalue">Class for thread-safely using libev </td></tr>
62
65
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1ScalarMessage.html">Passenger::ScalarMessage</a></td><td class="indexvalue">Class for reading a scalar message </td></tr>
63
66
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1ScgiRequestParser.html">Passenger::ScgiRequestParser</a></td><td class="indexvalue">A parser for SCGI requests </td></tr>
64
67
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1SecurityException.html">Passenger::SecurityException</a></td><td class="indexvalue">Represents some kind of security error </td></tr>
@@ -52,7 +52,7 @@
52
52
  string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAgentWatcher.html#a80ef9eaf1a84d994e7ba5f1507616fde">getErrorBacktrace</a> () const </td></tr>
53
53
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The error backtrace, if applicable. <br/></td></tr>
54
54
  <tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classPassenger_1_1FileDescriptor.html">FileDescriptor</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAgentWatcher.html#ac0749ab103ed5d1adc81b53a7ddc93d8">getFeedbackFd</a> () const </td></tr>
55
- <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the agent process feedback fd, or NULL if the agent process hasn't been started yet. <a href="#ac0749ab103ed5d1adc81b53a7ddc93d8"></a><br/></td></tr>
55
+ <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the agent process feedback fd, or -1 if the agent process hasn't been started yet. <a href="#ac0749ab103ed5d1adc81b53a7ddc93d8"></a><br/></td></tr>
56
56
  <tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
57
57
  <tr><td class="memItemLeft" align="right" valign="top">virtual string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAgentWatcher.html#a77279925d786a774bdf097468c36af96">getExeFilename</a> () const =0</td></tr>
58
58
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the filename of the agent process's executable. <a href="#a77279925d786a774bdf097468c36af96"></a><br/></td></tr>
@@ -177,7 +177,7 @@ boost::mutex&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" hr
177
177
  </div>
178
178
  <div class="memdoc">
179
179
 
180
- <p>Returns the agent process feedback fd, or NULL if the agent process hasn't been started yet. </p>
180
+ <p>Returns the agent process feedback fd, or -1 if the agent process hasn't been started yet. </p>
181
181
  <p>Can be used to check whether this agent process has exited without using waitpid(). </p>
182
182
 
183
183
  </div>
@@ -32,7 +32,6 @@
32
32
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1DirectoryMapper.html#aba438d86ca263972a47540956bf11ec1">getApplicationType</a>()</td><td><a class="el" href="classPassenger_1_1DirectoryMapper.html">Passenger::DirectoryMapper</a></td><td><code> [inline]</code></td></tr>
33
33
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1DirectoryMapper.html#ac46f0e74ffd05b7fe9924dd99a057cf7">getApplicationTypeString</a>()</td><td><a class="el" href="classPassenger_1_1DirectoryMapper.html">Passenger::DirectoryMapper</a></td><td><code> [inline]</code></td></tr>
34
34
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1DirectoryMapper.html#a2da887c077fc2460dea204783470e821">getBaseURI</a>()</td><td><a class="el" href="classPassenger_1_1DirectoryMapper.html">Passenger::DirectoryMapper</a></td><td><code> [inline]</code></td></tr>
35
- <tr class="memlist"><td><a class="el" href="classPassenger_1_1DirectoryMapper.html#af5091e3cef3878e160e5d3b2181d82fb">getEnvironment</a>()</td><td><a class="el" href="classPassenger_1_1DirectoryMapper.html">Passenger::DirectoryMapper</a></td><td><code> [inline]</code></td></tr>
36
35
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1DirectoryMapper.html#aef969f27622fb215990a870076648aa1">getPublicDirectory</a>()</td><td><a class="el" href="classPassenger_1_1DirectoryMapper.html">Passenger::DirectoryMapper</a></td><td><code> [inline]</code></td></tr>
37
36
  </table></div>
38
37
  <hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
@@ -51,8 +51,6 @@
51
51
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the application type that's associated with the HTTP request. <a href="#aba438d86ca263972a47540956bf11ec1"></a><br/></td></tr>
52
52
  <tr><td class="memItemLeft" align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1DirectoryMapper.html#ac46f0e74ffd05b7fe9924dd99a057cf7">getApplicationTypeString</a> ()</td></tr>
53
53
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the application type (as a string) that's associated with the HTTP request. <a href="#ac46f0e74ffd05b7fe9924dd99a057cf7"></a><br/></td></tr>
54
- <tr><td class="memItemLeft" align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1DirectoryMapper.html#af5091e3cef3878e160e5d3b2181d82fb">getEnvironment</a> ()</td></tr>
55
- <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the environment under which the application should be spawned. <a href="#af5091e3cef3878e160e5d3b2181d82fb"></a><br/></td></tr>
56
54
  </table>
57
55
  <hr/><a name="_details"></a><h2>Detailed Description</h2>
58
56
  <p>Utility class for determining URI-to-application directory mappings. </p>
@@ -186,31 +184,6 @@
186
184
  </dl>
187
185
  <dl class="warning"><dt><b>Warning:</b></dt><dd>The return value may only be used as long as <code>config</code> hasn't been destroyed. </dd></dl>
188
186
 
189
- </div>
190
- </div>
191
- <a class="anchor" id="af5091e3cef3878e160e5d3b2181d82fb"></a><!-- doxytag: member="Passenger::DirectoryMapper::getEnvironment" ref="af5091e3cef3878e160e5d3b2181d82fb" args="()" -->
192
- <div class="memitem">
193
- <div class="memproto">
194
- <table class="memname">
195
- <tr>
196
- <td class="memname">const char* Passenger::DirectoryMapper::getEnvironment </td>
197
- <td>(</td>
198
- <td class="paramname"></td>
199
- <td>&nbsp;)&nbsp;</td>
200
- <td><code> [inline]</code></td>
201
- </tr>
202
- </table>
203
- </div>
204
- <div class="memdoc">
205
-
206
- <p>Returns the environment under which the application should be spawned. </p>
207
- <dl><dt><b>Exceptions:</b></dt><dd>
208
- <table border="0" cellspacing="2" cellpadding="0">
209
- <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1FileSystemException.html" title="A filesystem error, as returned by the operating system.">FileSystemException</a></em>&nbsp;</td><td>An error occured while examening the filesystem. </td></tr>
210
- </table>
211
- </dd>
212
- </dl>
213
-
214
187
  </div>
215
188
  </div>
216
189
  <a class="anchor" id="aef969f27622fb215990a870076648aa1"></a><!-- doxytag: member="Passenger::DirectoryMapper::getPublicDirectory" ref="aef969f27622fb215990a870076648aa1" args="()" -->
@@ -28,8 +28,11 @@
28
28
  </div>
29
29
  <div class="contents">
30
30
  <h1>Passenger::EventedClient Member List</h1>This is the complete list of members for <a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a>, including all inherited members.<table>
31
+ <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#a9161e34ddc473c00fe4df8fdb1d1baef">closeWrite</a>()</td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td><code> [inline]</code></td></tr>
31
32
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#a408b593d118c3483bcef8118a7edba0f">detach</a>()</td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td><code> [inline]</code></td></tr>
32
33
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#a5b1a3011165ea9a47f6fe668a5010a20">disconnect</a>(bool force=false)</td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td><code> [inline]</code></td></tr>
34
+ <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#a931edf284fed32f74ebf9dc35d993f17a627c2190c3a4dc848dc1a332ef9f5105">DISCONNECT_FULL</a> enum value</td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td></td></tr>
35
+ <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#a931edf284fed32f74ebf9dc35d993f17a232760bee5b535fd40e609ff8c088693">DISCONNECT_WRITE</a> enum value</td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td></td></tr>
33
36
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#ac3c45bfa7ac30b6d59ef08dc296f3c4e">EventedClient</a>(struct ev_loop *loop, const FileDescriptor &amp;_fd)</td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td><code> [inline]</code></td></tr>
34
37
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#a4473719c16cae760e1811b7ccb1dc491">fd</a></td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td></td></tr>
35
38
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#a50436eb8ec0cc38b5a7278962e98a22c">ioAllowed</a>() const </td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td><code> [inline]</code></td></tr>
@@ -46,6 +49,8 @@
46
49
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#a1e480f15dfd339ff781f8daedc5b8190">unref</a>()</td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td><code> [inline]</code></td></tr>
47
50
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#a793c843b7ba01cc1bb2c568c6539b9e0">userData</a></td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td></td></tr>
48
51
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#aa07723456786b9f18b973bd88ff51e27">write</a>(const StaticString data[], unsigned int count)</td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td><code> [inline]</code></td></tr>
52
+ <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#aca719fb03ade09839827a16caa0e6e30">writeAllowed</a>() const </td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td><code> [inline]</code></td></tr>
53
+ <tr class="memlist"><td><a class="el" href="classPassenger_1_1EventedClient.html#afc0934988a978a25538b7d8f2566c90a">writeErrorAction</a></td><td><a class="el" href="classPassenger_1_1EventedClient.html">Passenger::EventedClient</a></td><td></td></tr>
49
54
  </table></div>
50
55
  <hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
51
56
  <a href="http://www.doxygen.org/index.html">
@@ -39,6 +39,12 @@
39
39
 
40
40
  <p><a href="classPassenger_1_1EventedClient-members.html">List of all members.</a></p>
41
41
  <table border="0" cellpadding="0" cellspacing="0">
42
+ <tr><td colspan="2"><h2>Public Types</h2></td></tr>
43
+ <tr><td class="memItemLeft" align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom">{ <a class="el" href="classPassenger_1_1EventedClient.html#a931edf284fed32f74ebf9dc35d993f17a627c2190c3a4dc848dc1a332ef9f5105">DISCONNECT_FULL</a>,
44
+ <a class="el" href="classPassenger_1_1EventedClient.html#a931edf284fed32f74ebf9dc35d993f17a232760bee5b535fd40e609ff8c088693">DISCONNECT_WRITE</a>
45
+ }</td></tr>
46
+ <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p>Controls what to do when a write error is encountered. </p>
47
+ <a href="classPassenger_1_1EventedClient.html#a931edf284fed32f74ebf9dc35d993f17">More...</a><br/></td></tr>
42
48
  <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
43
49
  <tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#ac3c45bfa7ac30b6d59ef08dc296f3c4e">EventedClient</a> (struct ev_loop *loop, const <a class="el" href="classPassenger_1_1FileDescriptor.html">FileDescriptor</a> &amp;_fd)</td></tr>
44
50
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new <a class="el" href="classPassenger_1_1EventedClient.html" title="A utility class for making I/O handling in non-blocking libev evented servers much...">EventedClient</a> with the given libev loop and file descriptor. <a href="#ac3c45bfa7ac30b6d59ef08dc296f3c4e"></a><br/></td></tr>
@@ -48,7 +54,9 @@ void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="clas
48
54
  <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#a1e480f15dfd339ff781f8daedc5b8190">unref</a> ()</td></tr>
49
55
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decrease reference count. <a href="#a1e480f15dfd339ff781f8daedc5b8190"></a><br/></td></tr>
50
56
  <tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#a50436eb8ec0cc38b5a7278962e98a22c">ioAllowed</a> () const </td></tr>
51
- <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns whether it is allowed to perform any I/O with this client. <a href="#a50436eb8ec0cc38b5a7278962e98a22c"></a><br/></td></tr>
57
+ <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns whether it is allowed to perform some kind of I/O with this client, either reading or writing. <a href="#a50436eb8ec0cc38b5a7278962e98a22c"></a><br/></td></tr>
58
+ <tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#aca719fb03ade09839827a16caa0e6e30">writeAllowed</a> () const </td></tr>
59
+ <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns whether it is allowed to write data to the client. <a href="#aca719fb03ade09839827a16caa0e6e30"></a><br/></td></tr>
52
60
  <tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#a129f6d6a6123c9af1999eca4ae04a75a">readWatcherActive</a> () const </td></tr>
53
61
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Used by unit tests. <a href="#a129f6d6a6123c9af1999eca4ae04a75a"></a><br/></td></tr>
54
62
  <tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#a0a032e54979b074641ffda807648a6e2">pendingWrites</a> () const </td></tr>
@@ -59,6 +67,8 @@ void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="clas
59
67
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets a limit on the client outbox. <a href="#ac1eb48c0d5382a97facbf9af40924849"></a><br/></td></tr>
60
68
  <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#aa07723456786b9f18b973bd88ff51e27">write</a> (const <a class="el" href="classPassenger_1_1StaticString.html">StaticString</a> data[], unsigned int count)</td></tr>
61
69
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sends data to this client. <a href="#aa07723456786b9f18b973bd88ff51e27"></a><br/></td></tr>
70
+ <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#a9161e34ddc473c00fe4df8fdb1d1baef">closeWrite</a> ()</td></tr>
71
+ <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close only the writer side of the client connection. <a href="#a9161e34ddc473c00fe4df8fdb1d1baef"></a><br/></td></tr>
62
72
  <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#a5b1a3011165ea9a47f6fe668a5010a20">disconnect</a> (bool force=false)</td></tr>
63
73
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Disconnects the client. <a href="#a5b1a3011165ea9a47f6fe668a5010a20"></a><br/></td></tr>
64
74
  <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classPassenger_1_1FileDescriptor.html">FileDescriptor</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#a408b593d118c3483bcef8118a7edba0f">detach</a> ()</td></tr>
@@ -66,6 +76,9 @@ void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="clas
66
76
  <tr><td colspan="2"><h2>Public Attributes</h2></td></tr>
67
77
  <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classPassenger_1_1FileDescriptor.html">FileDescriptor</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#a4473719c16cae760e1811b7ccb1dc491">fd</a></td></tr>
68
78
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The client's file descriptor. <a href="#a4473719c16cae760e1811b7ccb1dc491"></a><br/></td></tr>
79
+ <tr><td class="memItemLeft" align="right" valign="top">enum <br class="typebreak"/>
80
+ Passenger::EventedClient:: { ... } &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#afc0934988a978a25538b7d8f2566c90a">writeErrorAction</a></td></tr>
81
+ <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Controls what to do when a write error is encountered. <a href="#afc0934988a978a25538b7d8f2566c90a"></a><br/></td></tr>
69
82
  <tr><td class="memItemLeft" align="right" valign="top">Callback&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#a155988f311fba920bef3031f3d9b6f6a">onReadable</a></td></tr>
70
83
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Called when the file descriptor becomes readable and read notifications are enabled (see <code>notifyRead()</code>). <a href="#a155988f311fba920bef3031f3d9b6f6a"></a><br/></td></tr>
71
84
  <tr><td class="memItemLeft" align="right" valign="top">Callback&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1EventedClient.html#a211210ecd85eb2da47d200215132bb2d">onDisconnect</a></td></tr>
@@ -105,6 +118,32 @@ SystemErrorCallback&nbsp;</td><td class="memItemRight" valign="bottom"><a class=
105
118
  client-&gt;notifyReads(<span class="keyword">true</span>);
106
119
  </pre></div><h2>Error handling</h2>
107
120
  <p><a class="el" href="classPassenger_1_1EventedClient.html" title="A utility class for making I/O handling in non-blocking libev evented servers much...">EventedClient</a> never raises exceptions, except when your callbacks do. It reports errors with the <code>onSystemError</code> callback. That said, <a class="el" href="classPassenger_1_1EventedClient.html" title="A utility class for making I/O handling in non-blocking libev evented servers much...">EventedClient</a> is exception-aware and will ensure that its internal state stays consistent even when your callbacks throw exceptions. </p>
121
+ <hr/><h2>Member Enumeration Documentation</h2>
122
+ <a class="anchor" id="a931edf284fed32f74ebf9dc35d993f17"></a><!-- doxytag: member="Passenger::EventedClient::@1" ref="a931edf284fed32f74ebf9dc35d993f17" args="" -->
123
+ <div class="memitem">
124
+ <div class="memproto">
125
+ <table class="memname">
126
+ <tr>
127
+ <td class="memname">anonymous enum</td>
128
+ </tr>
129
+ </table>
130
+ </div>
131
+ <div class="memdoc">
132
+
133
+ <p>Controls what to do when a write error is encountered. </p>
134
+ <dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
135
+ <tr><td valign="top"><em><a class="anchor" id="a931edf284fed32f74ebf9dc35d993f17a627c2190c3a4dc848dc1a332ef9f5105"></a><!-- doxytag: member="DISCONNECT_FULL" ref="a931edf284fed32f74ebf9dc35d993f17a627c2190c3a4dc848dc1a332ef9f5105" args="" -->DISCONNECT_FULL</em>&nbsp;</td><td>
136
+ <p>Forcefully disconnect the client. </p>
137
+ </td></tr>
138
+ <tr><td valign="top"><em><a class="anchor" id="a931edf284fed32f74ebf9dc35d993f17a232760bee5b535fd40e609ff8c088693"></a><!-- doxytag: member="DISCONNECT_WRITE" ref="a931edf284fed32f74ebf9dc35d993f17a232760bee5b535fd40e609ff8c088693" args="" -->DISCONNECT_WRITE</em>&nbsp;</td><td>
139
+ <p>Close the writer side of the connection, but continue allowing reading. </p>
140
+ </td></tr>
141
+ </table>
142
+ </dd>
143
+ </dl>
144
+
145
+ </div>
146
+ </div>
108
147
  <hr/><h2>Constructor &amp; Destructor Documentation</h2>
109
148
  <a class="anchor" id="ac3c45bfa7ac30b6d59ef08dc296f3c4e"></a><!-- doxytag: member="Passenger::EventedClient::EventedClient" ref="ac3c45bfa7ac30b6d59ef08dc296f3c4e" args="(struct ev_loop *loop, const FileDescriptor &amp;_fd)" -->
110
149
  <div class="memitem">
@@ -137,6 +176,27 @@ SystemErrorCallback&nbsp;</td><td class="memItemRight" valign="bottom"><a class=
137
176
  </div>
138
177
  </div>
139
178
  <hr/><h2>Member Function Documentation</h2>
179
+ <a class="anchor" id="a9161e34ddc473c00fe4df8fdb1d1baef"></a><!-- doxytag: member="Passenger::EventedClient::closeWrite" ref="a9161e34ddc473c00fe4df8fdb1d1baef" args="()" -->
180
+ <div class="memitem">
181
+ <div class="memproto">
182
+ <table class="memname">
183
+ <tr>
184
+ <td class="memname">void Passenger::EventedClient::closeWrite </td>
185
+ <td>(</td>
186
+ <td class="paramname"></td>
187
+ <td>&nbsp;)&nbsp;</td>
188
+ <td><code> [inline]</code></td>
189
+ </tr>
190
+ </table>
191
+ </div>
192
+ <div class="memdoc">
193
+
194
+ <p>Close only the writer side of the client connection. </p>
195
+ <p>After calling this method, subsequent write() calls won't do anything anymore. Any pending outgoing data will be sent out whenever the opportunity arises.</p>
196
+ <p>This function does nothing if the client is being disconnected, already disconnected or if only the writer side is closed. </p>
197
+
198
+ </div>
199
+ </div>
140
200
  <a class="anchor" id="a408b593d118c3483bcef8118a7edba0f"></a><!-- doxytag: member="Passenger::EventedClient::detach" ref="a408b593d118c3483bcef8118a7edba0f" args="()" -->
141
201
  <div class="memitem">
142
202
  <div class="memproto">
@@ -153,7 +213,7 @@ SystemErrorCallback&nbsp;</td><td class="memItemRight" valign="bottom"><a class=
153
213
  <div class="memdoc">
154
214
 
155
215
  <p>Detaches the client file descriptor so that this <a class="el" href="classPassenger_1_1EventedClient.html" title="A utility class for making I/O handling in non-blocking libev evented servers much...">EventedClient</a> no longer has any control over it. </p>
156
- <p>Any <a class="el" href="classPassenger_1_1EventedClient.html" title="A utility class for making I/O handling in non-blocking libev evented servers much...">EventedClient</a> I/O watchers on the client file descriptor will be stopped and further I/O on the file descriptor via <a class="el" href="classPassenger_1_1EventedClient.html" title="A utility class for making I/O handling in non-blocking libev evented servers much...">EventedClient</a> will become impossible. The original client file descriptor is returned and <code>onDetach</code> is called. Subsequent calls to this function will return -1 and will no longer call <code>onDetach</code>.</p>
216
+ <p>Any <a class="el" href="classPassenger_1_1EventedClient.html" title="A utility class for making I/O handling in non-blocking libev evented servers much...">EventedClient</a> I/O watchers on the client file descriptor will be stopped and further I/O on the file descriptor via <a class="el" href="classPassenger_1_1EventedClient.html" title="A utility class for making I/O handling in non-blocking libev evented servers much...">EventedClient</a> will become impossible. Any pending outgoing data will be discarded. The original client file descriptor is returned and <code>onDetach</code> is called. Subsequent calls to this function will return -1 and will no longer call <code>onDetach</code>.</p>
157
217
  <dl class="post"><dt><b>Postcondition:</b></dt><dd>!ioAllowed() </dd>
158
218
  <dd>
159
219
  fd == -1 </dd></dl>
@@ -200,8 +260,8 @@ fd == -1 </dd></dl>
200
260
  </div>
201
261
  <div class="memdoc">
202
262
 
203
- <p>Returns whether it is allowed to perform any I/O with this client. </p>
204
- <p>Usually true, and false when the client is either being disconnected or has been disconnected. A return value of false indicates that <code>fd</code> might be -1, but even when it isn't -1 you shouldn't access <code>fd</code> anymore. </p>
263
+ <p>Returns whether it is allowed to perform some kind of I/O with this client, either reading or writing. </p>
264
+ <p>Usually true, and false when the client is either being disconnected or has been disconnected. A return value of false indicates that <code>fd</code> might be -1, but even when it isn't -1 you shouldn't access <code>fd</code> anymore. When the connection is half-closed (e.g. after <a class="el" href="classPassenger_1_1EventedClient.html#a9161e34ddc473c00fe4df8fdb1d1baef" title="Close only the writer side of the client connection.">closeWrite()</a> has been called) the return value is still be true. Only when I/O of any kind is disallowed will this function return false. </p>
205
265
 
206
266
  </div>
207
267
  </div>
@@ -337,10 +397,30 @@ fd == -1 </dd></dl>
337
397
 
338
398
  <p>Sends data to this client. </p>
339
399
  <p>This method will try to send the data immediately (in which no intermediate copies of the data will be made), but if the client is not yet ready to receive data (e.g. because of network congestion) then the data will be buffered and scheduled for sending later.</p>
340
- <p>If an I/O error was encountered then the client connection will be closed by calling <code>disconnect(true)</code>. This means this method could potentially call the <code>onDisconnect</code> callback.</p>
341
- <p>If the client connection is already being closed or has already been closed then this method does nothing.</p>
400
+ <p>If an I/O error was encountered then the action taken depends on the value of <em>writeActionError</em>. By default it is DISCONNECT_FULL, meaning the client connection will be closed by calling <code>disconnect(true)</code>. This means this method could potentially call the <code>onDisconnect</code> callback.</p>
401
+ <p>If the client connection is already being closed, has already been closed or if the writer side is closed, then this method does nothing.</p>
342
402
  <p>The <code>onPendingDataFlushed</code> callback will be called after this data and whatever existing pending data have been written out. That may either be immediately or after a short period of of time. </p>
343
403
 
404
+ </div>
405
+ </div>
406
+ <a class="anchor" id="aca719fb03ade09839827a16caa0e6e30"></a><!-- doxytag: member="Passenger::EventedClient::writeAllowed" ref="aca719fb03ade09839827a16caa0e6e30" args="() const " -->
407
+ <div class="memitem">
408
+ <div class="memproto">
409
+ <table class="memname">
410
+ <tr>
411
+ <td class="memname">bool Passenger::EventedClient::writeAllowed </td>
412
+ <td>(</td>
413
+ <td class="paramname"></td>
414
+ <td>&nbsp;)&nbsp;</td>
415
+ <td> const<code> [inline]</code></td>
416
+ </tr>
417
+ </table>
418
+ </div>
419
+ <div class="memdoc">
420
+
421
+ <p>Returns whether it is allowed to write data to the client. </p>
422
+ <p>Usually true, and false when the client is either being disconnected or has been disconnected or when the writer side of the client connection has been closed. write() will do nothing if this function returns false. </p>
423
+
344
424
  </div>
345
425
  </div>
346
426
  <hr/><h2>Member Data Documentation</h2>
@@ -356,7 +436,7 @@ fd == -1 </dd></dl>
356
436
  <div class="memdoc">
357
437
 
358
438
  <p>The client's file descriptor. </p>
359
- <p>Could be -1: see <code><a class="el" href="classPassenger_1_1EventedClient.html#a50436eb8ec0cc38b5a7278962e98a22c" title="Returns whether it is allowed to perform any I/O with this client.">ioAllowed()</a></code>. </p>
439
+ <p>Could be -1: see <code><a class="el" href="classPassenger_1_1EventedClient.html#a50436eb8ec0cc38b5a7278962e98a22c" title="Returns whether it is allowed to perform some kind of I/O with this client, either...">ioAllowed()</a></code>. </p>
360
440
 
361
441
  </div>
362
442
  </div>
@@ -423,6 +503,21 @@ fd == -1 </dd></dl>
423
503
  <p><a class="el" href="classPassenger_1_1EventedClient.html" title="A utility class for making I/O handling in non-blocking libev evented servers much...">EventedClient</a> doesn't do anything with this. </p>
424
504
  <p>Set it to whatever you want. </p>
425
505
 
506
+ </div>
507
+ </div>
508
+ <a class="anchor" id="afc0934988a978a25538b7d8f2566c90a"></a><!-- doxytag: member="Passenger::EventedClient::writeErrorAction" ref="afc0934988a978a25538b7d8f2566c90a" args="" -->
509
+ <div class="memitem">
510
+ <div class="memproto">
511
+ <table class="memname">
512
+ <tr>
513
+ <td class="memname">enum { ... } <a class="el" href="classPassenger_1_1EventedClient.html#afc0934988a978a25538b7d8f2566c90a">Passenger::EventedClient::writeErrorAction</a></td>
514
+ </tr>
515
+ </table>
516
+ </div>
517
+ <div class="memdoc">
518
+
519
+ <p>Controls what to do when a write error is encountered. </p>
520
+
426
521
  </div>
427
522
  </div>
428
523
  <hr/>The documentation for this class was generated from the following file:<ul>
@@ -28,7 +28,8 @@
28
28
  </div>
29
29
  <div class="contents">
30
30
  <h1>Passenger::FileDescriptor Member List</h1>This is the complete list of members for <a class="el" href="classPassenger_1_1FileDescriptor.html">Passenger::FileDescriptor</a>, including all inherited members.<table>
31
- <tr class="memlist"><td><a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432">close</a>()</td><td><a class="el" href="classPassenger_1_1FileDescriptor.html">Passenger::FileDescriptor</a></td><td><code> [inline]</code></td></tr>
31
+ <tr class="memlist"><td><a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b">close</a>(bool checkErrors=true)</td><td><a class="el" href="classPassenger_1_1FileDescriptor.html">Passenger::FileDescriptor</a></td><td><code> [inline]</code></td></tr>
32
+ <tr class="memlist"><td><a class="el" href="classPassenger_1_1FileDescriptor.html#ad9f7acde3003ab0730bc248948a63777">detach</a>()</td><td><a class="el" href="classPassenger_1_1FileDescriptor.html">Passenger::FileDescriptor</a></td><td><code> [inline]</code></td></tr>
32
33
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1FileDescriptor.html#a05d83ad9cc77c493a3ce4f2b51d44559">FileDescriptor</a>()</td><td><a class="el" href="classPassenger_1_1FileDescriptor.html">Passenger::FileDescriptor</a></td><td><code> [inline]</code></td></tr>
33
34
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1FileDescriptor.html#a62c05b925cb1cf964169cef7635650ee">FileDescriptor</a>(int fd)</td><td><a class="el" href="classPassenger_1_1FileDescriptor.html">Passenger::FileDescriptor</a></td><td><code> [inline]</code></td></tr>
34
35
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1FileDescriptor.html#ac335c2a97f3a6c8e3920f573b0d04081">operator int</a>() const </td><td><a class="el" href="classPassenger_1_1FileDescriptor.html">Passenger::FileDescriptor</a></td><td><code> [inline]</code></td></tr>
@@ -42,15 +42,17 @@
42
42
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new empty <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> instance that has no underlying file descriptor. <a href="#a05d83ad9cc77c493a3ce4f2b51d44559"></a><br/></td></tr>
43
43
  <tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#a62c05b925cb1cf964169cef7635650ee">FileDescriptor</a> (int fd)</td></tr>
44
44
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> instance with the given fd as a handle. <a href="#a62c05b925cb1cf964169cef7635650ee"></a><br/></td></tr>
45
- <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432">close</a> ()</td></tr>
46
- <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the underlying file descriptor. <a href="#ad7c1a99531181878cbab74a7400c5432"></a><br/></td></tr>
45
+ <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b">close</a> (bool checkErrors=true)</td></tr>
46
+ <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the underlying file descriptor. <a href="#a02062f3cfb689b32781e11114c0abe5b"></a><br/></td></tr>
47
+ <tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#ad9f7acde3003ab0730bc248948a63777">detach</a> ()</td></tr>
48
+ <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Detach from the underlying file descriptor without closing it. <a href="#ad9f7acde3003ab0730bc248948a63777"></a><br/></td></tr>
47
49
  <tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#ac335c2a97f3a6c8e3920f573b0d04081">operator int</a> () const </td></tr>
48
50
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Overloads the integer cast operator so that it will return the underlying file descriptor handle as an integer. <a href="#ac335c2a97f3a6c8e3920f573b0d04081"></a><br/></td></tr>
49
51
  </table>
50
52
  <hr/><a name="_details"></a><h2>Detailed Description</h2>
51
53
  <p>Wrapper class around a file descriptor integer, for RAII behavior. </p>
52
- <p>A <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> object behaves just like an int, so that you can pass it to system calls such as read(). It performs reference counting. When the last copy of a <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> has been destroyed, the underlying file descriptor will be automatically closed. In this case, any <a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432" title="Close the underlying file descriptor.">close()</a> system call errors are silently ignored. If you are interested in whether the <a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432" title="Close the underlying file descriptor.">close()</a> system call succeeded, then you should call <a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432" title="Close the underlying file descriptor.">FileDescriptor::close()</a>.</p>
53
- <p>This class is *not* thread-safe. It is safe to call system calls on the underlying file descriptor from multiple threads, but it's not safe to call <a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432" title="Close the underlying file descriptor.">FileDescriptor::close()</a> from multiple threads if all those <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> objects point to the same underlying file descriptor. </p>
54
+ <p>A <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> object behaves just like an int, so that you can pass it to system calls such as read(). It performs reference counting. When the last copy of a <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> has been destroyed, the underlying file descriptor will be automatically closed. In this case, any <a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b" title="Close the underlying file descriptor.">close()</a> system call errors are silently ignored. If you are interested in whether the <a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b" title="Close the underlying file descriptor.">close()</a> system call succeeded, then you should call <a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b" title="Close the underlying file descriptor.">FileDescriptor::close()</a>.</p>
55
+ <p>This class is *not* thread-safe. It is safe to call system calls on the underlying file descriptor from multiple threads, but it's not safe to call <a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b" title="Close the underlying file descriptor.">FileDescriptor::close()</a> from multiple threads if all those <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> objects point to the same underlying file descriptor. </p>
54
56
  <hr/><h2>Constructor &amp; Destructor Documentation</h2>
55
57
  <a class="anchor" id="a05d83ad9cc77c493a3ce4f2b51d44559"></a><!-- doxytag: member="Passenger::FileDescriptor::FileDescriptor" ref="a05d83ad9cc77c493a3ce4f2b51d44559" args="()" -->
56
58
  <div class="memitem">
@@ -94,14 +96,15 @@
94
96
  </div>
95
97
  </div>
96
98
  <hr/><h2>Member Function Documentation</h2>
97
- <a class="anchor" id="ad7c1a99531181878cbab74a7400c5432"></a><!-- doxytag: member="Passenger::FileDescriptor::close" ref="ad7c1a99531181878cbab74a7400c5432" args="()" -->
99
+ <a class="anchor" id="a02062f3cfb689b32781e11114c0abe5b"></a><!-- doxytag: member="Passenger::FileDescriptor::close" ref="a02062f3cfb689b32781e11114c0abe5b" args="(bool checkErrors=true)" -->
98
100
  <div class="memitem">
99
101
  <div class="memproto">
100
102
  <table class="memname">
101
103
  <tr>
102
104
  <td class="memname">void Passenger::FileDescriptor::close </td>
103
105
  <td>(</td>
104
- <td class="paramname"></td>
106
+ <td class="paramtype">bool&nbsp;</td>
107
+ <td class="paramname"> <em>checkErrors</em> = <code>true</code></td>
105
108
  <td>&nbsp;)&nbsp;</td>
106
109
  <td><code> [inline]</code></td>
107
110
  </tr>
@@ -111,14 +114,37 @@
111
114
 
112
115
  <p>Close the underlying file descriptor. </p>
113
116
  <p>If it was already closed, then nothing will happen. If there are multiple copies of this <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> then the underlying file descriptor will be closed for every one of them.</p>
117
+ <p>checkErrors Whether a <a class="el" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a> should be thrown in case closing the file descriptor fails. If false, errors are silently ignored. </p>
114
118
  <dl><dt><b>Exceptions:</b></dt><dd>
115
119
  <table border="0" cellspacing="2" cellpadding="0">
116
- <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a></em>&nbsp;</td><td>Something went wrong while closing the file descriptor. </td></tr>
120
+ <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a></em>&nbsp;</td><td>Something went wrong while closing the file descriptor. Only thrown if checkErrors is true. </td></tr>
117
121
  </table>
118
122
  </dd>
119
123
  </dl>
120
124
  <dl class="post"><dt><b>Postcondition:</b></dt><dd>*this == -1 </dd></dl>
121
125
 
126
+ </div>
127
+ </div>
128
+ <a class="anchor" id="ad9f7acde3003ab0730bc248948a63777"></a><!-- doxytag: member="Passenger::FileDescriptor::detach" ref="ad9f7acde3003ab0730bc248948a63777" args="()" -->
129
+ <div class="memitem">
130
+ <div class="memproto">
131
+ <table class="memname">
132
+ <tr>
133
+ <td class="memname">int Passenger::FileDescriptor::detach </td>
134
+ <td>(</td>
135
+ <td class="paramname"></td>
136
+ <td>&nbsp;)&nbsp;</td>
137
+ <td><code> [inline]</code></td>
138
+ </tr>
139
+ </table>
140
+ </div>
141
+ <div class="memdoc">
142
+
143
+ <p>Detach from the underlying file descriptor without closing it. </p>
144
+ <p>This <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> and all copies will no longer affect the underlying file descriptors.</p>
145
+ <dl class="return"><dt><b>Returns:</b></dt><dd>The underlying file descriptor, or -1 if already closed. </dd></dl>
146
+ <dl class="post"><dt><b>Postcondition:</b></dt><dd>*this == -1 </dd></dl>
147
+
122
148
  </div>
123
149
  </div>
124
150
  <a class="anchor" id="ac335c2a97f3a6c8e3920f573b0d04081"></a><!-- doxytag: member="Passenger::FileDescriptor::operator int" ref="ac335c2a97f3a6c8e3920f573b0d04081" args="() const " -->
@@ -137,7 +163,7 @@
137
163
  <div class="memdoc">
138
164
 
139
165
  <p>Overloads the integer cast operator so that it will return the underlying file descriptor handle as an integer. </p>
140
- <p>Returns -1 if <a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432" title="Close the underlying file descriptor.">FileDescriptor::close()</a> was called. </p>
166
+ <p>Returns -1 if <a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b" title="Close the underlying file descriptor.">FileDescriptor::close()</a> was called. </p>
141
167
 
142
168
  </div>
143
169
  </div>