passenger 6.0.23 → 6.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +26 -1
- data/Rakefile +7 -3
- data/bin/passenger-install-apache2-module +5 -0
- data/bin/passenger-install-nginx-module +17 -2
- data/build/apache2.rb +1 -1
- data/build/basics.rb +10 -4
- data/build/cxx_tests.rb +18 -7
- data/build/support/cxx_dependency_map.rb +40 -6
- data/build/test_basics.rb +4 -12
- data/package.json +1 -1
- data/passenger.gemspec +1 -1
- data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +8 -0
- data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +10 -2
- data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +8 -0
- data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +9 -0
- data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +9 -0
- data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +63 -50
- data/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp +19 -9
- data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +8 -0
- data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +8 -0
- data/src/agent/Core/ApplicationPool/Group/Verification.cpp +8 -0
- data/src/agent/Core/ApplicationPool/Group.h +15 -5
- data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/ProcessUtils.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +11 -1
- data/src/agent/Core/ApplicationPool/Pool.h +0 -2
- data/src/agent/Core/ApplicationPool/Process.h +22 -6
- data/src/agent/Core/ApplicationPool/Session.h +6 -1
- data/src/agent/Core/Config.h +7 -3
- data/src/agent/Core/Controller/Config.h +1 -1
- data/src/agent/Core/CoreMain.cpp +10 -17
- data/src/agent/Core/SpawningKit/Handshake/Prepare.h +1 -53
- data/src/agent/Core/SpawningKit/Handshake/Session.h +3 -0
- data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +5 -2
- data/src/agent/Core/SpawningKit/SmartSpawner.h +6 -2
- data/src/agent/Core/SpawningKit/Spawner.h +4 -0
- data/src/agent/Shared/Fundamentals/AbortHandler.cpp +88 -9
- data/src/agent/Shared/Fundamentals/AbortHandler.h +2 -0
- data/src/agent/Shared/Fundamentals/Initialization.cpp +9 -3
- data/src/agent/Shared/Fundamentals/Initialization.h +3 -3
- data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +6 -7
- data/src/agent/Watchdog/Config.h +1 -1
- data/src/agent/Watchdog/WatchdogMain.cpp +4 -7
- data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +5 -3
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +3 -0
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +3 -0
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +2 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +2 -1
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/cxx_supportlib/DataStructures/StringMap.h +0 -1
- data/src/cxx_supportlib/FileTools/PathManip.cpp +1 -1
- data/src/cxx_supportlib/SafeLibev.h +1 -3
- data/src/cxx_supportlib/ServerKit/Hooks.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +0 -1
- data/src/cxx_supportlib/ServerKit/HttpServer.h +15 -10
- data/src/cxx_supportlib/ServerKit/Server.h +0 -6
- data/src/cxx_supportlib/Utils/AsyncSignalSafeUtils.h +2 -0
- data/src/cxx_supportlib/Utils/SpeedMeter.h +0 -3
- data/src/cxx_supportlib/oxt/implementation.cpp +11 -0
- data/src/cxx_supportlib/oxt/system_calls.cpp +10 -3
- data/src/cxx_supportlib/oxt/thread.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/as_tuple.hpp +35 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/associated_immediate_executor.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/associator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/async_result.hpp +74 -68
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +11 -11
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_random_access_file.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_readable_pipe.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_file.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_writable_pipe.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_allocator.hpp +88 -22
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_cancellation_slot.hpp +91 -22
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_executor.hpp +105 -23
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_immediate_executor.hpp +90 -23
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffer_registration.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/cancel_after.hpp +303 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/cancel_at.hpp +296 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/impl/co_composed.hpp → co_composed.hpp} +208 -61
- data/src/cxx_supportlib/vendor-modified/boost/asio/completion_condition.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/compose.hpp +10 -201
- data/src/cxx_supportlib/vendor-modified/boost/asio/composed.hpp +415 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/connect.hpp +214 -48
- data/src/cxx_supportlib/vendor-modified/boost/asio/coroutine.hpp +3 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/default_completion_token.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/deferred.hpp +9 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/detached.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffered_stream_storage.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/detail/channel_message.hpp → detail/completion_message.hpp} +14 -16
- data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/detail/channel_payload.hpp → detail/completion_payload.hpp} +30 -32
- data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/detail/channel_handler.hpp → detail/completion_payload_handler.hpp} +15 -13
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +26 -32
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/deadline_timer_service.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +14 -118
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +36 -33
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/dev_poll_reactor.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_descriptor_service.ipp +7 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_socket_service_base.ipp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +44 -35
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_select_interrupter.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/initiation_base.hpp +64 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +0 -11
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_descriptor_service.hpp +20 -16
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_send_op.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service_base.hpp +23 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/recycling_allocator.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_endpoint_op.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_query_op.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread_info_base.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timed_cancel_op.hpp +363 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wrapped_handler.hpp +29 -51
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking_adaptation.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/mapping.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/occupancy.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/outstanding_work.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/relationship.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_channel.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_concurrent_channel.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/co_composed.hpp +2 -114
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_receive_op.hpp +2 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_send_functions.hpp +27 -19
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_send_op.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_service.hpp +17 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_promise_allocator.hpp +2 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/impl/channel_service.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/partial_promise.hpp +3 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/as_single.hpp +12 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/coro.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/parallel_group.hpp +38 -40
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/promise.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_coro.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_promise.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/immediate.hpp +144 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/append.hpp +14 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/as_tuple.hpp +45 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/awaitable.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/cancel_after.hpp +270 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/cancel_at.hpp +270 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/co_spawn.hpp +8 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +60 -166
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/consign.hpp +14 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/detached.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/prepend.hpp +14 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +26 -177
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +16 -82
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +13 -286
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/redirect_error.hpp +55 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +26 -185
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +16 -87
- data/src/cxx_supportlib/vendor-modified/boost/asio/io_context_strand.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/socket_option.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v6.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/placeholders.hpp +12 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/read.hpp +127 -28
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_at.hpp +70 -20
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_until.hpp +114 -36
- data/src/cxx_supportlib/vendor-modified/boost/asio/redirect_error.hpp +43 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/registered_buffer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/impl/openssl_init.ipp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/context.ipp +10 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/this_coro.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/use_awaitable.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/use_future.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/uses_executor.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/write.hpp +147 -35
- data/src/cxx_supportlib/vendor-modified/boost/asio/write_at.hpp +74 -22
- data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/assert/source_location.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/futex.hpp +42 -11
- data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +15 -37
- data/src/cxx_supportlib/vendor-modified/boost/container/adaptive_pool.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +151 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +11 -9
- data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +611 -102
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool_impl.hpp +47 -47
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +25 -24
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/allocation_type.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/block_list.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/block_slist.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/construct_in_place.hpp +35 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +14 -14
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/dispatch_uses_allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +55 -23
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/function_detector.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_container.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_contiguous_container.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_pair.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterators.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/math_functions.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/mpl.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/multiallocation_chain.hpp +96 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_alloc_holder.hpp +19 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +17 -17
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common_alloc.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_resource.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +86 -52
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/version_type.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +145 -65
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +105 -22
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +30 -22
- data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +19 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/new_allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +15 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/node_handle.hpp +6 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +15 -15
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/memory_resource.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/monotonic_buffer_resource.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/resource_adaptor.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/scoped_allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +31 -24
- data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +45 -43
- data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +45 -33
- data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +5 -7
- data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +55 -47
- data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +222 -73
- data/src/cxx_supportlib/vendor-modified/boost/core/detail/minstd_rand.hpp +58 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/detail/string_view.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/core/empty_value.hpp +53 -5
- data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/pointer_in_range.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/span.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/type_name.hpp +7 -2
- data/src/cxx_supportlib/vendor-modified/boost/function/function_base.hpp +22 -34
- data/src/cxx_supportlib/vendor-modified/boost/function/function_template.hpp +141 -38
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/algorithm.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hash.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hook_traits.hpp +8 -6
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_traits.hpp +18 -18
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +22 -17
- data/src/cxx_supportlib/vendor-modified/boost/libs/random/src/random_device.cpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/config_begin.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/launder.hpp +53 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +9 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/workaround.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/mpl/aux_/integral_wrapper.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/version.h +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/requires_cxx11.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/generic_category_message.hpp +13 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_map.hpp +13 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_map_fwd.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_set.hpp +13 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_set_fwd.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fca.hpp +22 -6
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/concurrent_table.hpp +38 -10
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/core.hpp +111 -2
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/cumulative_stats.hpp +177 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/table.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/hash_traits.hpp +33 -7
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map_fwd.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set_fwd.hpp +14 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map_fwd.hpp +19 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_map.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_map_fwd.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_set.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_set_fwd.hpp +14 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set_fwd.hpp +17 -0
- data/src/cxx_supportlib/vendor-modified/boost/utility/detail/minstd_rand.hpp +1 -43
- data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
- data/src/ruby_supportlib/phusion_passenger/config/compile_nginx_engine_command.rb +6 -2
- data/src/ruby_supportlib/phusion_passenger/config/install_standalone_runtime_command.rb +10 -0
- data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +12 -4
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +32 -5
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +0 -4
- data/src/ruby_supportlib/phusion_passenger/utils/json.rb +5 -1
- data/src/ruby_supportlib/phusion_passenger/utils.rb +5 -15
- data/src/ruby_supportlib/phusion_passenger.rb +5 -5
- metadata +21 -8
@@ -16,197 +16,12 @@
|
|
16
16
|
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
17
17
|
|
18
18
|
#include <boost/asio/detail/config.hpp>
|
19
|
-
#include <boost/asio/
|
20
|
-
#include <boost/asio/async_result.hpp>
|
21
|
-
#include <boost/asio/detail/base_from_cancellation_state.hpp>
|
22
|
-
#include <boost/asio/detail/composed_work.hpp>
|
23
|
-
#include <boost/asio/detail/handler_cont_helpers.hpp>
|
24
|
-
#include <boost/asio/detail/type_traits.hpp>
|
19
|
+
#include <boost/asio/composed.hpp>
|
25
20
|
|
26
21
|
#include <boost/asio/detail/push_options.hpp>
|
27
22
|
|
28
23
|
namespace boost {
|
29
24
|
namespace asio {
|
30
|
-
namespace detail {
|
31
|
-
|
32
|
-
template <typename Impl, typename Work, typename Handler, typename Signature>
|
33
|
-
class composed_op;
|
34
|
-
|
35
|
-
template <typename Impl, typename Work, typename Handler,
|
36
|
-
typename R, typename... Args>
|
37
|
-
class composed_op<Impl, Work, Handler, R(Args...)>
|
38
|
-
: public base_from_cancellation_state<Handler>
|
39
|
-
{
|
40
|
-
public:
|
41
|
-
template <typename I, typename W, typename H>
|
42
|
-
composed_op(I&& impl,
|
43
|
-
W&& work,
|
44
|
-
H&& handler)
|
45
|
-
: base_from_cancellation_state<Handler>(
|
46
|
-
handler, enable_terminal_cancellation()),
|
47
|
-
impl_(static_cast<I&&>(impl)),
|
48
|
-
work_(static_cast<W&&>(work)),
|
49
|
-
handler_(static_cast<H&&>(handler)),
|
50
|
-
invocations_(0)
|
51
|
-
{
|
52
|
-
}
|
53
|
-
|
54
|
-
composed_op(composed_op&& other)
|
55
|
-
: base_from_cancellation_state<Handler>(
|
56
|
-
static_cast<base_from_cancellation_state<Handler>&&>(other)),
|
57
|
-
impl_(static_cast<Impl&&>(other.impl_)),
|
58
|
-
work_(static_cast<Work&&>(other.work_)),
|
59
|
-
handler_(static_cast<Handler&&>(other.handler_)),
|
60
|
-
invocations_(other.invocations_)
|
61
|
-
{
|
62
|
-
}
|
63
|
-
|
64
|
-
typedef typename composed_work_guard<
|
65
|
-
typename Work::head_type>::executor_type io_executor_type;
|
66
|
-
|
67
|
-
io_executor_type get_io_executor() const noexcept
|
68
|
-
{
|
69
|
-
return work_.head_.get_executor();
|
70
|
-
}
|
71
|
-
|
72
|
-
typedef associated_executor_t<Handler, io_executor_type> executor_type;
|
73
|
-
|
74
|
-
executor_type get_executor() const noexcept
|
75
|
-
{
|
76
|
-
return (get_associated_executor)(handler_, work_.head_.get_executor());
|
77
|
-
}
|
78
|
-
|
79
|
-
typedef associated_allocator_t<Handler, std::allocator<void>> allocator_type;
|
80
|
-
|
81
|
-
allocator_type get_allocator() const noexcept
|
82
|
-
{
|
83
|
-
return (get_associated_allocator)(handler_, std::allocator<void>());
|
84
|
-
}
|
85
|
-
|
86
|
-
template<typename... T>
|
87
|
-
void operator()(T&&... t)
|
88
|
-
{
|
89
|
-
if (invocations_ < ~0u)
|
90
|
-
++invocations_;
|
91
|
-
this->get_cancellation_state().slot().clear();
|
92
|
-
impl_(*this, static_cast<T&&>(t)...);
|
93
|
-
}
|
94
|
-
|
95
|
-
void complete(Args... args)
|
96
|
-
{
|
97
|
-
this->work_.reset();
|
98
|
-
static_cast<Handler&&>(this->handler_)(static_cast<Args&&>(args)...);
|
99
|
-
}
|
100
|
-
|
101
|
-
void reset_cancellation_state()
|
102
|
-
{
|
103
|
-
base_from_cancellation_state<Handler>::reset_cancellation_state(handler_);
|
104
|
-
}
|
105
|
-
|
106
|
-
template <typename Filter>
|
107
|
-
void reset_cancellation_state(Filter&& filter)
|
108
|
-
{
|
109
|
-
base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
|
110
|
-
static_cast<Filter&&>(filter));
|
111
|
-
}
|
112
|
-
|
113
|
-
template <typename InFilter, typename OutFilter>
|
114
|
-
void reset_cancellation_state(InFilter&& in_filter,
|
115
|
-
OutFilter&& out_filter)
|
116
|
-
{
|
117
|
-
base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
|
118
|
-
static_cast<InFilter&&>(in_filter),
|
119
|
-
static_cast<OutFilter&&>(out_filter));
|
120
|
-
}
|
121
|
-
|
122
|
-
cancellation_type_t cancelled() const noexcept
|
123
|
-
{
|
124
|
-
return base_from_cancellation_state<Handler>::cancelled();
|
125
|
-
}
|
126
|
-
|
127
|
-
//private:
|
128
|
-
Impl impl_;
|
129
|
-
Work work_;
|
130
|
-
Handler handler_;
|
131
|
-
unsigned invocations_;
|
132
|
-
};
|
133
|
-
|
134
|
-
template <typename Impl, typename Work, typename Handler, typename Signature>
|
135
|
-
inline bool asio_handler_is_continuation(
|
136
|
-
composed_op<Impl, Work, Handler, Signature>* this_handler)
|
137
|
-
{
|
138
|
-
return this_handler->invocations_ > 1 ? true
|
139
|
-
: boost_asio_handler_cont_helpers::is_continuation(
|
140
|
-
this_handler->handler_);
|
141
|
-
}
|
142
|
-
|
143
|
-
template <typename Signature, typename Executors>
|
144
|
-
class initiate_composed_op
|
145
|
-
{
|
146
|
-
public:
|
147
|
-
typedef typename composed_io_executors<Executors>::head_type executor_type;
|
148
|
-
|
149
|
-
template <typename T>
|
150
|
-
explicit initiate_composed_op(int, T&& executors)
|
151
|
-
: executors_(static_cast<T&&>(executors))
|
152
|
-
{
|
153
|
-
}
|
154
|
-
|
155
|
-
executor_type get_executor() const noexcept
|
156
|
-
{
|
157
|
-
return executors_.head_;
|
158
|
-
}
|
159
|
-
|
160
|
-
template <typename Handler, typename Impl>
|
161
|
-
void operator()(Handler&& handler,
|
162
|
-
Impl&& impl) const
|
163
|
-
{
|
164
|
-
composed_op<decay_t<Impl>, composed_work<Executors>,
|
165
|
-
decay_t<Handler>, Signature>(
|
166
|
-
static_cast<Impl&&>(impl),
|
167
|
-
composed_work<Executors>(executors_),
|
168
|
-
static_cast<Handler&&>(handler))();
|
169
|
-
}
|
170
|
-
|
171
|
-
private:
|
172
|
-
composed_io_executors<Executors> executors_;
|
173
|
-
};
|
174
|
-
|
175
|
-
template <typename Signature, typename Executors>
|
176
|
-
inline initiate_composed_op<Signature, Executors> make_initiate_composed_op(
|
177
|
-
composed_io_executors<Executors>&& executors)
|
178
|
-
{
|
179
|
-
return initiate_composed_op<Signature, Executors>(0,
|
180
|
-
static_cast<composed_io_executors<Executors>&&>(executors));
|
181
|
-
}
|
182
|
-
|
183
|
-
} // namespace detail
|
184
|
-
|
185
|
-
#if !defined(GENERATING_DOCUMENTATION)
|
186
|
-
|
187
|
-
template <template <typename, typename> class Associator,
|
188
|
-
typename Impl, typename Work, typename Handler,
|
189
|
-
typename Signature, typename DefaultCandidate>
|
190
|
-
struct associator<Associator,
|
191
|
-
detail::composed_op<Impl, Work, Handler, Signature>,
|
192
|
-
DefaultCandidate>
|
193
|
-
: Associator<Handler, DefaultCandidate>
|
194
|
-
{
|
195
|
-
static typename Associator<Handler, DefaultCandidate>::type get(
|
196
|
-
const detail::composed_op<Impl, Work, Handler, Signature>& h) noexcept
|
197
|
-
{
|
198
|
-
return Associator<Handler, DefaultCandidate>::get(h.handler_);
|
199
|
-
}
|
200
|
-
|
201
|
-
static auto get(const detail::composed_op<Impl, Work, Handler, Signature>& h,
|
202
|
-
const DefaultCandidate& c) noexcept
|
203
|
-
-> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
|
204
|
-
{
|
205
|
-
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
|
206
|
-
}
|
207
|
-
};
|
208
|
-
|
209
|
-
#endif // !defined(GENERATING_DOCUMENTATION)
|
210
25
|
|
211
26
|
/// Launch an asynchronous operation with a stateful implementation.
|
212
27
|
/**
|
@@ -276,8 +91,8 @@ struct associator<Associator,
|
|
276
91
|
* template <typename CompletionToken>
|
277
92
|
* auto async_echo(tcp::socket& socket,
|
278
93
|
* boost::asio::mutable_buffer buffer,
|
279
|
-
* CompletionToken&& token)
|
280
|
-
* decltype(
|
94
|
+
* CompletionToken&& token)
|
95
|
+
* -> decltype(
|
281
96
|
* boost::asio::async_compose<CompletionToken,
|
282
97
|
* void(boost::system::error_code, std::size_t)>(
|
283
98
|
* std::declval<async_echo_implementation>(),
|
@@ -292,25 +107,19 @@ struct associator<Associator,
|
|
292
107
|
*/
|
293
108
|
template <typename CompletionToken, typename Signature,
|
294
109
|
typename Implementation, typename... IoObjectsOrExecutors>
|
295
|
-
auto async_compose(Implementation&& implementation,
|
110
|
+
inline auto async_compose(Implementation&& implementation,
|
296
111
|
type_identity_t<CompletionToken>& token,
|
297
112
|
IoObjectsOrExecutors&&... io_objects_or_executors)
|
298
113
|
-> decltype(
|
299
114
|
async_initiate<CompletionToken, Signature>(
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
static_cast<IoObjectsOrExecutors&&>(
|
304
|
-
io_objects_or_executors))...)),
|
305
|
-
token, static_cast<Implementation&&>(implementation)))
|
115
|
+
composed<Signature>(static_cast<Implementation&&>(implementation),
|
116
|
+
static_cast<IoObjectsOrExecutors&&>(io_objects_or_executors)...),
|
117
|
+
token))
|
306
118
|
{
|
307
119
|
return async_initiate<CompletionToken, Signature>(
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
static_cast<IoObjectsOrExecutors&&>(
|
312
|
-
io_objects_or_executors))...)),
|
313
|
-
token, static_cast<Implementation&&>(implementation));
|
120
|
+
composed<Signature>(static_cast<Implementation&&>(implementation),
|
121
|
+
static_cast<IoObjectsOrExecutors&&>(io_objects_or_executors)...),
|
122
|
+
token);
|
314
123
|
}
|
315
124
|
|
316
125
|
} // namespace asio
|
@@ -0,0 +1,415 @@
|
|
1
|
+
//
|
2
|
+
// composed.hpp
|
3
|
+
// ~~~~~~~~~~~~
|
4
|
+
//
|
5
|
+
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
6
|
+
//
|
7
|
+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
8
|
+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
9
|
+
//
|
10
|
+
|
11
|
+
#ifndef BOOST_ASIO_COMPOSED_HPP
|
12
|
+
#define BOOST_ASIO_COMPOSED_HPP
|
13
|
+
|
14
|
+
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
15
|
+
# pragma once
|
16
|
+
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
17
|
+
|
18
|
+
#include <boost/asio/detail/config.hpp>
|
19
|
+
#include <boost/asio/associated_executor.hpp>
|
20
|
+
#include <boost/asio/async_result.hpp>
|
21
|
+
#include <boost/asio/detail/base_from_cancellation_state.hpp>
|
22
|
+
#include <boost/asio/detail/composed_work.hpp>
|
23
|
+
#include <boost/asio/detail/handler_cont_helpers.hpp>
|
24
|
+
#include <boost/asio/detail/type_traits.hpp>
|
25
|
+
|
26
|
+
#include <boost/asio/detail/push_options.hpp>
|
27
|
+
|
28
|
+
namespace boost {
|
29
|
+
namespace asio {
|
30
|
+
namespace detail {
|
31
|
+
|
32
|
+
template <typename Impl, typename Work,
|
33
|
+
typename Handler, typename... Signatures>
|
34
|
+
class composed_op;
|
35
|
+
|
36
|
+
template <typename Impl, typename Work, typename Handler>
|
37
|
+
class composed_op<Impl, Work, Handler>
|
38
|
+
: public base_from_cancellation_state<Handler>
|
39
|
+
{
|
40
|
+
public:
|
41
|
+
template <typename I, typename W, typename H>
|
42
|
+
composed_op(I&& impl,
|
43
|
+
W&& work,
|
44
|
+
H&& handler)
|
45
|
+
: base_from_cancellation_state<Handler>(
|
46
|
+
handler, enable_terminal_cancellation()),
|
47
|
+
impl_(static_cast<I&&>(impl)),
|
48
|
+
work_(static_cast<W&&>(work)),
|
49
|
+
handler_(static_cast<H&&>(handler)),
|
50
|
+
invocations_(0)
|
51
|
+
{
|
52
|
+
}
|
53
|
+
|
54
|
+
composed_op(composed_op&& other)
|
55
|
+
: base_from_cancellation_state<Handler>(
|
56
|
+
static_cast<base_from_cancellation_state<Handler>&&>(other)),
|
57
|
+
impl_(static_cast<Impl&&>(other.impl_)),
|
58
|
+
work_(static_cast<Work&&>(other.work_)),
|
59
|
+
handler_(static_cast<Handler&&>(other.handler_)),
|
60
|
+
invocations_(other.invocations_)
|
61
|
+
{
|
62
|
+
}
|
63
|
+
|
64
|
+
typedef typename composed_work_guard<
|
65
|
+
typename Work::head_type>::executor_type io_executor_type;
|
66
|
+
|
67
|
+
io_executor_type get_io_executor() const noexcept
|
68
|
+
{
|
69
|
+
return work_.head_.get_executor();
|
70
|
+
}
|
71
|
+
|
72
|
+
typedef associated_executor_t<Handler, io_executor_type> executor_type;
|
73
|
+
|
74
|
+
executor_type get_executor() const noexcept
|
75
|
+
{
|
76
|
+
return (get_associated_executor)(handler_, work_.head_.get_executor());
|
77
|
+
}
|
78
|
+
|
79
|
+
typedef associated_allocator_t<Handler, std::allocator<void>> allocator_type;
|
80
|
+
|
81
|
+
allocator_type get_allocator() const noexcept
|
82
|
+
{
|
83
|
+
return (get_associated_allocator)(handler_, std::allocator<void>());
|
84
|
+
}
|
85
|
+
|
86
|
+
template <typename... T>
|
87
|
+
void operator()(T&&... t)
|
88
|
+
{
|
89
|
+
if (invocations_ < ~0u)
|
90
|
+
++invocations_;
|
91
|
+
this->get_cancellation_state().slot().clear();
|
92
|
+
impl_(*this, static_cast<T&&>(t)...);
|
93
|
+
}
|
94
|
+
|
95
|
+
template <typename... Args>
|
96
|
+
auto complete(Args&&... args)
|
97
|
+
-> decltype(declval<Handler>()(static_cast<Args&&>(args)...))
|
98
|
+
{
|
99
|
+
return static_cast<Handler&&>(this->handler_)(static_cast<Args&&>(args)...);
|
100
|
+
}
|
101
|
+
|
102
|
+
void reset_cancellation_state()
|
103
|
+
{
|
104
|
+
base_from_cancellation_state<Handler>::reset_cancellation_state(handler_);
|
105
|
+
}
|
106
|
+
|
107
|
+
template <typename Filter>
|
108
|
+
void reset_cancellation_state(Filter&& filter)
|
109
|
+
{
|
110
|
+
base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
|
111
|
+
static_cast<Filter&&>(filter));
|
112
|
+
}
|
113
|
+
|
114
|
+
template <typename InFilter, typename OutFilter>
|
115
|
+
void reset_cancellation_state(InFilter&& in_filter,
|
116
|
+
OutFilter&& out_filter)
|
117
|
+
{
|
118
|
+
base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
|
119
|
+
static_cast<InFilter&&>(in_filter),
|
120
|
+
static_cast<OutFilter&&>(out_filter));
|
121
|
+
}
|
122
|
+
|
123
|
+
cancellation_type_t cancelled() const noexcept
|
124
|
+
{
|
125
|
+
return base_from_cancellation_state<Handler>::cancelled();
|
126
|
+
}
|
127
|
+
|
128
|
+
//private:
|
129
|
+
Impl impl_;
|
130
|
+
Work work_;
|
131
|
+
Handler handler_;
|
132
|
+
unsigned invocations_;
|
133
|
+
};
|
134
|
+
|
135
|
+
template <typename Impl, typename Work, typename Handler,
|
136
|
+
typename R, typename... Args>
|
137
|
+
class composed_op<Impl, Work, Handler, R(Args...)>
|
138
|
+
: public composed_op<Impl, Work, Handler>
|
139
|
+
{
|
140
|
+
public:
|
141
|
+
using composed_op<Impl, Work, Handler>::composed_op;
|
142
|
+
|
143
|
+
template <typename... T>
|
144
|
+
void operator()(T&&... t)
|
145
|
+
{
|
146
|
+
if (this->invocations_ < ~0u)
|
147
|
+
++this->invocations_;
|
148
|
+
this->get_cancellation_state().slot().clear();
|
149
|
+
this->impl_(*this, static_cast<T&&>(t)...);
|
150
|
+
}
|
151
|
+
|
152
|
+
void complete(Args... args)
|
153
|
+
{
|
154
|
+
this->work_.reset();
|
155
|
+
static_cast<Handler&&>(this->handler_)(static_cast<Args&&>(args)...);
|
156
|
+
}
|
157
|
+
};
|
158
|
+
|
159
|
+
template <typename Impl, typename Work, typename Handler,
|
160
|
+
typename R, typename... Args, typename... Signatures>
|
161
|
+
class composed_op<Impl, Work, Handler, R(Args...), Signatures...>
|
162
|
+
: public composed_op<Impl, Work, Handler, Signatures...>
|
163
|
+
{
|
164
|
+
public:
|
165
|
+
using composed_op<Impl, Work, Handler, Signatures...>::composed_op;
|
166
|
+
|
167
|
+
template <typename... T>
|
168
|
+
void operator()(T&&... t)
|
169
|
+
{
|
170
|
+
if (this->invocations_ < ~0u)
|
171
|
+
++this->invocations_;
|
172
|
+
this->get_cancellation_state().slot().clear();
|
173
|
+
this->impl_(*this, static_cast<T&&>(t)...);
|
174
|
+
}
|
175
|
+
|
176
|
+
using composed_op<Impl, Work, Handler, Signatures...>::complete;
|
177
|
+
|
178
|
+
void complete(Args... args)
|
179
|
+
{
|
180
|
+
this->work_.reset();
|
181
|
+
static_cast<Handler&&>(this->handler_)(static_cast<Args&&>(args)...);
|
182
|
+
}
|
183
|
+
};
|
184
|
+
|
185
|
+
template <typename Impl, typename Work, typename Handler, typename Signature>
|
186
|
+
inline bool asio_handler_is_continuation(
|
187
|
+
composed_op<Impl, Work, Handler, Signature>* this_handler)
|
188
|
+
{
|
189
|
+
return this_handler->invocations_ > 1 ? true
|
190
|
+
: boost_asio_handler_cont_helpers::is_continuation(
|
191
|
+
this_handler->handler_);
|
192
|
+
}
|
193
|
+
|
194
|
+
template <typename Implementation, typename Executors, typename... Signatures>
|
195
|
+
class initiate_composed
|
196
|
+
{
|
197
|
+
public:
|
198
|
+
typedef typename composed_io_executors<Executors>::head_type executor_type;
|
199
|
+
|
200
|
+
template <typename I>
|
201
|
+
initiate_composed(I&& impl, composed_io_executors<Executors>&& executors)
|
202
|
+
: implementation_(std::forward<I>(impl)),
|
203
|
+
executors_(std::move(executors))
|
204
|
+
{
|
205
|
+
}
|
206
|
+
|
207
|
+
executor_type get_executor() const noexcept
|
208
|
+
{
|
209
|
+
return executors_.head_;
|
210
|
+
}
|
211
|
+
|
212
|
+
template <typename Handler, typename... Args>
|
213
|
+
void operator()(Handler&& handler, Args&&... args) const &
|
214
|
+
{
|
215
|
+
composed_op<decay_t<Implementation>, composed_work<Executors>,
|
216
|
+
decay_t<Handler>, Signatures...>(implementation_,
|
217
|
+
composed_work<Executors>(executors_),
|
218
|
+
static_cast<Handler&&>(handler))(static_cast<Args&&>(args)...);
|
219
|
+
}
|
220
|
+
|
221
|
+
template <typename Handler, typename... Args>
|
222
|
+
void operator()(Handler&& handler, Args&&... args) &&
|
223
|
+
{
|
224
|
+
composed_op<decay_t<Implementation>, composed_work<Executors>,
|
225
|
+
decay_t<Handler>, Signatures...>(
|
226
|
+
static_cast<Implementation&&>(implementation_),
|
227
|
+
composed_work<Executors>(executors_),
|
228
|
+
static_cast<Handler&&>(handler))(static_cast<Args&&>(args)...);
|
229
|
+
}
|
230
|
+
|
231
|
+
private:
|
232
|
+
Implementation implementation_;
|
233
|
+
composed_io_executors<Executors> executors_;
|
234
|
+
};
|
235
|
+
|
236
|
+
template <typename Implementation, typename... Signatures>
|
237
|
+
class initiate_composed<Implementation, void(), Signatures...>
|
238
|
+
{
|
239
|
+
public:
|
240
|
+
template <typename I>
|
241
|
+
initiate_composed(I&& impl, composed_io_executors<void()>&&)
|
242
|
+
: implementation_(std::forward<I>(impl))
|
243
|
+
{
|
244
|
+
}
|
245
|
+
|
246
|
+
template <typename Handler, typename... Args>
|
247
|
+
void operator()(Handler&& handler, Args&&... args) const &
|
248
|
+
{
|
249
|
+
composed_op<decay_t<Implementation>, composed_work<void()>,
|
250
|
+
decay_t<Handler>, Signatures...>(implementation_,
|
251
|
+
composed_work<void()>(composed_io_executors<void()>()),
|
252
|
+
static_cast<Handler&&>(handler))(static_cast<Args&&>(args)...);
|
253
|
+
}
|
254
|
+
|
255
|
+
template <typename Handler, typename... Args>
|
256
|
+
void operator()(Handler&& handler, Args&&... args) &&
|
257
|
+
{
|
258
|
+
composed_op<decay_t<Implementation>, composed_work<void()>,
|
259
|
+
decay_t<Handler>, Signatures...>(
|
260
|
+
static_cast<Implementation&&>(implementation_),
|
261
|
+
composed_work<void()>(composed_io_executors<void()>()),
|
262
|
+
static_cast<Handler&&>(handler))(static_cast<Args&&>(args)...);
|
263
|
+
}
|
264
|
+
|
265
|
+
private:
|
266
|
+
Implementation implementation_;
|
267
|
+
};
|
268
|
+
|
269
|
+
template <typename... Signatures, typename Implementation, typename Executors>
|
270
|
+
inline initiate_composed<Implementation, Executors, Signatures...>
|
271
|
+
make_initiate_composed(Implementation&& implementation,
|
272
|
+
composed_io_executors<Executors>&& executors)
|
273
|
+
{
|
274
|
+
return initiate_composed<decay_t<Implementation>, Executors, Signatures...>(
|
275
|
+
static_cast<Implementation&&>(implementation),
|
276
|
+
static_cast<composed_io_executors<Executors>&&>(executors));
|
277
|
+
}
|
278
|
+
|
279
|
+
} // namespace detail
|
280
|
+
|
281
|
+
#if !defined(GENERATING_DOCUMENTATION)
|
282
|
+
|
283
|
+
template <template <typename, typename> class Associator,
|
284
|
+
typename Impl, typename Work, typename Handler,
|
285
|
+
typename Signature, typename DefaultCandidate>
|
286
|
+
struct associator<Associator,
|
287
|
+
detail::composed_op<Impl, Work, Handler, Signature>,
|
288
|
+
DefaultCandidate>
|
289
|
+
: Associator<Handler, DefaultCandidate>
|
290
|
+
{
|
291
|
+
static typename Associator<Handler, DefaultCandidate>::type get(
|
292
|
+
const detail::composed_op<Impl, Work, Handler, Signature>& h) noexcept
|
293
|
+
{
|
294
|
+
return Associator<Handler, DefaultCandidate>::get(h.handler_);
|
295
|
+
}
|
296
|
+
|
297
|
+
static auto get(const detail::composed_op<Impl, Work, Handler, Signature>& h,
|
298
|
+
const DefaultCandidate& c) noexcept
|
299
|
+
-> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
|
300
|
+
{
|
301
|
+
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
|
302
|
+
}
|
303
|
+
};
|
304
|
+
|
305
|
+
#endif // !defined(GENERATING_DOCUMENTATION)
|
306
|
+
|
307
|
+
/// Creates an initiation function object that may be used to launch an
|
308
|
+
/// asynchronous operation with a stateful implementation.
|
309
|
+
/**
|
310
|
+
* The @c composed function simplifies the implementation of composed
|
311
|
+
* asynchronous operations automatically by wrapping a stateful function object
|
312
|
+
* for use as an initiation function object.
|
313
|
+
*
|
314
|
+
* @param implementation A function object that contains the implementation of
|
315
|
+
* the composed asynchronous operation. The first argument to the function
|
316
|
+
* object is a non-const reference to the enclosing intermediate completion
|
317
|
+
* handler. The remaining arguments are any arguments that originate from the
|
318
|
+
* completion handlers of any asynchronous operations performed by the
|
319
|
+
* implementation.
|
320
|
+
*
|
321
|
+
* @param io_objects_or_executors Zero or more I/O objects or I/O executors for
|
322
|
+
* which outstanding work must be maintained.
|
323
|
+
*
|
324
|
+
* @par Per-Operation Cancellation
|
325
|
+
* By default, terminal per-operation cancellation is enabled for composed
|
326
|
+
* operations that are implemented using @c composed. To disable cancellation
|
327
|
+
* for the composed operation, or to alter its supported cancellation types,
|
328
|
+
* call the @c self object's @c reset_cancellation_state function.
|
329
|
+
*
|
330
|
+
* @par Example:
|
331
|
+
*
|
332
|
+
* @code struct async_echo_implementation
|
333
|
+
* {
|
334
|
+
* tcp::socket& socket_;
|
335
|
+
* boost::asio::mutable_buffer buffer_;
|
336
|
+
* enum { starting, reading, writing } state_;
|
337
|
+
*
|
338
|
+
* template <typename Self>
|
339
|
+
* void operator()(Self& self,
|
340
|
+
* boost::system::error_code error,
|
341
|
+
* std::size_t n)
|
342
|
+
* {
|
343
|
+
* switch (state_)
|
344
|
+
* {
|
345
|
+
* case starting:
|
346
|
+
* state_ = reading;
|
347
|
+
* socket_.async_read_some(
|
348
|
+
* buffer_, std::move(self));
|
349
|
+
* break;
|
350
|
+
* case reading:
|
351
|
+
* if (error)
|
352
|
+
* {
|
353
|
+
* self.complete(error, 0);
|
354
|
+
* }
|
355
|
+
* else
|
356
|
+
* {
|
357
|
+
* state_ = writing;
|
358
|
+
* boost::asio::async_write(socket_, buffer_,
|
359
|
+
* boost::asio::transfer_exactly(n),
|
360
|
+
* std::move(self));
|
361
|
+
* }
|
362
|
+
* break;
|
363
|
+
* case writing:
|
364
|
+
* self.complete(error, n);
|
365
|
+
* break;
|
366
|
+
* }
|
367
|
+
* }
|
368
|
+
* };
|
369
|
+
*
|
370
|
+
* template <typename CompletionToken>
|
371
|
+
* auto async_echo(tcp::socket& socket,
|
372
|
+
* boost::asio::mutable_buffer buffer,
|
373
|
+
* CompletionToken&& token)
|
374
|
+
* -> decltype(
|
375
|
+
* boost::asio::async_initiate<CompletionToken,
|
376
|
+
* void(boost::system::error_code, std::size_t)>(
|
377
|
+
* boost::asio::composed(
|
378
|
+
* async_echo_implementation{socket, buffer,
|
379
|
+
* async_echo_implementation::starting}, socket),
|
380
|
+
* token))
|
381
|
+
* {
|
382
|
+
* return boost::asio::async_initiate<CompletionToken,
|
383
|
+
* void(boost::system::error_code, std::size_t)>(
|
384
|
+
* boost::asio::composed(
|
385
|
+
* async_echo_implementation{socket, buffer,
|
386
|
+
* async_echo_implementation::starting}, socket),
|
387
|
+
* token, boost::system::error_code{}, 0);
|
388
|
+
* } @endcode
|
389
|
+
*/
|
390
|
+
template <BOOST_ASIO_COMPLETION_SIGNATURE... Signatures,
|
391
|
+
typename Implementation, typename... IoObjectsOrExecutors>
|
392
|
+
inline auto composed(Implementation&& implementation,
|
393
|
+
IoObjectsOrExecutors&&... io_objects_or_executors)
|
394
|
+
-> decltype(
|
395
|
+
detail::make_initiate_composed<Signatures...>(
|
396
|
+
static_cast<Implementation&&>(implementation),
|
397
|
+
detail::make_composed_io_executors(
|
398
|
+
detail::get_composed_io_executor(
|
399
|
+
static_cast<IoObjectsOrExecutors&&>(
|
400
|
+
io_objects_or_executors))...)))
|
401
|
+
{
|
402
|
+
return detail::make_initiate_composed<Signatures...>(
|
403
|
+
static_cast<Implementation&&>(implementation),
|
404
|
+
detail::make_composed_io_executors(
|
405
|
+
detail::get_composed_io_executor(
|
406
|
+
static_cast<IoObjectsOrExecutors&&>(
|
407
|
+
io_objects_or_executors))...));
|
408
|
+
}
|
409
|
+
|
410
|
+
} // namespace asio
|
411
|
+
} // namespace boost
|
412
|
+
|
413
|
+
#include <boost/asio/detail/pop_options.hpp>
|
414
|
+
|
415
|
+
#endif // BOOST_ASIO_COMPOSE_HPP
|