passenger 5.1.12 → 5.2.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG +18 -1
- data/Rakefile +4 -1
- data/build/agent.rb +2 -2
- data/build/apache2.rb +17 -10
- data/build/basics.rb +18 -4
- data/build/common_library.rb +7 -3
- data/build/cxx_tests.rb +2 -7
- data/build/misc.rb +3 -1
- data/build/nginx.rb +11 -5
- data/build/oxt_tests.rb +0 -3
- data/build/packaging.rb +3 -2
- data/build/schema_printer.rb +103 -0
- data/build/support/cplusplus.rb +2 -2
- data/build/support/cxx_dependency_map.rb +2575 -868
- data/dev/ci/lib/functions.sh +1 -1
- data/dev/ci/lib/set-container-envvars.sh +1 -1
- data/dev/ci/lib/setup-container.sh +1 -1
- data/dev/ci/run-tests-natively +1 -1
- data/dev/ci/run-tests-with-docker +1 -1
- data/dev/ci/scripts/debug-console-wrapper.sh +1 -1
- data/dev/ci/scripts/docker-entrypoint-stage2.sh +1 -1
- data/dev/ci/scripts/docker-entrypoint.sh +1 -1
- data/dev/ci/scripts/inituidgid +1 -1
- data/dev/ci/scripts/run-tests-natively-stage2.sh +1 -1
- data/dev/ci/scripts/setup-host-natively.sh +1 -1
- data/dev/ci/setup-host +1 -1
- data/dev/ci/tests/apache2/run +1 -1
- data/dev/ci/tests/apache2/setup +1 -1
- data/dev/ci/tests/cxx/run +1 -1
- data/dev/ci/tests/cxx/setup +1 -1
- data/dev/ci/tests/debian/Jenkinsfile +0 -1
- data/dev/ci/tests/debian/run +1 -1
- data/dev/ci/tests/nginx-dynamic/run +1 -1
- data/dev/ci/tests/nginx-dynamic/setup +1 -1
- data/dev/ci/tests/nginx/run +1 -1
- data/dev/ci/tests/nginx/setup +1 -1
- data/dev/ci/tests/nodejs/run +1 -1
- data/dev/ci/tests/nodejs/setup +1 -1
- data/dev/ci/tests/rpm/run +1 -1
- data/dev/ci/tests/ruby/run +1 -1
- data/dev/ci/tests/ruby/setup +1 -1
- data/dev/ci/tests/source-packaging/run +1 -1
- data/dev/ci/tests/source-packaging/setup +1 -1
- data/dev/ci/tests/standalone/run +1 -1
- data/dev/ci/tests/standalone/setup +1 -1
- data/dev/configkit-schemas/index.json +1708 -0
- data/dev/configkit-schemas/update_schema_inline_comments.rb +118 -0
- data/dev/copy_boost_headers +13 -1
- data/dev/index_cxx_dependencies.rb +20 -7
- data/dev/vagrant/provision.sh +1 -1
- data/resources/mime.types +1 -0
- data/resources/templates/standalone/http.erb +1 -6
- data/src/agent/Core/AdminPanelConnector.h +550 -0
- data/src/agent/Core/ApiServer.h +159 -97
- data/src/agent/Core/ApplicationPool/Group.h +2 -0
- data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +3 -2
- data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +109 -0
- data/src/agent/Core/ApplicationPool/Implementation.cpp +5 -3
- data/src/agent/Core/ApplicationPool/Options.h +5 -6
- data/src/agent/Core/ApplicationPool/Pool.h +59 -2
- data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +3 -3
- data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +2 -2
- data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +6 -0
- data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +129 -0
- data/src/agent/Core/Config.h +475 -0
- data/src/agent/Core/ConfigChange.cpp +349 -0
- data/src/agent/Core/ConfigChange.h +54 -0
- data/src/agent/Core/Controller.h +35 -3
- data/src/agent/Core/Controller/CheckoutSession.cpp +1 -1
- data/src/agent/Core/Controller/Config.cpp +0 -2
- data/src/agent/Core/Controller/Config.h +168 -104
- data/src/agent/Core/Controller/ForwardResponse.cpp +1 -1
- data/src/agent/Core/Controller/InitRequest.cpp +14 -15
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +34 -44
- data/src/agent/Core/Controller/Request.h +0 -1
- data/src/agent/Core/CoreMain.cpp +236 -349
- data/src/agent/Core/OptionParser.h +75 -89
- data/src/agent/Core/SecurityUpdateChecker.h +263 -100
- data/src/agent/Core/SpawningKit/Config.h +6 -2
- data/src/agent/Core/SpawningKit/Spawner.h +0 -45
- data/src/agent/Core/SpawningKit/UserSwitchingRules.h +1 -0
- data/src/agent/Shared/ApiAccountUtils.h +318 -0
- data/src/agent/Shared/ApiServerUtils.h +3 -104
- data/src/agent/Shared/Fundamentals/Initialization.cpp +81 -44
- data/src/agent/Shared/Fundamentals/Initialization.h +12 -7
- data/src/agent/TempDirToucher/TempDirToucherMain.cpp +21 -0
- data/src/agent/Watchdog/AgentWatcher.cpp +1 -1
- data/src/agent/Watchdog/ApiServer.h +100 -14
- data/src/agent/Watchdog/Config.h +340 -0
- data/src/agent/Watchdog/CoreWatcher.cpp +27 -13
- data/src/agent/Watchdog/InstanceDirToucher.cpp +1 -1
- data/src/agent/Watchdog/WatchdogMain.cpp +190 -206
- data/src/apache2_module/Bucket.cpp +4 -0
- data/src/apache2_module/Bucket.h +7 -3
- data/src/apache2_module/CBindings.cpp +49 -0
- data/src/apache2_module/Config.cpp +242 -0
- data/src/apache2_module/Config.h +109 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +485 -0
- data/src/apache2_module/{ConfigurationCommands.cpp.cxxcodebuilder → ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder} +29 -15
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +298 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp.cxxcodebuilder +171 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +854 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +188 -0
- data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +610 -0
- data/src/apache2_module/ConfigGeneral/SetterFuncs.h +65 -0
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +174 -0
- data/src/apache2_module/{MergeDirConfig.cpp.cxxcodebuilder → DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder} +54 -32
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +113 -0
- data/src/apache2_module/{SetHeaders.cpp.cxxcodebuilder → DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder} +34 -23
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +426 -0
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +165 -0
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +269 -0
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +148 -0
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +534 -0
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +230 -0
- data/src/apache2_module/DirectoryMapper.h +19 -16
- data/src/apache2_module/Hooks.cpp +124 -138
- data/src/apache2_module/Hooks.h +9 -14
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +263 -0
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +152 -0
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +299 -0
- data/src/apache2_module/{ConfigurationFields.hpp.cxxcodebuilder → ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder} +105 -18
- data/src/apache2_module/Utils.h +215 -0
- data/src/apache2_module/mod_passenger.c +16 -8
- data/src/cxx_supportlib/AppTypes.h +2 -0
- data/src/cxx_supportlib/ConfigKit/ConfigKit.h +1 -1
- data/src/cxx_supportlib/ConfigKit/DummyTranslator.h +8 -8
- data/src/cxx_supportlib/ConfigKit/IN_PRACTICE.md +7 -41
- data/src/cxx_supportlib/ConfigKit/PrefixTranslator.h +12 -66
- data/src/cxx_supportlib/ConfigKit/Schema.h +62 -11
- data/src/cxx_supportlib/ConfigKit/{ValidationUtils.h → SchemaUtils.h} +12 -3
- data/src/cxx_supportlib/ConfigKit/Store.h +17 -9
- data/src/cxx_supportlib/ConfigKit/SubComponentUtils.h +2 -1
- data/src/cxx_supportlib/ConfigKit/TableTranslator.h +13 -70
- data/src/cxx_supportlib/ConfigKit/Translator.h +125 -0
- data/src/cxx_supportlib/Constants.h +1 -3
- data/src/cxx_supportlib/FileTools/FileManip.cpp +297 -0
- data/src/cxx_supportlib/FileTools/FileManip.h +162 -0
- data/src/cxx_supportlib/{Utils → FileTools}/LargeFiles.cpp +6 -3
- data/src/cxx_supportlib/{Utils → FileTools}/LargeFiles.h +7 -5
- data/src/cxx_supportlib/FileTools/PathManip.cpp +240 -0
- data/src/cxx_supportlib/FileTools/PathManip.h +91 -0
- data/src/cxx_supportlib/FileTools/PathManipCBindings.cpp +62 -0
- data/src/{apache2_module/Configuration.h → cxx_supportlib/FileTools/PathManipCBindings.h} +12 -19
- data/src/cxx_supportlib/Hooks.h +19 -16
- data/src/cxx_supportlib/InstanceDirectory.h +11 -0
- data/src/cxx_supportlib/JsonTools/Autocast.h +79 -0
- data/src/cxx_supportlib/JsonTools/CBindings.cpp +364 -0
- data/src/cxx_supportlib/JsonTools/CBindings.h +101 -0
- data/src/cxx_supportlib/LoggingKit/Config.h +13 -0
- data/src/cxx_supportlib/LoggingKit/Context.h +5 -2
- data/src/cxx_supportlib/LoggingKit/Forward.h +0 -1
- data/src/cxx_supportlib/LoggingKit/Implementation.cpp +12 -4
- data/src/cxx_supportlib/ResourceLocator.h +15 -0
- data/src/cxx_supportlib/ServerKit/Config.h +156 -0
- data/src/cxx_supportlib/ServerKit/Context.h +59 -38
- data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +3 -2
- data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpServer.h +16 -2
- data/src/cxx_supportlib/ServerKit/Server.h +32 -15
- data/src/cxx_supportlib/Utils.cpp +0 -441
- data/src/cxx_supportlib/Utils.h +0 -158
- data/src/cxx_supportlib/Utils/Curl.h +1 -0
- data/src/cxx_supportlib/Utils/ProcessMetricsCollector.h +1 -0
- data/src/cxx_supportlib/Utils/StrIntUtilsNoStrictAliasing.cpp +2 -0
- data/src/cxx_supportlib/Utils/VariantMap.h +31 -0
- data/src/cxx_supportlib/WatchdogLauncher.cpp +7 -79
- data/src/cxx_supportlib/WatchdogLauncher.h +50 -53
- data/src/cxx_supportlib/WebSocketCommandReverseServer.h +981 -0
- data/src/cxx_supportlib/oxt/macros.hpp +9 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/COPYING +145 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/changelog.md +342 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/readme.md +49 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/base64/base64.hpp +178 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/client.hpp +33 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/close.hpp +342 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/asio.hpp +131 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/asio_ssl.hpp +39 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/chrono.hpp +68 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/connection_hdl.hpp +52 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/cpp11.hpp +162 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/functional.hpp +105 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/md5.hpp +448 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/memory.hpp +89 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/network.hpp +106 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/platforms.hpp +46 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/random.hpp +82 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/regex.hpp +59 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/stdint.hpp +73 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/system_error.hpp +84 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/thread.hpp +84 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/time.hpp +56 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/type_traits.hpp +65 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/concurrency/basic.hpp +46 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/concurrency/none.hpp +80 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/asio.hpp +77 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/asio_client.hpp +77 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/asio_no_tls.hpp +73 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/asio_no_tls_client.hpp +73 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/boost_config.hpp +72 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/core.hpp +285 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/core_client.hpp +294 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/debug.hpp +286 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/debug_asio.hpp +77 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/debug_asio_no_tls.hpp +73 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/minimal_client.hpp +72 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/minimal_server.hpp +312 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/connection.hpp +1651 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/connection_base.hpp +38 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/endpoint.hpp +700 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/endpoint_base.hpp +38 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/error.hpp +277 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/extensions/extension.hpp +102 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/extensions/permessage_deflate/disabled.hpp +128 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/extensions/permessage_deflate/enabled.hpp +752 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/frame.hpp +861 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/constants.hpp +308 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/impl/parser.hpp +196 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/impl/request.hpp +191 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/impl/response.hpp +266 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/parser.hpp +619 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/request.hpp +124 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/response.hpp +188 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/impl/connection_impl.hpp +2372 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/impl/endpoint_impl.hpp +269 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/impl/utilities_impl.hpp +87 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/logger/basic.hpp +199 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/logger/levels.hpp +203 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/logger/stub.hpp +119 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/logger/syslog.hpp +146 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/message_buffer/alloc.hpp +105 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/message_buffer/message.hpp +340 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/message_buffer/pool.hpp +229 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/base.hpp +299 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/hybi00.hpp +462 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/hybi07.hpp +78 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/hybi08.hpp +83 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/hybi13.hpp +1056 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/processor.hpp +407 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/random/none.hpp +60 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/random/random_device.hpp +80 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/roles/client_endpoint.hpp +173 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/roles/server_endpoint.hpp +190 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/server.hpp +33 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/sha1/sha1.hpp +189 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/base.hpp +232 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/connection.hpp +1204 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/endpoint.hpp +1147 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/security/base.hpp +159 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/security/none.hpp +370 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/security/tls.hpp +484 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/base/connection.hpp +238 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/base/endpoint.hpp +77 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/debug/base.hpp +104 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/debug/connection.hpp +412 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/debug/endpoint.hpp +140 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/iostream/base.hpp +133 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/iostream/connection.hpp +714 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/iostream/endpoint.hpp +222 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/stub/base.hpp +95 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/stub/connection.hpp +286 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/stub/endpoint.hpp +140 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/uri.hpp +355 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/utf8_validator.hpp +154 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/utilities.hpp +182 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/version.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/async_result.hpp +96 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +951 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +520 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_io_object.hpp +258 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +942 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +567 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +697 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +386 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +1519 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +1137 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_iostream.hpp +288 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_streambuf.hpp +569 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +854 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_streambuf.hpp +371 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_streambuf_fwd.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +521 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffer.hpp +2241 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_read_stream.hpp +246 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_read_stream_fwd.hpp +27 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_stream.hpp +260 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_stream_fwd.hpp +27 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_write_stream.hpp +238 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_write_stream_fwd.hpp +27 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffers_iterator.hpp +483 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/completion_condition.hpp +220 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/connect.hpp +825 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/coroutine.hpp +330 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/datagram_socket_service.hpp +438 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/deadline_timer.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/deadline_timer_service.hpp +173 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/addressof.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/array.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/array_fwd.hpp +34 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/assert.hpp +32 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/atomic_count.hpp +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/base_from_completion_cond.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/bind_handler.hpp +491 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffer_resize_guard.hpp +68 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffer_sequence_adapter.hpp +385 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffered_stream_storage.hpp +128 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/call_stack.hpp +127 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/chrono_time_traits.hpp +192 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/completion_handler.hpp +83 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +1050 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/consuming_buffers.hpp +294 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/cstdint.hpp +48 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/date_time_fwd.hpp +34 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/deadline_timer_service.hpp +229 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/dependent_type.hpp +38 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/descriptor_ops.hpp +119 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/descriptor_read_op.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/descriptor_write_op.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/dev_poll_reactor.hpp +208 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/epoll_reactor.hpp +244 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/event.hpp +50 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/eventfd_select_interrupter.hpp +85 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/fd_set_adapter.hpp +41 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/fenced_block.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/function.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_arm_fenced_block.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_hppa_fenced_block.hpp +68 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_sync_fenced_block.hpp +65 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_x86_fenced_block.hpp +99 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_cont_helpers.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_invoke_helpers.hpp +57 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_tracking.hpp +161 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_type_requirements.hpp +480 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/hash_map.hpp +333 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/buffer_sequence_adapter.ipp +120 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +453 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/dev_poll_reactor.hpp +80 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/dev_poll_reactor.ipp +432 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/epoll_reactor.hpp +78 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/epoll_reactor.ipp +688 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/eventfd_select_interrupter.ipp +167 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/handler_tracking.ipp +307 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/kqueue_reactor.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/kqueue_reactor.ipp +498 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/pipe_select_interrupter.ipp +126 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_event.ipp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_mutex.ipp +48 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_thread.ipp +76 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_tss_ptr.ipp +48 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_descriptor_service.ipp +210 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_serial_port_service.ipp +153 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_socket_service_base.ipp +269 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/resolver_service_base.ipp +132 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.hpp +89 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.ipp +315 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/service_registry.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/service_registry.ipp +190 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/signal_set_service.ipp +649 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +3470 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_select_interrupter.ipp +178 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_service.hpp +120 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_service.ipp +178 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/task_io_service.hpp +80 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/task_io_service.ipp +476 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/throw_error.ipp +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/timer_queue_ptime.ipp +86 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/timer_queue_set.ipp +103 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/io_control.hpp +136 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/keyword_tss_ptr.hpp +72 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/kqueue_reactor.hpp +222 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/limits.hpp +26 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/local_free_on_block_exit.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/macos_fenced_block.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +31 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/mutex.hpp +50 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/noncopyable.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_event.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_fenced_block.hpp +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_mutex.hpp +66 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_reactor.hpp +69 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_signal_blocker.hpp +71 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_socket_service.hpp +500 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_static_mutex.hpp +62 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_thread.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_tss_ptr.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/object_pool.hpp +148 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/old_win_sdk_compat.hpp +216 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/op_queue.hpp +158 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/operation.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/pipe_select_interrupter.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/pop_options.hpp +131 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_event.hpp +128 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_fd_set_adapter.hpp +120 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_mutex.hpp +78 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_signal_blocker.hpp +87 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_static_mutex.hpp +66 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_thread.hpp +107 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_tss_ptr.hpp +81 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/push_options.hpp +166 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_descriptor_service.hpp +324 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_null_buffers_op.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_serial_port_service.hpp +236 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_accept_op.hpp +138 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_connect_op.hpp +108 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_recv_op.hpp +125 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_recvfrom_op.hpp +135 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_recvmsg_op.hpp +127 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_send_op.hpp +122 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_sendto_op.hpp +125 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service.hpp +460 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service_base.hpp +452 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor.hpp +32 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor_fwd.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor_op.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor_op_queue.hpp +170 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/regex_fwd.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_endpoint_op.hpp +123 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_op.hpp +133 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolver_service.hpp +131 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolver_service_base.hpp +131 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/scoped_lock.hpp +103 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/scoped_ptr.hpp +81 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/select_interrupter.hpp +48 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/select_reactor.hpp +221 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/service_registry.hpp +146 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/shared_ptr.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_blocker.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_handler.hpp +84 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_init.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_op.hpp +51 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_set_service.hpp +218 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_holder.hpp +100 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_ops.hpp +336 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_option.hpp +318 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_select_interrupter.hpp +93 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_types.hpp +410 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/solaris_fenced_block.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/static_mutex.hpp +54 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_event.hpp +178 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_fenced_block.hpp +64 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_mutex.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_static_mutex.hpp +83 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_thread.hpp +67 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/strand_service.hpp +144 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/task_io_service.hpp +203 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/task_io_service_operation.hpp +78 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/task_io_service_thread_info.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread.hpp +58 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread_info_base.hpp +93 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/throw_error.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/throw_exception.hpp +53 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue.hpp +333 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue_base.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue_ptime.hpp +95 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue_set.hpp +68 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_scheduler.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_scheduler_fwd.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/tss_ptr.hpp +71 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/type_traits.hpp +60 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/variadic_templates.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wait_handler.hpp +85 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wait_op.hpp +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/weak_ptr.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/win_iocp_serial_port_service.hpp +230 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/winsock_init.hpp +130 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wrapped_handler.hpp +293 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/error.hpp +345 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/basic_endpoint.hpp +195 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/datagram_protocol.hpp +125 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/detail/endpoint.hpp +135 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/detail/impl/endpoint.ipp +111 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/raw_protocol.hpp +123 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/seq_packet_protocol.hpp +124 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/stream_protocol.hpp +129 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_alloc_hook.hpp +83 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_continuation_hook.hpp +56 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_invoke_hook.hpp +87 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_type.hpp +114 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/high_resolution_timer.hpp +65 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_read_stream.hpp +360 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_write_stream.hpp +340 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +432 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/error.ipp +130 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/handler_alloc_hook.ipp +79 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/io_service.hpp +156 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/io_service.ipp +157 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +755 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +812 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +1149 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/serial_port_base.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/serial_port_base.ipp +556 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +355 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.cpp +25 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.hpp +73 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/use_future.hpp +179 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +767 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +827 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/io_service.hpp +772 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address.hpp +202 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address_v4.hpp +243 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address_v6.hpp +248 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_endpoint.hpp +265 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver.hpp +270 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_entry.hpp +96 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_iterator.hpp +262 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_query.hpp +246 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/endpoint.hpp +141 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/impl/endpoint.ipp +206 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/socket_option.hpp +571 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/host_name.hpp +44 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/icmp.hpp +117 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address.ipp +228 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v4.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v4.ipp +180 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v6.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v6.ipp +300 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/basic_endpoint.hpp +57 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/host_name.ipp +56 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/multicast.hpp +193 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/resolver_query_base.hpp +132 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/resolver_service.hpp +178 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/tcp.hpp +157 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/udp.hpp +113 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/unicast.hpp +72 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/v6_only.hpp +71 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/is_read_buffered.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/is_write_buffered.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/basic_endpoint.hpp +241 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/connect_pair.hpp +106 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/datagram_protocol.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/detail/endpoint.hpp +135 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/detail/impl/endpoint.ipp +130 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/stream_protocol.hpp +92 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/placeholders.hpp +125 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +492 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +364 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/descriptor_base.hpp +99 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/stream_descriptor.hpp +39 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/stream_descriptor_service.hpp +262 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/raw_socket_service.hpp +438 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/read.hpp +633 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_at.hpp +666 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_until.hpp +925 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/seq_packet_socket_service.hpp +386 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/serial_port.hpp +38 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/serial_port_base.hpp +169 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/serial_port_service.hpp +255 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/signal_set.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/signal_set_service.hpp +136 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/socket_acceptor_service.hpp +308 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/socket_base.hpp +522 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +267 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/basic_context.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/context.hpp +789 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/context_base.hpp +194 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/context_service.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/buffered_handshake_op.hpp +112 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/engine.hpp +166 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/handshake_op.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/impl/engine.ipp +327 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/impl/openssl_init.ipp +166 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/io.hpp +351 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/openssl_init.hpp +103 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/openssl_types.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/password_callback.hpp +74 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/read_op.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/shutdown_op.hpp +62 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/stream_core.hpp +128 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/verify_callback.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/write_op.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/error.hpp +115 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/context.hpp +73 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/context.ipp +1177 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/error.ipp +102 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/rfc2818_verification.ipp +168 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/src.hpp +28 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/basic_context.hpp +436 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/context_service.hpp +176 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/detail/openssl_context_service.hpp +396 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/detail/openssl_operation.hpp +526 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/detail/openssl_stream_service.hpp +573 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/stream.hpp +503 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/stream_service.hpp +186 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/rfc2818_verification.hpp +102 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream.hpp +758 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream_base.hpp +54 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream_service.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/verify_context.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/verify_mode.hpp +65 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/steady_timer.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/strand.hpp +254 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/stream_socket_service.hpp +382 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/streambuf.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/system_timer.hpp +59 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/time_traits.hpp +88 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/unyield.hpp +21 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/use_future.hpp +94 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +23 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/wait_traits.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/waitable_timer_service.hpp +170 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_handle.hpp +283 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_object_handle.hpp +180 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_random_access_handle.hpp +378 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_stream_handle.hpp +361 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/object_handle.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/object_handle_service.hpp +179 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/overlapped_ptr.hpp +118 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/random_access_handle.hpp +39 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/random_access_handle_service.hpp +222 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/stream_handle.hpp +39 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/stream_handle_service.hpp +220 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/write.hpp +620 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/write_at.hpp +672 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/yield.hpp +23 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono.hpp +20 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/chrono.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/chrono_io.hpp +34 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/chrono.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/chrono.hpp +242 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp +356 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/thread_clock.hpp +92 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/posix/chrono.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp +354 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/posix/thread_clock.hpp +92 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/process_cpu_clocks.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/thread_clock.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp +54 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/scan_keyword.hpp +163 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/floor.hpp +36 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/include.hpp +23 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_get.hpp +593 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_io.hpp +295 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_put.hpp +317 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_style.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_units.hpp +1003 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/ios_base_state.hpp +152 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_get.hpp +330 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_io.hpp +1243 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_put.hpp +261 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_units.hpp +260 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/timezone.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/ios_base_state_ptr.hpp +437 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/manip_base.hpp +101 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/to_string.hpp +50 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io_v1/chrono_io.hpp +637 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/process_cpu_clocks.hpp +525 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/round.hpp +59 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/thread_clock.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/typeof/boost/chrono/chrono.hpp +32 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/typeof/boost/ratio.hpp +24 -0
- data/src/cxx_supportlib/vendor-modified/boost/detail/atomic_count.hpp +21 -0
- data/src/cxx_supportlib/vendor-modified/boost/integer/common_factor.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/integer/common_factor_rt.hpp +460 -0
- data/src/cxx_supportlib/vendor-modified/boost/integer/integer_log2.hpp +112 -0
- data/src/cxx_supportlib/vendor-modified/boost/integer/integer_mask.hpp +126 -0
- data/src/cxx_supportlib/vendor-modified/boost/integer/static_min_max.hpp +51 -0
- data/src/cxx_supportlib/vendor-modified/boost/libs/chrono/src/chrono.cpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/libs/chrono/src/process_cpu_clocks.cpp +18 -0
- data/src/cxx_supportlib/vendor-modified/boost/libs/chrono/src/thread_clock.cpp +19 -0
- data/src/cxx_supportlib/vendor-modified/boost/libs/random/src/random_device.cpp +250 -0
- data/src/cxx_supportlib/vendor-modified/boost/pointer_cast.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/random.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/additive_combine.hpp +283 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/bernoulli_distribution.hpp +197 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/beta_distribution.hpp +184 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/binomial_distribution.hpp +434 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/cauchy_distribution.hpp +214 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/chi_squared_distribution.hpp +209 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/auto_link.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/config.hpp +18 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/const_mod.hpp +216 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/disable_warnings.hpp +29 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/enable_warnings.hpp +22 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/generator_bits.hpp +36 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/generator_seed_seq.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/int_float_pair.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/integer_log2.hpp +84 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/iterator_mixin.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/large_arithmetic.hpp +122 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/operators.hpp +84 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/polynomial.hpp +384 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/ptr_helper.hpp +67 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/seed.hpp +115 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/seed_impl.hpp +398 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/signed_unsigned_tools.hpp +89 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/uniform_int_float.hpp +76 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/vector_io.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/discard_block.hpp +241 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/discrete_distribution.hpp +636 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/exponential_distribution.hpp +386 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/extreme_value_distribution.hpp +177 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/fisher_f_distribution.hpp +183 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/gamma_distribution.hpp +292 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/generate_canonical.hpp +96 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/geometric_distribution.hpp +267 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/hyperexponential_distribution.hpp +883 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/independent_bits.hpp +271 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/inversive_congruential.hpp +267 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/lagged_fibonacci.hpp +537 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/laplace_distribution.hpp +175 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/linear_congruential.hpp +466 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/linear_feedback_shift.hpp +217 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/lognormal_distribution.hpp +254 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/mersenne_twister.hpp +682 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/negative_binomial_distribution.hpp +220 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/non_central_chi_squared_distribution.hpp +221 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/normal_distribution.hpp +374 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/piecewise_constant_distribution.hpp +466 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/piecewise_linear_distribution.hpp +531 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/poisson_distribution.hpp +360 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/random_device.hpp +143 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/random_number_generator.hpp +73 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/ranlux.hpp +99 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/seed_seq.hpp +118 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/shuffle_order.hpp +269 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/shuffle_output.hpp +51 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/student_t_distribution.hpp +180 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/subtract_with_carry.hpp +613 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/taus88.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/traits.hpp +107 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/triangle_distribution.hpp +232 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_01.hpp +257 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_int.hpp +99 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_int_distribution.hpp +419 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_on_sphere.hpp +284 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_real.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_real_distribution.hpp +241 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_smallint.hpp +307 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/variate_generator.hpp +122 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/weibull_distribution.hpp +177 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/xor_combine.hpp +208 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio.hpp +14 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/detail/ratio_io.hpp +1342 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/include.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/abs.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/arithmetic.hpp +22 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/comparison.hpp +19 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/divides.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/equal_to.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/gcd.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/greater.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/greater_equal.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/lcm.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/less.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/less_equal.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/minus.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/negate.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/not_equal_to.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/numeric_cast.hpp +31 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/plus.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/rational_c_tag.hpp +25 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/rational_constant.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/sign.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/times.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/ratio_io.hpp +1076 -0
- data/src/cxx_supportlib/vendor-modified/boost/rational.hpp +1002 -0
- data/src/cxx_supportlib/vendor-modified/modp_b64.cpp +11 -0
- data/src/helper-scripts/rack-preloader.rb +1 -1
- data/src/nginx_module/{ConfigurationCommands.c → ConfigGeneral/AutoGeneratedDefinitions.c} +351 -134
- data/src/nginx_module/{ConfigurationCommands.c.cxxcodebuilder → ConfigGeneral/AutoGeneratedDefinitions.c.cxxcodebuilder} +14 -25
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +396 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c.cxxcodebuilder +160 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +831 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c.cxxcodebuilder +168 -0
- data/src/nginx_module/ConfigGeneral/ManifestGeneration.c +887 -0
- data/src/nginx_module/ConfigGeneral/ManifestGeneration.h +100 -0
- data/src/nginx_module/Configuration.c +165 -621
- data/src/nginx_module/Configuration.h +43 -33
- data/src/nginx_module/ContentHandler.c +46 -40
- data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +282 -0
- data/src/nginx_module/{CreateLocationConfig.c.cxxcodebuilder → LocationConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder} +43 -17
- data/src/nginx_module/{CacheLocationConfig.c → LocationConfig/AutoGeneratedHeaderSerialization.c} +148 -180
- data/src/nginx_module/{CacheLocationConfig.c.cxxcodebuilder → LocationConfig/AutoGeneratedHeaderSerialization.c.cxxcodebuilder} +13 -11
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +595 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +190 -0
- data/src/nginx_module/{MergeLocationConfig.c → LocationConfig/AutoGeneratedMergeFunction.c} +32 -42
- data/src/nginx_module/{MergeLocationConfig.c.cxxcodebuilder → LocationConfig/AutoGeneratedMergeFunction.c.cxxcodebuilder} +18 -11
- data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +220 -0
- data/src/nginx_module/{LocationConfig.h.cxxcodebuilder → LocationConfig/AutoGeneratedStruct.h.cxxcodebuilder} +70 -48
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +163 -0
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder +125 -0
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +303 -0
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +173 -0
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +133 -0
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h.cxxcodebuilder +154 -0
- data/src/nginx_module/config +13 -4
- data/src/nginx_module/ngx_http_passenger_module.c +154 -84
- data/src/ruby_supportlib/phusion_passenger.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +613 -131
- data/src/ruby_supportlib/phusion_passenger/apache2/config_utils.rb +52 -0
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +18 -4
- data/src/ruby_supportlib/phusion_passenger/config/main.rb +2 -0
- data/src/ruby_supportlib/phusion_passenger/config/system_properties_command.rb +104 -0
- data/src/ruby_supportlib/phusion_passenger/constants.rb +0 -2
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +470 -138
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/platform_info.rb +17 -0
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +11 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +7 -7
- data/src/ruby_supportlib/phusion_passenger/platform_info/networking.rb +293 -0
- data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +8 -54
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +1 -5
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +4 -7
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb +1 -1
- data/src/schema_printer/SchemaPrinterMain.cpp +78 -0
- data/src/schema_printer/SchemaPrinterMain.cpp.cxxcodebuilder +116 -0
- metadata +671 -30
- data/src/apache2_module/Configuration.cpp +0 -737
- data/src/apache2_module/Configuration.hpp +0 -274
- data/src/apache2_module/ConfigurationCommands.cpp +0 -199
- data/src/apache2_module/ConfigurationFields.hpp +0 -187
- data/src/apache2_module/ConfigurationSetters.cpp +0 -436
- data/src/apache2_module/ConfigurationSetters.cpp.cxxcodebuilder +0 -144
- data/src/apache2_module/CreateDirConfig.cpp +0 -68
- data/src/apache2_module/CreateDirConfig.cpp.cxxcodebuilder +0 -81
- data/src/apache2_module/MergeDirConfig.cpp +0 -155
- data/src/apache2_module/SetHeaders.cpp +0 -111
- data/src/nginx_module/CreateLocationConfig.c +0 -100
- data/src/nginx_module/LocationConfig.h +0 -95
@@ -0,0 +1,189 @@
|
|
1
|
+
/*
|
2
|
+
*****
|
3
|
+
sha1.hpp is a repackaging of the sha1.cpp and sha1.h files from the smallsha1
|
4
|
+
library (http://code.google.com/p/smallsha1/) into a single header suitable for
|
5
|
+
use as a header only library. This conversion was done by Peter Thorson
|
6
|
+
(webmaster@zaphoyd.com) in 2013. All modifications to the code are redistributed
|
7
|
+
under the same license as the original, which is listed below.
|
8
|
+
*****
|
9
|
+
|
10
|
+
Copyright (c) 2011, Micael Hildenborg
|
11
|
+
All rights reserved.
|
12
|
+
|
13
|
+
Redistribution and use in source and binary forms, with or without
|
14
|
+
modification, are permitted provided that the following conditions are met:
|
15
|
+
* Redistributions of source code must retain the above copyright
|
16
|
+
notice, this list of conditions and the following disclaimer.
|
17
|
+
* Redistributions in binary form must reproduce the above copyright
|
18
|
+
notice, this list of conditions and the following disclaimer in the
|
19
|
+
documentation and/or other materials provided with the distribution.
|
20
|
+
* Neither the name of Micael Hildenborg nor the
|
21
|
+
names of its contributors may be used to endorse or promote products
|
22
|
+
derived from this software without specific prior written permission.
|
23
|
+
|
24
|
+
THIS SOFTWARE IS PROVIDED BY Micael Hildenborg ''AS IS'' AND ANY
|
25
|
+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
26
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
27
|
+
DISCLAIMED. IN NO EVENT SHALL Micael Hildenborg BE LIABLE FOR ANY
|
28
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
29
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
30
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
31
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
32
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
33
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
*/
|
35
|
+
|
36
|
+
#ifndef SHA1_DEFINED
|
37
|
+
#define SHA1_DEFINED
|
38
|
+
|
39
|
+
namespace websocketpp {
|
40
|
+
namespace sha1 {
|
41
|
+
|
42
|
+
namespace { // local
|
43
|
+
|
44
|
+
// Rotate an integer value to left.
|
45
|
+
inline unsigned int rol(unsigned int value, unsigned int steps) {
|
46
|
+
return ((value << steps) | (value >> (32 - steps)));
|
47
|
+
}
|
48
|
+
|
49
|
+
// Sets the first 16 integers in the buffert to zero.
|
50
|
+
// Used for clearing the W buffert.
|
51
|
+
inline void clearWBuffert(unsigned int * buffert)
|
52
|
+
{
|
53
|
+
for (int pos = 16; --pos >= 0;)
|
54
|
+
{
|
55
|
+
buffert[pos] = 0;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
inline void innerHash(unsigned int * result, unsigned int * w)
|
60
|
+
{
|
61
|
+
unsigned int a = result[0];
|
62
|
+
unsigned int b = result[1];
|
63
|
+
unsigned int c = result[2];
|
64
|
+
unsigned int d = result[3];
|
65
|
+
unsigned int e = result[4];
|
66
|
+
|
67
|
+
int round = 0;
|
68
|
+
|
69
|
+
#define sha1macro(func,val) \
|
70
|
+
{ \
|
71
|
+
const unsigned int t = rol(a, 5) + (func) + e + val + w[round]; \
|
72
|
+
e = d; \
|
73
|
+
d = c; \
|
74
|
+
c = rol(b, 30); \
|
75
|
+
b = a; \
|
76
|
+
a = t; \
|
77
|
+
}
|
78
|
+
|
79
|
+
while (round < 16)
|
80
|
+
{
|
81
|
+
sha1macro((b & c) | (~b & d), 0x5a827999)
|
82
|
+
++round;
|
83
|
+
}
|
84
|
+
while (round < 20)
|
85
|
+
{
|
86
|
+
w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
|
87
|
+
sha1macro((b & c) | (~b & d), 0x5a827999)
|
88
|
+
++round;
|
89
|
+
}
|
90
|
+
while (round < 40)
|
91
|
+
{
|
92
|
+
w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
|
93
|
+
sha1macro(b ^ c ^ d, 0x6ed9eba1)
|
94
|
+
++round;
|
95
|
+
}
|
96
|
+
while (round < 60)
|
97
|
+
{
|
98
|
+
w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
|
99
|
+
sha1macro((b & c) | (b & d) | (c & d), 0x8f1bbcdc)
|
100
|
+
++round;
|
101
|
+
}
|
102
|
+
while (round < 80)
|
103
|
+
{
|
104
|
+
w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
|
105
|
+
sha1macro(b ^ c ^ d, 0xca62c1d6)
|
106
|
+
++round;
|
107
|
+
}
|
108
|
+
|
109
|
+
#undef sha1macro
|
110
|
+
|
111
|
+
result[0] += a;
|
112
|
+
result[1] += b;
|
113
|
+
result[2] += c;
|
114
|
+
result[3] += d;
|
115
|
+
result[4] += e;
|
116
|
+
}
|
117
|
+
|
118
|
+
} // namespace
|
119
|
+
|
120
|
+
/// Calculate a SHA1 hash
|
121
|
+
/**
|
122
|
+
* @param src points to any kind of data to be hashed.
|
123
|
+
* @param bytelength the number of bytes to hash from the src pointer.
|
124
|
+
* @param hash should point to a buffer of at least 20 bytes of size for storing
|
125
|
+
* the sha1 result in.
|
126
|
+
*/
|
127
|
+
inline void calc(void const * src, size_t bytelength, unsigned char * hash) {
|
128
|
+
// Init the result array.
|
129
|
+
unsigned int result[5] = { 0x67452301, 0xefcdab89, 0x98badcfe,
|
130
|
+
0x10325476, 0xc3d2e1f0 };
|
131
|
+
|
132
|
+
// Cast the void src pointer to be the byte array we can work with.
|
133
|
+
unsigned char const * sarray = (unsigned char const *) src;
|
134
|
+
|
135
|
+
// The reusable round buffer
|
136
|
+
unsigned int w[80];
|
137
|
+
|
138
|
+
// Loop through all complete 64byte blocks.
|
139
|
+
|
140
|
+
size_t endCurrentBlock;
|
141
|
+
size_t currentBlock = 0;
|
142
|
+
|
143
|
+
if (bytelength >= 64) {
|
144
|
+
size_t const endOfFullBlocks = bytelength - 64;
|
145
|
+
|
146
|
+
while (currentBlock <= endOfFullBlocks) {
|
147
|
+
endCurrentBlock = currentBlock + 64;
|
148
|
+
|
149
|
+
// Init the round buffer with the 64 byte block data.
|
150
|
+
for (int roundPos = 0; currentBlock < endCurrentBlock; currentBlock += 4)
|
151
|
+
{
|
152
|
+
// This line will swap endian on big endian and keep endian on
|
153
|
+
// little endian.
|
154
|
+
w[roundPos++] = (unsigned int) sarray[currentBlock + 3]
|
155
|
+
| (((unsigned int) sarray[currentBlock + 2]) << 8)
|
156
|
+
| (((unsigned int) sarray[currentBlock + 1]) << 16)
|
157
|
+
| (((unsigned int) sarray[currentBlock]) << 24);
|
158
|
+
}
|
159
|
+
innerHash(result, w);
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
// Handle the last and not full 64 byte block if existing.
|
164
|
+
endCurrentBlock = bytelength - currentBlock;
|
165
|
+
clearWBuffert(w);
|
166
|
+
size_t lastBlockBytes = 0;
|
167
|
+
for (;lastBlockBytes < endCurrentBlock; ++lastBlockBytes) {
|
168
|
+
w[lastBlockBytes >> 2] |= (unsigned int) sarray[lastBlockBytes + currentBlock] << ((3 - (lastBlockBytes & 3)) << 3);
|
169
|
+
}
|
170
|
+
|
171
|
+
w[lastBlockBytes >> 2] |= 0x80 << ((3 - (lastBlockBytes & 3)) << 3);
|
172
|
+
if (endCurrentBlock >= 56) {
|
173
|
+
innerHash(result, w);
|
174
|
+
clearWBuffert(w);
|
175
|
+
}
|
176
|
+
w[15] = bytelength << 3;
|
177
|
+
innerHash(result, w);
|
178
|
+
|
179
|
+
// Store hash in result pointer, and make sure we get in in the correct
|
180
|
+
// order on both endian models.
|
181
|
+
for (int hashByte = 20; --hashByte >= 0;) {
|
182
|
+
hash[hashByte] = (result[hashByte >> 2] >> (((3 - hashByte) & 0x3) << 3)) & 0xff;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
} // namespace sha1
|
187
|
+
} // namespace websocketpp
|
188
|
+
|
189
|
+
#endif // SHA1_DEFINED
|
@@ -0,0 +1,232 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2015, Peter Thorson. All rights reserved.
|
3
|
+
*
|
4
|
+
* Redistribution and use in source and binary forms, with or without
|
5
|
+
* modification, are permitted provided that the following conditions are met:
|
6
|
+
* * Redistributions of source code must retain the above copyright
|
7
|
+
* notice, this list of conditions and the following disclaimer.
|
8
|
+
* * Redistributions in binary form must reproduce the above copyright
|
9
|
+
* notice, this list of conditions and the following disclaimer in the
|
10
|
+
* documentation and/or other materials provided with the distribution.
|
11
|
+
* * Neither the name of the WebSocket++ Project nor the
|
12
|
+
* names of its contributors may be used to endorse or promote products
|
13
|
+
* derived from this software without specific prior written permission.
|
14
|
+
*
|
15
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
16
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
18
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL PETER THORSON BE LIABLE FOR ANY
|
19
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
20
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
21
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
22
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
23
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
25
|
+
*
|
26
|
+
*/
|
27
|
+
|
28
|
+
#ifndef WEBSOCKETPP_TRANSPORT_ASIO_BASE_HPP
|
29
|
+
#define WEBSOCKETPP_TRANSPORT_ASIO_BASE_HPP
|
30
|
+
|
31
|
+
#include <websocketpp/common/asio.hpp>
|
32
|
+
#include <websocketpp/common/cpp11.hpp>
|
33
|
+
#include <websocketpp/common/functional.hpp>
|
34
|
+
#include <websocketpp/common/system_error.hpp>
|
35
|
+
#include <websocketpp/common/type_traits.hpp>
|
36
|
+
|
37
|
+
#include <string>
|
38
|
+
|
39
|
+
namespace websocketpp {
|
40
|
+
namespace transport {
|
41
|
+
/// Transport policy that uses asio
|
42
|
+
/**
|
43
|
+
* This policy uses a single asio io_service to provide transport
|
44
|
+
* services to a WebSocket++ endpoint.
|
45
|
+
*/
|
46
|
+
namespace asio {
|
47
|
+
|
48
|
+
// Class to manage the memory to be used for handler-based custom allocation.
|
49
|
+
// It contains a single block of memory which may be returned for allocation
|
50
|
+
// requests. If the memory is in use when an allocation request is made, the
|
51
|
+
// allocator delegates allocation to the global heap.
|
52
|
+
class handler_allocator {
|
53
|
+
public:
|
54
|
+
static const size_t size = 1024;
|
55
|
+
|
56
|
+
handler_allocator() : m_in_use(false) {}
|
57
|
+
|
58
|
+
#ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_
|
59
|
+
handler_allocator(handler_allocator const & cpy) = delete;
|
60
|
+
handler_allocator & operator =(handler_allocator const &) = delete;
|
61
|
+
#endif
|
62
|
+
|
63
|
+
void * allocate(std::size_t memsize) {
|
64
|
+
if (!m_in_use && memsize < size) {
|
65
|
+
m_in_use = true;
|
66
|
+
return static_cast<void*>(&m_storage);
|
67
|
+
} else {
|
68
|
+
return ::operator new(memsize);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
void deallocate(void * pointer) {
|
73
|
+
if (pointer == &m_storage) {
|
74
|
+
m_in_use = false;
|
75
|
+
} else {
|
76
|
+
::operator delete(pointer);
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
private:
|
81
|
+
// Storage space used for handler-based custom memory allocation.
|
82
|
+
lib::aligned_storage<size>::type m_storage;
|
83
|
+
|
84
|
+
// Whether the handler-based custom allocation storage has been used.
|
85
|
+
bool m_in_use;
|
86
|
+
};
|
87
|
+
|
88
|
+
// Wrapper class template for handler objects to allow handler memory
|
89
|
+
// allocation to be customised. Calls to operator() are forwarded to the
|
90
|
+
// encapsulated handler.
|
91
|
+
template <typename Handler>
|
92
|
+
class custom_alloc_handler {
|
93
|
+
public:
|
94
|
+
custom_alloc_handler(handler_allocator& a, Handler h)
|
95
|
+
: allocator_(a),
|
96
|
+
handler_(h)
|
97
|
+
{}
|
98
|
+
|
99
|
+
template <typename Arg1>
|
100
|
+
void operator()(Arg1 arg1) {
|
101
|
+
handler_(arg1);
|
102
|
+
}
|
103
|
+
|
104
|
+
template <typename Arg1, typename Arg2>
|
105
|
+
void operator()(Arg1 arg1, Arg2 arg2) {
|
106
|
+
handler_(arg1, arg2);
|
107
|
+
}
|
108
|
+
|
109
|
+
friend void* asio_handler_allocate(std::size_t size,
|
110
|
+
custom_alloc_handler<Handler> * this_handler)
|
111
|
+
{
|
112
|
+
return this_handler->allocator_.allocate(size);
|
113
|
+
}
|
114
|
+
|
115
|
+
friend void asio_handler_deallocate(void* pointer, std::size_t /*size*/,
|
116
|
+
custom_alloc_handler<Handler> * this_handler)
|
117
|
+
{
|
118
|
+
this_handler->allocator_.deallocate(pointer);
|
119
|
+
}
|
120
|
+
|
121
|
+
private:
|
122
|
+
handler_allocator & allocator_;
|
123
|
+
Handler handler_;
|
124
|
+
};
|
125
|
+
|
126
|
+
// Helper function to wrap a handler object to add custom allocation.
|
127
|
+
template <typename Handler>
|
128
|
+
inline custom_alloc_handler<Handler> make_custom_alloc_handler(
|
129
|
+
handler_allocator & a, Handler h)
|
130
|
+
{
|
131
|
+
return custom_alloc_handler<Handler>(a, h);
|
132
|
+
}
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
// Forward declaration of class endpoint so that it can be friended/referenced
|
141
|
+
// before being included.
|
142
|
+
template <typename config>
|
143
|
+
class endpoint;
|
144
|
+
|
145
|
+
typedef lib::function<void (lib::asio::error_code const & ec,
|
146
|
+
size_t bytes_transferred)> async_read_handler;
|
147
|
+
|
148
|
+
typedef lib::function<void (lib::asio::error_code const & ec,
|
149
|
+
size_t bytes_transferred)> async_write_handler;
|
150
|
+
|
151
|
+
typedef lib::function<void (lib::error_code const & ec)> pre_init_handler;
|
152
|
+
|
153
|
+
// handle_timer: dynamic parameters, multiple copies
|
154
|
+
// handle_proxy_write
|
155
|
+
// handle_proxy_read
|
156
|
+
// handle_async_write
|
157
|
+
// handle_pre_init
|
158
|
+
|
159
|
+
|
160
|
+
/// Asio transport errors
|
161
|
+
namespace error {
|
162
|
+
enum value {
|
163
|
+
/// Catch-all error for transport policy errors that don't fit in other
|
164
|
+
/// categories
|
165
|
+
general = 1,
|
166
|
+
|
167
|
+
/// async_read_at_least call requested more bytes than buffer can store
|
168
|
+
invalid_num_bytes,
|
169
|
+
|
170
|
+
/// there was an error in the underlying transport library
|
171
|
+
pass_through,
|
172
|
+
|
173
|
+
/// The connection to the requested proxy server failed
|
174
|
+
proxy_failed,
|
175
|
+
|
176
|
+
/// Invalid Proxy URI
|
177
|
+
proxy_invalid,
|
178
|
+
|
179
|
+
/// Invalid host or service
|
180
|
+
invalid_host_service
|
181
|
+
};
|
182
|
+
|
183
|
+
/// Asio transport error category
|
184
|
+
class category : public lib::error_category {
|
185
|
+
public:
|
186
|
+
char const * name() const _WEBSOCKETPP_NOEXCEPT_TOKEN_ {
|
187
|
+
return "websocketpp.transport.asio";
|
188
|
+
}
|
189
|
+
|
190
|
+
std::string message(int value) const {
|
191
|
+
switch(value) {
|
192
|
+
case error::general:
|
193
|
+
return "Generic asio transport policy error";
|
194
|
+
case error::invalid_num_bytes:
|
195
|
+
return "async_read_at_least call requested more bytes than buffer can store";
|
196
|
+
case error::pass_through:
|
197
|
+
return "Underlying Transport Error";
|
198
|
+
case error::proxy_failed:
|
199
|
+
return "Proxy connection failed";
|
200
|
+
case error::proxy_invalid:
|
201
|
+
return "Invalid proxy URI";
|
202
|
+
case error::invalid_host_service:
|
203
|
+
return "Invalid host or service";
|
204
|
+
default:
|
205
|
+
return "Unknown";
|
206
|
+
}
|
207
|
+
}
|
208
|
+
};
|
209
|
+
|
210
|
+
/// Get a reference to a static copy of the asio transport error category
|
211
|
+
inline lib::error_category const & get_category() {
|
212
|
+
static category instance;
|
213
|
+
return instance;
|
214
|
+
}
|
215
|
+
|
216
|
+
/// Create an error code with the given value and the asio transport category
|
217
|
+
inline lib::error_code make_error_code(error::value e) {
|
218
|
+
return lib::error_code(static_cast<int>(e), get_category());
|
219
|
+
}
|
220
|
+
|
221
|
+
} // namespace error
|
222
|
+
} // namespace asio
|
223
|
+
} // namespace transport
|
224
|
+
} // namespace websocketpp
|
225
|
+
|
226
|
+
_WEBSOCKETPP_ERROR_CODE_ENUM_NS_START_
|
227
|
+
template<> struct is_error_code_enum<websocketpp::transport::asio::error::value>
|
228
|
+
{
|
229
|
+
static bool const value = true;
|
230
|
+
};
|
231
|
+
_WEBSOCKETPP_ERROR_CODE_ENUM_NS_END_
|
232
|
+
#endif // WEBSOCKETPP_TRANSPORT_ASIO_HPP
|
@@ -0,0 +1,1204 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2015, Peter Thorson. All rights reserved.
|
3
|
+
*
|
4
|
+
* Redistribution and use in source and binary forms, with or without
|
5
|
+
* modification, are permitted provided that the following conditions are met:
|
6
|
+
* * Redistributions of source code must retain the above copyright
|
7
|
+
* notice, this list of conditions and the following disclaimer.
|
8
|
+
* * Redistributions in binary form must reproduce the above copyright
|
9
|
+
* notice, this list of conditions and the following disclaimer in the
|
10
|
+
* documentation and/or other materials provided with the distribution.
|
11
|
+
* * Neither the name of the WebSocket++ Project nor the
|
12
|
+
* names of its contributors may be used to endorse or promote products
|
13
|
+
* derived from this software without specific prior written permission.
|
14
|
+
*
|
15
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
16
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
18
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL PETER THORSON BE LIABLE FOR ANY
|
19
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
20
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
21
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
22
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
23
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
25
|
+
*
|
26
|
+
*/
|
27
|
+
|
28
|
+
#ifndef WEBSOCKETPP_TRANSPORT_ASIO_CON_HPP
|
29
|
+
#define WEBSOCKETPP_TRANSPORT_ASIO_CON_HPP
|
30
|
+
|
31
|
+
#include <websocketpp/transport/asio/base.hpp>
|
32
|
+
|
33
|
+
#include <websocketpp/transport/base/connection.hpp>
|
34
|
+
|
35
|
+
#include <websocketpp/logger/levels.hpp>
|
36
|
+
#include <websocketpp/http/constants.hpp>
|
37
|
+
|
38
|
+
#include <websocketpp/base64/base64.hpp>
|
39
|
+
#include <websocketpp/error.hpp>
|
40
|
+
#include <websocketpp/uri.hpp>
|
41
|
+
|
42
|
+
#include <websocketpp/common/asio.hpp>
|
43
|
+
#include <websocketpp/common/chrono.hpp>
|
44
|
+
#include <websocketpp/common/cpp11.hpp>
|
45
|
+
#include <websocketpp/common/memory.hpp>
|
46
|
+
#include <websocketpp/common/functional.hpp>
|
47
|
+
#include <websocketpp/common/connection_hdl.hpp>
|
48
|
+
|
49
|
+
#include <istream>
|
50
|
+
#include <sstream>
|
51
|
+
#include <string>
|
52
|
+
#include <vector>
|
53
|
+
|
54
|
+
namespace websocketpp {
|
55
|
+
namespace transport {
|
56
|
+
namespace asio {
|
57
|
+
|
58
|
+
typedef lib::function<void(connection_hdl)> tcp_init_handler;
|
59
|
+
|
60
|
+
/// Asio based connection transport component
|
61
|
+
/**
|
62
|
+
* transport::asio::connection implements a connection transport component using
|
63
|
+
* Asio that works with the transport::asio::endpoint endpoint transport
|
64
|
+
* component.
|
65
|
+
*/
|
66
|
+
template <typename config>
|
67
|
+
class connection : public config::socket_type::socket_con_type {
|
68
|
+
public:
|
69
|
+
/// Type of this connection transport component
|
70
|
+
typedef connection<config> type;
|
71
|
+
/// Type of a shared pointer to this connection transport component
|
72
|
+
typedef lib::shared_ptr<type> ptr;
|
73
|
+
|
74
|
+
/// Type of the socket connection component
|
75
|
+
typedef typename config::socket_type::socket_con_type socket_con_type;
|
76
|
+
/// Type of a shared pointer to the socket connection component
|
77
|
+
typedef typename socket_con_type::ptr socket_con_ptr;
|
78
|
+
/// Type of this transport's access logging policy
|
79
|
+
typedef typename config::alog_type alog_type;
|
80
|
+
/// Type of this transport's error logging policy
|
81
|
+
typedef typename config::elog_type elog_type;
|
82
|
+
|
83
|
+
typedef typename config::request_type request_type;
|
84
|
+
typedef typename request_type::ptr request_ptr;
|
85
|
+
typedef typename config::response_type response_type;
|
86
|
+
typedef typename response_type::ptr response_ptr;
|
87
|
+
|
88
|
+
/// Type of a pointer to the Asio io_service being used
|
89
|
+
typedef lib::asio::io_service * io_service_ptr;
|
90
|
+
/// Type of a pointer to the Asio io_service::strand being used
|
91
|
+
typedef lib::shared_ptr<lib::asio::io_service::strand> strand_ptr;
|
92
|
+
/// Type of a pointer to the Asio timer class
|
93
|
+
typedef lib::shared_ptr<lib::asio::steady_timer> timer_ptr;
|
94
|
+
|
95
|
+
// connection is friends with its associated endpoint to allow the endpoint
|
96
|
+
// to call private/protected utility methods that we don't want to expose
|
97
|
+
// to the public api.
|
98
|
+
friend class endpoint<config>;
|
99
|
+
|
100
|
+
// generate and manage our own io_service
|
101
|
+
explicit connection(bool is_server, alog_type & alog, elog_type & elog)
|
102
|
+
: m_is_server(is_server)
|
103
|
+
, m_alog(alog)
|
104
|
+
, m_elog(elog)
|
105
|
+
{
|
106
|
+
m_alog.write(log::alevel::devel,"asio con transport constructor");
|
107
|
+
}
|
108
|
+
|
109
|
+
/// Get a shared pointer to this component
|
110
|
+
ptr get_shared() {
|
111
|
+
return lib::static_pointer_cast<type>(socket_con_type::get_shared());
|
112
|
+
}
|
113
|
+
|
114
|
+
bool is_secure() const {
|
115
|
+
return socket_con_type::is_secure();
|
116
|
+
}
|
117
|
+
|
118
|
+
/// Set uri hook
|
119
|
+
/**
|
120
|
+
* Called by the endpoint as a connection is being established to provide
|
121
|
+
* the uri being connected to to the transport layer.
|
122
|
+
*
|
123
|
+
* This transport policy doesn't use the uri except to forward it to the
|
124
|
+
* socket layer.
|
125
|
+
*
|
126
|
+
* @since 0.6.0
|
127
|
+
*
|
128
|
+
* @param u The uri to set
|
129
|
+
*/
|
130
|
+
void set_uri(uri_ptr u) {
|
131
|
+
socket_con_type::set_uri(u);
|
132
|
+
}
|
133
|
+
|
134
|
+
/// Sets the tcp pre init handler
|
135
|
+
/**
|
136
|
+
* The tcp pre init handler is called after the raw tcp connection has been
|
137
|
+
* established but before any additional wrappers (proxy connects, TLS
|
138
|
+
* handshakes, etc) have been performed.
|
139
|
+
*
|
140
|
+
* @since 0.3.0
|
141
|
+
*
|
142
|
+
* @param h The handler to call on tcp pre init.
|
143
|
+
*/
|
144
|
+
void set_tcp_pre_init_handler(tcp_init_handler h) {
|
145
|
+
m_tcp_pre_init_handler = h;
|
146
|
+
}
|
147
|
+
|
148
|
+
/// Sets the tcp pre init handler (deprecated)
|
149
|
+
/**
|
150
|
+
* The tcp pre init handler is called after the raw tcp connection has been
|
151
|
+
* established but before any additional wrappers (proxy connects, TLS
|
152
|
+
* handshakes, etc) have been performed.
|
153
|
+
*
|
154
|
+
* @deprecated Use set_tcp_pre_init_handler instead
|
155
|
+
*
|
156
|
+
* @param h The handler to call on tcp pre init.
|
157
|
+
*/
|
158
|
+
void set_tcp_init_handler(tcp_init_handler h) {
|
159
|
+
set_tcp_pre_init_handler(h);
|
160
|
+
}
|
161
|
+
|
162
|
+
/// Sets the tcp post init handler
|
163
|
+
/**
|
164
|
+
* The tcp post init handler is called after the tcp connection has been
|
165
|
+
* established and all additional wrappers (proxy connects, TLS handshakes,
|
166
|
+
* etc have been performed. This is fired before any bytes are read or any
|
167
|
+
* WebSocket specific handshake logic has been performed.
|
168
|
+
*
|
169
|
+
* @since 0.3.0
|
170
|
+
*
|
171
|
+
* @param h The handler to call on tcp post init.
|
172
|
+
*/
|
173
|
+
void set_tcp_post_init_handler(tcp_init_handler h) {
|
174
|
+
m_tcp_post_init_handler = h;
|
175
|
+
}
|
176
|
+
|
177
|
+
/// Set the proxy to connect through (exception free)
|
178
|
+
/**
|
179
|
+
* The URI passed should be a complete URI including scheme. For example:
|
180
|
+
* http://proxy.example.com:8080/
|
181
|
+
*
|
182
|
+
* The proxy must be set up as an explicit (CONNECT) proxy allowed to
|
183
|
+
* connect to the port you specify. Traffic to the proxy is not encrypted.
|
184
|
+
*
|
185
|
+
* @param uri The full URI of the proxy to connect to.
|
186
|
+
*
|
187
|
+
* @param ec A status value
|
188
|
+
*/
|
189
|
+
void set_proxy(std::string const & uri, lib::error_code & ec) {
|
190
|
+
// TODO: return errors for illegal URIs here?
|
191
|
+
// TODO: should https urls be illegal for the moment?
|
192
|
+
m_proxy = uri;
|
193
|
+
m_proxy_data = lib::make_shared<proxy_data>();
|
194
|
+
ec = lib::error_code();
|
195
|
+
}
|
196
|
+
|
197
|
+
/// Set the proxy to connect through (exception)
|
198
|
+
void set_proxy(std::string const & uri) {
|
199
|
+
lib::error_code ec;
|
200
|
+
set_proxy(uri,ec);
|
201
|
+
if (ec) { throw exception(ec); }
|
202
|
+
}
|
203
|
+
|
204
|
+
/// Set the basic auth credentials to use (exception free)
|
205
|
+
/**
|
206
|
+
* The URI passed should be a complete URI including scheme. For example:
|
207
|
+
* http://proxy.example.com:8080/
|
208
|
+
*
|
209
|
+
* The proxy must be set up as an explicit proxy
|
210
|
+
*
|
211
|
+
* @param username The username to send
|
212
|
+
*
|
213
|
+
* @param password The password to send
|
214
|
+
*
|
215
|
+
* @param ec A status value
|
216
|
+
*/
|
217
|
+
void set_proxy_basic_auth(std::string const & username, std::string const &
|
218
|
+
password, lib::error_code & ec)
|
219
|
+
{
|
220
|
+
if (!m_proxy_data) {
|
221
|
+
ec = make_error_code(websocketpp::error::invalid_state);
|
222
|
+
return;
|
223
|
+
}
|
224
|
+
|
225
|
+
// TODO: username can't contain ':'
|
226
|
+
std::string val = "Basic "+base64_encode(username + ":" + password);
|
227
|
+
m_proxy_data->req.replace_header("Proxy-Authorization",val);
|
228
|
+
ec = lib::error_code();
|
229
|
+
}
|
230
|
+
|
231
|
+
/// Set the basic auth credentials to use (exception)
|
232
|
+
void set_proxy_basic_auth(std::string const & username, std::string const &
|
233
|
+
password)
|
234
|
+
{
|
235
|
+
lib::error_code ec;
|
236
|
+
set_proxy_basic_auth(username,password,ec);
|
237
|
+
if (ec) { throw exception(ec); }
|
238
|
+
}
|
239
|
+
|
240
|
+
/// Set the proxy timeout duration (exception free)
|
241
|
+
/**
|
242
|
+
* Duration is in milliseconds. Default value is based on the transport
|
243
|
+
* config
|
244
|
+
*
|
245
|
+
* @param duration The number of milliseconds to wait before aborting the
|
246
|
+
* proxy connection.
|
247
|
+
*
|
248
|
+
* @param ec A status value
|
249
|
+
*/
|
250
|
+
void set_proxy_timeout(long duration, lib::error_code & ec) {
|
251
|
+
if (!m_proxy_data) {
|
252
|
+
ec = make_error_code(websocketpp::error::invalid_state);
|
253
|
+
return;
|
254
|
+
}
|
255
|
+
|
256
|
+
m_proxy_data->timeout_proxy = duration;
|
257
|
+
ec = lib::error_code();
|
258
|
+
}
|
259
|
+
|
260
|
+
/// Set the proxy timeout duration (exception)
|
261
|
+
void set_proxy_timeout(long duration) {
|
262
|
+
lib::error_code ec;
|
263
|
+
set_proxy_timeout(duration,ec);
|
264
|
+
if (ec) { throw exception(ec); }
|
265
|
+
}
|
266
|
+
|
267
|
+
std::string const & get_proxy() const {
|
268
|
+
return m_proxy;
|
269
|
+
}
|
270
|
+
|
271
|
+
/// Get the remote endpoint address
|
272
|
+
/**
|
273
|
+
* The iostream transport has no information about the ultimate remote
|
274
|
+
* endpoint. It will return the string "iostream transport". To indicate
|
275
|
+
* this.
|
276
|
+
*
|
277
|
+
* TODO: allow user settable remote endpoint addresses if this seems useful
|
278
|
+
*
|
279
|
+
* @return A string identifying the address of the remote endpoint
|
280
|
+
*/
|
281
|
+
std::string get_remote_endpoint() const {
|
282
|
+
lib::error_code ec;
|
283
|
+
|
284
|
+
std::string ret = socket_con_type::get_remote_endpoint(ec);
|
285
|
+
|
286
|
+
if (ec) {
|
287
|
+
m_elog.write(log::elevel::info,ret);
|
288
|
+
return "Unknown";
|
289
|
+
} else {
|
290
|
+
return ret;
|
291
|
+
}
|
292
|
+
}
|
293
|
+
|
294
|
+
/// Get the connection handle
|
295
|
+
connection_hdl get_handle() const {
|
296
|
+
return m_connection_hdl;
|
297
|
+
}
|
298
|
+
|
299
|
+
/// Call back a function after a period of time.
|
300
|
+
/**
|
301
|
+
* Sets a timer that calls back a function after the specified period of
|
302
|
+
* milliseconds. Returns a handle that can be used to cancel the timer.
|
303
|
+
* A cancelled timer will return the error code error::operation_aborted
|
304
|
+
* A timer that expired will return no error.
|
305
|
+
*
|
306
|
+
* @param duration Length of time to wait in milliseconds
|
307
|
+
*
|
308
|
+
* @param callback The function to call back when the timer has expired
|
309
|
+
*
|
310
|
+
* @return A handle that can be used to cancel the timer if it is no longer
|
311
|
+
* needed.
|
312
|
+
*/
|
313
|
+
timer_ptr set_timer(long duration, timer_handler callback) {
|
314
|
+
timer_ptr new_timer = lib::make_shared<lib::asio::steady_timer>(
|
315
|
+
lib::ref(*m_io_service),
|
316
|
+
lib::asio::milliseconds(duration)
|
317
|
+
);
|
318
|
+
|
319
|
+
if (config::enable_multithreading) {
|
320
|
+
new_timer->async_wait(m_strand->wrap(lib::bind(
|
321
|
+
&type::handle_timer, get_shared(),
|
322
|
+
new_timer,
|
323
|
+
callback,
|
324
|
+
lib::placeholders::_1
|
325
|
+
)));
|
326
|
+
} else {
|
327
|
+
new_timer->async_wait(lib::bind(
|
328
|
+
&type::handle_timer, get_shared(),
|
329
|
+
new_timer,
|
330
|
+
callback,
|
331
|
+
lib::placeholders::_1
|
332
|
+
));
|
333
|
+
}
|
334
|
+
|
335
|
+
return new_timer;
|
336
|
+
}
|
337
|
+
|
338
|
+
/// Timer callback
|
339
|
+
/**
|
340
|
+
* The timer pointer is included to ensure the timer isn't destroyed until
|
341
|
+
* after it has expired.
|
342
|
+
*
|
343
|
+
* TODO: candidate for protected status
|
344
|
+
*
|
345
|
+
* @param post_timer Pointer to the timer in question
|
346
|
+
* @param callback The function to call back
|
347
|
+
* @param ec The status code
|
348
|
+
*/
|
349
|
+
void handle_timer(timer_ptr, timer_handler callback,
|
350
|
+
lib::asio::error_code const & ec)
|
351
|
+
{
|
352
|
+
if (ec) {
|
353
|
+
if (ec == lib::asio::error::operation_aborted) {
|
354
|
+
callback(make_error_code(transport::error::operation_aborted));
|
355
|
+
} else {
|
356
|
+
log_err(log::elevel::info,"asio handle_timer",ec);
|
357
|
+
callback(make_error_code(error::pass_through));
|
358
|
+
}
|
359
|
+
} else {
|
360
|
+
callback(lib::error_code());
|
361
|
+
}
|
362
|
+
}
|
363
|
+
|
364
|
+
/// Get a pointer to this connection's strand
|
365
|
+
strand_ptr get_strand() {
|
366
|
+
return m_strand;
|
367
|
+
}
|
368
|
+
|
369
|
+
/// Get the internal transport error code for a closed/failed connection
|
370
|
+
/**
|
371
|
+
* Retrieves a machine readable detailed error code indicating the reason
|
372
|
+
* that the connection was closed or failed. Valid only after the close or
|
373
|
+
* fail handler is called.
|
374
|
+
*
|
375
|
+
* Primarily used if you are using mismatched asio / system_error
|
376
|
+
* implementations such as `boost::asio` with `std::system_error`. In these
|
377
|
+
* cases the transport error type is different than the library error type
|
378
|
+
* and some WebSocket++ functions that return transport errors via the
|
379
|
+
* library error code type will be coerced into a catch all `pass_through`
|
380
|
+
* or `tls_error` error. This method will return the original machine
|
381
|
+
* readable transport error in the native type.
|
382
|
+
*
|
383
|
+
* @since 0.7.0
|
384
|
+
*
|
385
|
+
* @return Error code indicating the reason the connection was closed or
|
386
|
+
* failed
|
387
|
+
*/
|
388
|
+
lib::asio::error_code get_transport_ec() const {
|
389
|
+
return m_tec;
|
390
|
+
}
|
391
|
+
|
392
|
+
/// Initialize transport for reading
|
393
|
+
/**
|
394
|
+
* init_asio is called once immediately after construction to initialize
|
395
|
+
* Asio components to the io_service
|
396
|
+
*
|
397
|
+
* The transport initialization sequence consists of the following steps:
|
398
|
+
* - Pre-init: the underlying socket is initialized to the point where
|
399
|
+
* bytes may be written. No bytes are actually written in this stage
|
400
|
+
* - Proxy negotiation: if a proxy is set, a request is made to it to start
|
401
|
+
* a tunnel to the final destination. This stage ends when the proxy is
|
402
|
+
* ready to forward the
|
403
|
+
* next byte to the remote endpoint.
|
404
|
+
* - Post-init: Perform any i/o with the remote endpoint, such as setting up
|
405
|
+
* tunnels for encryption. This stage ends when the connection is ready to
|
406
|
+
* read or write the WebSocket handshakes. At this point the original
|
407
|
+
* callback function is called.
|
408
|
+
*/
|
409
|
+
protected:
|
410
|
+
void init(init_handler callback) {
|
411
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
412
|
+
m_alog.write(log::alevel::devel,"asio connection init");
|
413
|
+
}
|
414
|
+
|
415
|
+
// TODO: pre-init timeout. Right now no implemented socket policies
|
416
|
+
// actually have an asyncronous pre-init
|
417
|
+
|
418
|
+
socket_con_type::pre_init(
|
419
|
+
lib::bind(
|
420
|
+
&type::handle_pre_init,
|
421
|
+
get_shared(),
|
422
|
+
callback,
|
423
|
+
lib::placeholders::_1
|
424
|
+
)
|
425
|
+
);
|
426
|
+
}
|
427
|
+
|
428
|
+
/// initialize the proxy buffers and http parsers
|
429
|
+
/**
|
430
|
+
*
|
431
|
+
* @param authority The address of the server we want the proxy to tunnel to
|
432
|
+
* in the format of a URI authority (host:port)
|
433
|
+
*
|
434
|
+
* @return Status code indicating what errors occurred, if any
|
435
|
+
*/
|
436
|
+
lib::error_code proxy_init(std::string const & authority) {
|
437
|
+
if (!m_proxy_data) {
|
438
|
+
return websocketpp::error::make_error_code(
|
439
|
+
websocketpp::error::invalid_state);
|
440
|
+
}
|
441
|
+
m_proxy_data->req.set_version("HTTP/1.1");
|
442
|
+
m_proxy_data->req.set_method("CONNECT");
|
443
|
+
|
444
|
+
m_proxy_data->req.set_uri(authority);
|
445
|
+
m_proxy_data->req.replace_header("Host",authority);
|
446
|
+
|
447
|
+
return lib::error_code();
|
448
|
+
}
|
449
|
+
|
450
|
+
/// Finish constructing the transport
|
451
|
+
/**
|
452
|
+
* init_asio is called once immediately after construction to initialize
|
453
|
+
* Asio components to the io_service.
|
454
|
+
*
|
455
|
+
* @param io_service A pointer to the io_service to register with this
|
456
|
+
* connection
|
457
|
+
*
|
458
|
+
* @return Status code for the success or failure of the initialization
|
459
|
+
*/
|
460
|
+
lib::error_code init_asio (io_service_ptr io_service) {
|
461
|
+
m_io_service = io_service;
|
462
|
+
|
463
|
+
if (config::enable_multithreading) {
|
464
|
+
m_strand = lib::make_shared<lib::asio::io_service::strand>(
|
465
|
+
lib::ref(*io_service));
|
466
|
+
}
|
467
|
+
|
468
|
+
lib::error_code ec = socket_con_type::init_asio(io_service, m_strand,
|
469
|
+
m_is_server);
|
470
|
+
|
471
|
+
return ec;
|
472
|
+
}
|
473
|
+
|
474
|
+
void handle_pre_init(init_handler callback, lib::error_code const & ec) {
|
475
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
476
|
+
m_alog.write(log::alevel::devel,"asio connection handle pre_init");
|
477
|
+
}
|
478
|
+
|
479
|
+
if (m_tcp_pre_init_handler) {
|
480
|
+
m_tcp_pre_init_handler(m_connection_hdl);
|
481
|
+
}
|
482
|
+
|
483
|
+
if (ec) {
|
484
|
+
callback(ec);
|
485
|
+
}
|
486
|
+
|
487
|
+
// If we have a proxy set issue a proxy connect, otherwise skip to
|
488
|
+
// post_init
|
489
|
+
if (!m_proxy.empty()) {
|
490
|
+
proxy_write(callback);
|
491
|
+
} else {
|
492
|
+
post_init(callback);
|
493
|
+
}
|
494
|
+
}
|
495
|
+
|
496
|
+
void post_init(init_handler callback) {
|
497
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
498
|
+
m_alog.write(log::alevel::devel,"asio connection post_init");
|
499
|
+
}
|
500
|
+
|
501
|
+
timer_ptr post_timer;
|
502
|
+
|
503
|
+
if (config::timeout_socket_post_init > 0) {
|
504
|
+
post_timer = set_timer(
|
505
|
+
config::timeout_socket_post_init,
|
506
|
+
lib::bind(
|
507
|
+
&type::handle_post_init_timeout,
|
508
|
+
get_shared(),
|
509
|
+
post_timer,
|
510
|
+
callback,
|
511
|
+
lib::placeholders::_1
|
512
|
+
)
|
513
|
+
);
|
514
|
+
}
|
515
|
+
|
516
|
+
socket_con_type::post_init(
|
517
|
+
lib::bind(
|
518
|
+
&type::handle_post_init,
|
519
|
+
get_shared(),
|
520
|
+
post_timer,
|
521
|
+
callback,
|
522
|
+
lib::placeholders::_1
|
523
|
+
)
|
524
|
+
);
|
525
|
+
}
|
526
|
+
|
527
|
+
/// Post init timeout callback
|
528
|
+
/**
|
529
|
+
* The timer pointer is included to ensure the timer isn't destroyed until
|
530
|
+
* after it has expired.
|
531
|
+
*
|
532
|
+
* @param post_timer Pointer to the timer in question
|
533
|
+
* @param callback The function to call back
|
534
|
+
* @param ec The status code
|
535
|
+
*/
|
536
|
+
void handle_post_init_timeout(timer_ptr, init_handler callback,
|
537
|
+
lib::error_code const & ec)
|
538
|
+
{
|
539
|
+
lib::error_code ret_ec;
|
540
|
+
|
541
|
+
if (ec) {
|
542
|
+
if (ec == transport::error::operation_aborted) {
|
543
|
+
m_alog.write(log::alevel::devel,
|
544
|
+
"asio post init timer cancelled");
|
545
|
+
return;
|
546
|
+
}
|
547
|
+
|
548
|
+
log_err(log::elevel::devel,"asio handle_post_init_timeout",ec);
|
549
|
+
ret_ec = ec;
|
550
|
+
} else {
|
551
|
+
if (socket_con_type::get_ec()) {
|
552
|
+
ret_ec = socket_con_type::get_ec();
|
553
|
+
} else {
|
554
|
+
ret_ec = make_error_code(transport::error::timeout);
|
555
|
+
}
|
556
|
+
}
|
557
|
+
|
558
|
+
m_alog.write(log::alevel::devel, "Asio transport post-init timed out");
|
559
|
+
cancel_socket_checked();
|
560
|
+
callback(ret_ec);
|
561
|
+
}
|
562
|
+
|
563
|
+
/// Post init timeout callback
|
564
|
+
/**
|
565
|
+
* The timer pointer is included to ensure the timer isn't destroyed until
|
566
|
+
* after it has expired.
|
567
|
+
*
|
568
|
+
* @param post_timer Pointer to the timer in question
|
569
|
+
* @param callback The function to call back
|
570
|
+
* @param ec The status code
|
571
|
+
*/
|
572
|
+
void handle_post_init(timer_ptr post_timer, init_handler callback,
|
573
|
+
lib::error_code const & ec)
|
574
|
+
{
|
575
|
+
if (ec == transport::error::operation_aborted ||
|
576
|
+
(post_timer && lib::asio::is_neg(post_timer->expires_from_now())))
|
577
|
+
{
|
578
|
+
m_alog.write(log::alevel::devel,"post_init cancelled");
|
579
|
+
return;
|
580
|
+
}
|
581
|
+
|
582
|
+
if (post_timer) {
|
583
|
+
post_timer->cancel();
|
584
|
+
}
|
585
|
+
|
586
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
587
|
+
m_alog.write(log::alevel::devel,"asio connection handle_post_init");
|
588
|
+
}
|
589
|
+
|
590
|
+
if (m_tcp_post_init_handler) {
|
591
|
+
m_tcp_post_init_handler(m_connection_hdl);
|
592
|
+
}
|
593
|
+
|
594
|
+
callback(ec);
|
595
|
+
}
|
596
|
+
|
597
|
+
void proxy_write(init_handler callback) {
|
598
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
599
|
+
m_alog.write(log::alevel::devel,"asio connection proxy_write");
|
600
|
+
}
|
601
|
+
|
602
|
+
if (!m_proxy_data) {
|
603
|
+
m_elog.write(log::elevel::library,
|
604
|
+
"assertion failed: !m_proxy_data in asio::connection::proxy_write");
|
605
|
+
callback(make_error_code(error::general));
|
606
|
+
return;
|
607
|
+
}
|
608
|
+
|
609
|
+
m_proxy_data->write_buf = m_proxy_data->req.raw();
|
610
|
+
|
611
|
+
m_bufs.push_back(lib::asio::buffer(m_proxy_data->write_buf.data(),
|
612
|
+
m_proxy_data->write_buf.size()));
|
613
|
+
|
614
|
+
m_alog.write(log::alevel::devel,m_proxy_data->write_buf);
|
615
|
+
|
616
|
+
// Set a timer so we don't wait forever for the proxy to respond
|
617
|
+
m_proxy_data->timer = this->set_timer(
|
618
|
+
m_proxy_data->timeout_proxy,
|
619
|
+
lib::bind(
|
620
|
+
&type::handle_proxy_timeout,
|
621
|
+
get_shared(),
|
622
|
+
callback,
|
623
|
+
lib::placeholders::_1
|
624
|
+
)
|
625
|
+
);
|
626
|
+
|
627
|
+
// Send proxy request
|
628
|
+
if (config::enable_multithreading) {
|
629
|
+
lib::asio::async_write(
|
630
|
+
socket_con_type::get_next_layer(),
|
631
|
+
m_bufs,
|
632
|
+
m_strand->wrap(lib::bind(
|
633
|
+
&type::handle_proxy_write, get_shared(),
|
634
|
+
callback,
|
635
|
+
lib::placeholders::_1
|
636
|
+
))
|
637
|
+
);
|
638
|
+
} else {
|
639
|
+
lib::asio::async_write(
|
640
|
+
socket_con_type::get_next_layer(),
|
641
|
+
m_bufs,
|
642
|
+
lib::bind(
|
643
|
+
&type::handle_proxy_write, get_shared(),
|
644
|
+
callback,
|
645
|
+
lib::placeholders::_1
|
646
|
+
)
|
647
|
+
);
|
648
|
+
}
|
649
|
+
}
|
650
|
+
|
651
|
+
void handle_proxy_timeout(init_handler callback, lib::error_code const & ec)
|
652
|
+
{
|
653
|
+
if (ec == transport::error::operation_aborted) {
|
654
|
+
m_alog.write(log::alevel::devel,
|
655
|
+
"asio handle_proxy_write timer cancelled");
|
656
|
+
return;
|
657
|
+
} else if (ec) {
|
658
|
+
log_err(log::elevel::devel,"asio handle_proxy_write",ec);
|
659
|
+
callback(ec);
|
660
|
+
} else {
|
661
|
+
m_alog.write(log::alevel::devel,
|
662
|
+
"asio handle_proxy_write timer expired");
|
663
|
+
cancel_socket_checked();
|
664
|
+
callback(make_error_code(transport::error::timeout));
|
665
|
+
}
|
666
|
+
}
|
667
|
+
|
668
|
+
void handle_proxy_write(init_handler callback,
|
669
|
+
lib::asio::error_code const & ec)
|
670
|
+
{
|
671
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
672
|
+
m_alog.write(log::alevel::devel,
|
673
|
+
"asio connection handle_proxy_write");
|
674
|
+
}
|
675
|
+
|
676
|
+
m_bufs.clear();
|
677
|
+
|
678
|
+
// Timer expired or the operation was aborted for some reason.
|
679
|
+
// Whatever aborted it will be issuing the callback so we are safe to
|
680
|
+
// return
|
681
|
+
if (ec == lib::asio::error::operation_aborted ||
|
682
|
+
lib::asio::is_neg(m_proxy_data->timer->expires_from_now()))
|
683
|
+
{
|
684
|
+
m_elog.write(log::elevel::devel,"write operation aborted");
|
685
|
+
return;
|
686
|
+
}
|
687
|
+
|
688
|
+
if (ec) {
|
689
|
+
log_err(log::elevel::info,"asio handle_proxy_write",ec);
|
690
|
+
m_proxy_data->timer->cancel();
|
691
|
+
callback(make_error_code(error::pass_through));
|
692
|
+
return;
|
693
|
+
}
|
694
|
+
|
695
|
+
proxy_read(callback);
|
696
|
+
}
|
697
|
+
|
698
|
+
void proxy_read(init_handler callback) {
|
699
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
700
|
+
m_alog.write(log::alevel::devel,"asio connection proxy_read");
|
701
|
+
}
|
702
|
+
|
703
|
+
if (!m_proxy_data) {
|
704
|
+
m_elog.write(log::elevel::library,
|
705
|
+
"assertion failed: !m_proxy_data in asio::connection::proxy_read");
|
706
|
+
m_proxy_data->timer->cancel();
|
707
|
+
callback(make_error_code(error::general));
|
708
|
+
return;
|
709
|
+
}
|
710
|
+
|
711
|
+
if (config::enable_multithreading) {
|
712
|
+
lib::asio::async_read_until(
|
713
|
+
socket_con_type::get_next_layer(),
|
714
|
+
m_proxy_data->read_buf,
|
715
|
+
"\r\n\r\n",
|
716
|
+
m_strand->wrap(lib::bind(
|
717
|
+
&type::handle_proxy_read, get_shared(),
|
718
|
+
callback,
|
719
|
+
lib::placeholders::_1, lib::placeholders::_2
|
720
|
+
))
|
721
|
+
);
|
722
|
+
} else {
|
723
|
+
lib::asio::async_read_until(
|
724
|
+
socket_con_type::get_next_layer(),
|
725
|
+
m_proxy_data->read_buf,
|
726
|
+
"\r\n\r\n",
|
727
|
+
lib::bind(
|
728
|
+
&type::handle_proxy_read, get_shared(),
|
729
|
+
callback,
|
730
|
+
lib::placeholders::_1, lib::placeholders::_2
|
731
|
+
)
|
732
|
+
);
|
733
|
+
}
|
734
|
+
}
|
735
|
+
|
736
|
+
/// Proxy read callback
|
737
|
+
/**
|
738
|
+
* @param init_handler The function to call back
|
739
|
+
* @param ec The status code
|
740
|
+
* @param bytes_transferred The number of bytes read
|
741
|
+
*/
|
742
|
+
void handle_proxy_read(init_handler callback,
|
743
|
+
lib::asio::error_code const & ec, size_t)
|
744
|
+
{
|
745
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
746
|
+
m_alog.write(log::alevel::devel,
|
747
|
+
"asio connection handle_proxy_read");
|
748
|
+
}
|
749
|
+
|
750
|
+
// Timer expired or the operation was aborted for some reason.
|
751
|
+
// Whatever aborted it will be issuing the callback so we are safe to
|
752
|
+
// return
|
753
|
+
if (ec == lib::asio::error::operation_aborted ||
|
754
|
+
lib::asio::is_neg(m_proxy_data->timer->expires_from_now()))
|
755
|
+
{
|
756
|
+
m_elog.write(log::elevel::devel,"read operation aborted");
|
757
|
+
return;
|
758
|
+
}
|
759
|
+
|
760
|
+
// At this point there is no need to wait for the timer anymore
|
761
|
+
m_proxy_data->timer->cancel();
|
762
|
+
|
763
|
+
if (ec) {
|
764
|
+
m_elog.write(log::elevel::info,
|
765
|
+
"asio handle_proxy_read error: "+ec.message());
|
766
|
+
callback(make_error_code(error::pass_through));
|
767
|
+
} else {
|
768
|
+
if (!m_proxy_data) {
|
769
|
+
m_elog.write(log::elevel::library,
|
770
|
+
"assertion failed: !m_proxy_data in asio::connection::handle_proxy_read");
|
771
|
+
callback(make_error_code(error::general));
|
772
|
+
return;
|
773
|
+
}
|
774
|
+
|
775
|
+
std::istream input(&m_proxy_data->read_buf);
|
776
|
+
|
777
|
+
m_proxy_data->res.consume(input);
|
778
|
+
|
779
|
+
if (!m_proxy_data->res.headers_ready()) {
|
780
|
+
// we read until the headers were done in theory but apparently
|
781
|
+
// they aren't. Internal endpoint error.
|
782
|
+
callback(make_error_code(error::general));
|
783
|
+
return;
|
784
|
+
}
|
785
|
+
|
786
|
+
m_alog.write(log::alevel::devel,m_proxy_data->res.raw());
|
787
|
+
|
788
|
+
if (m_proxy_data->res.get_status_code() != http::status_code::ok) {
|
789
|
+
// got an error response back
|
790
|
+
// TODO: expose this error in a programmatically accessible way?
|
791
|
+
// if so, see below for an option on how to do this.
|
792
|
+
std::stringstream s;
|
793
|
+
s << "Proxy connection error: "
|
794
|
+
<< m_proxy_data->res.get_status_code()
|
795
|
+
<< " ("
|
796
|
+
<< m_proxy_data->res.get_status_msg()
|
797
|
+
<< ")";
|
798
|
+
m_elog.write(log::elevel::info,s.str());
|
799
|
+
callback(make_error_code(error::proxy_failed));
|
800
|
+
return;
|
801
|
+
}
|
802
|
+
|
803
|
+
// we have successfully established a connection to the proxy, now
|
804
|
+
// we can continue and the proxy will transparently forward the
|
805
|
+
// WebSocket connection.
|
806
|
+
|
807
|
+
// TODO: decide if we want an on_proxy callback that would allow
|
808
|
+
// access to the proxy response.
|
809
|
+
|
810
|
+
// free the proxy buffers and req/res objects as they aren't needed
|
811
|
+
// anymore
|
812
|
+
m_proxy_data.reset();
|
813
|
+
|
814
|
+
// Continue with post proxy initialization
|
815
|
+
post_init(callback);
|
816
|
+
}
|
817
|
+
}
|
818
|
+
|
819
|
+
/// read at least num_bytes bytes into buf and then call handler.
|
820
|
+
void async_read_at_least(size_t num_bytes, char *buf, size_t len,
|
821
|
+
read_handler handler)
|
822
|
+
{
|
823
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
824
|
+
std::stringstream s;
|
825
|
+
s << "asio async_read_at_least: " << num_bytes;
|
826
|
+
m_alog.write(log::alevel::devel,s.str());
|
827
|
+
}
|
828
|
+
|
829
|
+
// TODO: safety vs speed ?
|
830
|
+
// maybe move into an if devel block
|
831
|
+
/*if (num_bytes > len) {
|
832
|
+
m_elog.write(log::elevel::devel,
|
833
|
+
"asio async_read_at_least error::invalid_num_bytes");
|
834
|
+
handler(make_error_code(transport::error::invalid_num_bytes),
|
835
|
+
size_t(0));
|
836
|
+
return;
|
837
|
+
}*/
|
838
|
+
|
839
|
+
if (config::enable_multithreading) {
|
840
|
+
lib::asio::async_read(
|
841
|
+
socket_con_type::get_socket(),
|
842
|
+
lib::asio::buffer(buf,len),
|
843
|
+
lib::asio::transfer_at_least(num_bytes),
|
844
|
+
m_strand->wrap(make_custom_alloc_handler(
|
845
|
+
m_read_handler_allocator,
|
846
|
+
lib::bind(
|
847
|
+
&type::handle_async_read, get_shared(),
|
848
|
+
handler,
|
849
|
+
lib::placeholders::_1, lib::placeholders::_2
|
850
|
+
)
|
851
|
+
))
|
852
|
+
);
|
853
|
+
} else {
|
854
|
+
lib::asio::async_read(
|
855
|
+
socket_con_type::get_socket(),
|
856
|
+
lib::asio::buffer(buf,len),
|
857
|
+
lib::asio::transfer_at_least(num_bytes),
|
858
|
+
make_custom_alloc_handler(
|
859
|
+
m_read_handler_allocator,
|
860
|
+
lib::bind(
|
861
|
+
&type::handle_async_read, get_shared(),
|
862
|
+
handler,
|
863
|
+
lib::placeholders::_1, lib::placeholders::_2
|
864
|
+
)
|
865
|
+
)
|
866
|
+
);
|
867
|
+
}
|
868
|
+
|
869
|
+
}
|
870
|
+
|
871
|
+
void handle_async_read(read_handler handler, lib::asio::error_code const & ec,
|
872
|
+
size_t bytes_transferred)
|
873
|
+
{
|
874
|
+
m_alog.write(log::alevel::devel, "asio con handle_async_read");
|
875
|
+
|
876
|
+
// translate asio error codes into more lib::error_codes
|
877
|
+
lib::error_code tec;
|
878
|
+
if (ec == lib::asio::error::eof) {
|
879
|
+
tec = make_error_code(transport::error::eof);
|
880
|
+
} else if (ec) {
|
881
|
+
// We don't know much more about the error at this point. As our
|
882
|
+
// socket/security policy if it knows more:
|
883
|
+
tec = socket_con_type::translate_ec(ec);
|
884
|
+
m_tec = ec;
|
885
|
+
|
886
|
+
if (tec == transport::error::tls_error ||
|
887
|
+
tec == transport::error::pass_through)
|
888
|
+
{
|
889
|
+
// These are aggregate/catch all errors. Log some human readable
|
890
|
+
// information to the info channel to give library users some
|
891
|
+
// more details about why the upstream method may have failed.
|
892
|
+
log_err(log::elevel::info,"asio async_read_at_least",ec);
|
893
|
+
}
|
894
|
+
}
|
895
|
+
if (handler) {
|
896
|
+
handler(tec,bytes_transferred);
|
897
|
+
} else {
|
898
|
+
// This can happen in cases where the connection is terminated while
|
899
|
+
// the transport is waiting on a read.
|
900
|
+
m_alog.write(log::alevel::devel,
|
901
|
+
"handle_async_read called with null read handler");
|
902
|
+
}
|
903
|
+
}
|
904
|
+
|
905
|
+
/// Initiate a potentially asyncronous write of the given buffer
|
906
|
+
void async_write(const char* buf, size_t len, write_handler handler) {
|
907
|
+
m_bufs.push_back(lib::asio::buffer(buf,len));
|
908
|
+
|
909
|
+
if (config::enable_multithreading) {
|
910
|
+
lib::asio::async_write(
|
911
|
+
socket_con_type::get_socket(),
|
912
|
+
m_bufs,
|
913
|
+
m_strand->wrap(make_custom_alloc_handler(
|
914
|
+
m_write_handler_allocator,
|
915
|
+
lib::bind(
|
916
|
+
&type::handle_async_write, get_shared(),
|
917
|
+
handler,
|
918
|
+
lib::placeholders::_1, lib::placeholders::_2
|
919
|
+
)
|
920
|
+
))
|
921
|
+
);
|
922
|
+
} else {
|
923
|
+
lib::asio::async_write(
|
924
|
+
socket_con_type::get_socket(),
|
925
|
+
m_bufs,
|
926
|
+
make_custom_alloc_handler(
|
927
|
+
m_write_handler_allocator,
|
928
|
+
lib::bind(
|
929
|
+
&type::handle_async_write, get_shared(),
|
930
|
+
handler,
|
931
|
+
lib::placeholders::_1, lib::placeholders::_2
|
932
|
+
)
|
933
|
+
)
|
934
|
+
);
|
935
|
+
}
|
936
|
+
}
|
937
|
+
|
938
|
+
/// Initiate a potentially asyncronous write of the given buffers
|
939
|
+
void async_write(std::vector<buffer> const & bufs, write_handler handler) {
|
940
|
+
std::vector<buffer>::const_iterator it;
|
941
|
+
|
942
|
+
for (it = bufs.begin(); it != bufs.end(); ++it) {
|
943
|
+
m_bufs.push_back(lib::asio::buffer((*it).buf,(*it).len));
|
944
|
+
}
|
945
|
+
|
946
|
+
if (config::enable_multithreading) {
|
947
|
+
lib::asio::async_write(
|
948
|
+
socket_con_type::get_socket(),
|
949
|
+
m_bufs,
|
950
|
+
m_strand->wrap(make_custom_alloc_handler(
|
951
|
+
m_write_handler_allocator,
|
952
|
+
lib::bind(
|
953
|
+
&type::handle_async_write, get_shared(),
|
954
|
+
handler,
|
955
|
+
lib::placeholders::_1, lib::placeholders::_2
|
956
|
+
)
|
957
|
+
))
|
958
|
+
);
|
959
|
+
} else {
|
960
|
+
lib::asio::async_write(
|
961
|
+
socket_con_type::get_socket(),
|
962
|
+
m_bufs,
|
963
|
+
make_custom_alloc_handler(
|
964
|
+
m_write_handler_allocator,
|
965
|
+
lib::bind(
|
966
|
+
&type::handle_async_write, get_shared(),
|
967
|
+
handler,
|
968
|
+
lib::placeholders::_1, lib::placeholders::_2
|
969
|
+
)
|
970
|
+
)
|
971
|
+
);
|
972
|
+
}
|
973
|
+
}
|
974
|
+
|
975
|
+
/// Async write callback
|
976
|
+
/**
|
977
|
+
* @param ec The status code
|
978
|
+
* @param bytes_transferred The number of bytes read
|
979
|
+
*/
|
980
|
+
void handle_async_write(write_handler handler, lib::asio::error_code const & ec, size_t) {
|
981
|
+
m_bufs.clear();
|
982
|
+
lib::error_code tec;
|
983
|
+
if (ec) {
|
984
|
+
log_err(log::elevel::info,"asio async_write",ec);
|
985
|
+
tec = make_error_code(transport::error::pass_through);
|
986
|
+
}
|
987
|
+
if (handler) {
|
988
|
+
handler(tec);
|
989
|
+
} else {
|
990
|
+
// This can happen in cases where the connection is terminated while
|
991
|
+
// the transport is waiting on a read.
|
992
|
+
m_alog.write(log::alevel::devel,
|
993
|
+
"handle_async_write called with null write handler");
|
994
|
+
}
|
995
|
+
}
|
996
|
+
|
997
|
+
/// Set Connection Handle
|
998
|
+
/**
|
999
|
+
* See common/connection_hdl.hpp for information
|
1000
|
+
*
|
1001
|
+
* @param hdl A connection_hdl that the transport will use to refer
|
1002
|
+
* to itself
|
1003
|
+
*/
|
1004
|
+
void set_handle(connection_hdl hdl) {
|
1005
|
+
m_connection_hdl = hdl;
|
1006
|
+
socket_con_type::set_handle(hdl);
|
1007
|
+
}
|
1008
|
+
|
1009
|
+
/// Trigger the on_interrupt handler
|
1010
|
+
/**
|
1011
|
+
* This needs to be thread safe
|
1012
|
+
*/
|
1013
|
+
lib::error_code interrupt(interrupt_handler handler) {
|
1014
|
+
if (config::enable_multithreading) {
|
1015
|
+
m_io_service->post(m_strand->wrap(handler));
|
1016
|
+
} else {
|
1017
|
+
m_io_service->post(handler);
|
1018
|
+
}
|
1019
|
+
return lib::error_code();
|
1020
|
+
}
|
1021
|
+
|
1022
|
+
lib::error_code dispatch(dispatch_handler handler) {
|
1023
|
+
if (config::enable_multithreading) {
|
1024
|
+
m_io_service->post(m_strand->wrap(handler));
|
1025
|
+
} else {
|
1026
|
+
m_io_service->post(handler);
|
1027
|
+
}
|
1028
|
+
return lib::error_code();
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
/*void handle_interrupt(interrupt_handler handler) {
|
1032
|
+
handler();
|
1033
|
+
}*/
|
1034
|
+
|
1035
|
+
/// close and clean up the underlying socket
|
1036
|
+
void async_shutdown(shutdown_handler callback) {
|
1037
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
1038
|
+
m_alog.write(log::alevel::devel,"asio connection async_shutdown");
|
1039
|
+
}
|
1040
|
+
|
1041
|
+
timer_ptr shutdown_timer;
|
1042
|
+
shutdown_timer = set_timer(
|
1043
|
+
config::timeout_socket_shutdown,
|
1044
|
+
lib::bind(
|
1045
|
+
&type::handle_async_shutdown_timeout,
|
1046
|
+
get_shared(),
|
1047
|
+
shutdown_timer,
|
1048
|
+
callback,
|
1049
|
+
lib::placeholders::_1
|
1050
|
+
)
|
1051
|
+
);
|
1052
|
+
|
1053
|
+
socket_con_type::async_shutdown(
|
1054
|
+
lib::bind(
|
1055
|
+
&type::handle_async_shutdown,
|
1056
|
+
get_shared(),
|
1057
|
+
shutdown_timer,
|
1058
|
+
callback,
|
1059
|
+
lib::placeholders::_1
|
1060
|
+
)
|
1061
|
+
);
|
1062
|
+
}
|
1063
|
+
|
1064
|
+
/// Async shutdown timeout handler
|
1065
|
+
/**
|
1066
|
+
* @param shutdown_timer A pointer to the timer to keep it in scope
|
1067
|
+
* @param callback The function to call back
|
1068
|
+
* @param ec The status code
|
1069
|
+
*/
|
1070
|
+
void handle_async_shutdown_timeout(timer_ptr, init_handler callback,
|
1071
|
+
lib::error_code const & ec)
|
1072
|
+
{
|
1073
|
+
lib::error_code ret_ec;
|
1074
|
+
|
1075
|
+
if (ec) {
|
1076
|
+
if (ec == transport::error::operation_aborted) {
|
1077
|
+
m_alog.write(log::alevel::devel,
|
1078
|
+
"asio socket shutdown timer cancelled");
|
1079
|
+
return;
|
1080
|
+
}
|
1081
|
+
|
1082
|
+
log_err(log::elevel::devel,"asio handle_async_shutdown_timeout",ec);
|
1083
|
+
ret_ec = ec;
|
1084
|
+
} else {
|
1085
|
+
ret_ec = make_error_code(transport::error::timeout);
|
1086
|
+
}
|
1087
|
+
|
1088
|
+
m_alog.write(log::alevel::devel,
|
1089
|
+
"Asio transport socket shutdown timed out");
|
1090
|
+
cancel_socket_checked();
|
1091
|
+
callback(ret_ec);
|
1092
|
+
}
|
1093
|
+
|
1094
|
+
void handle_async_shutdown(timer_ptr shutdown_timer, shutdown_handler
|
1095
|
+
callback, lib::asio::error_code const & ec)
|
1096
|
+
{
|
1097
|
+
if (ec == lib::asio::error::operation_aborted ||
|
1098
|
+
lib::asio::is_neg(shutdown_timer->expires_from_now()))
|
1099
|
+
{
|
1100
|
+
m_alog.write(log::alevel::devel,"async_shutdown cancelled");
|
1101
|
+
return;
|
1102
|
+
}
|
1103
|
+
|
1104
|
+
shutdown_timer->cancel();
|
1105
|
+
|
1106
|
+
lib::error_code tec;
|
1107
|
+
if (ec) {
|
1108
|
+
if (ec == lib::asio::error::not_connected) {
|
1109
|
+
// The socket was already closed when we tried to close it. This
|
1110
|
+
// happens periodically (usually if a read or write fails
|
1111
|
+
// earlier and if it is a real error will be caught at another
|
1112
|
+
// level of the stack.
|
1113
|
+
} else {
|
1114
|
+
// We don't know anything more about this error, give our
|
1115
|
+
// socket/security policy a crack at it.
|
1116
|
+
tec = socket_con_type::translate_ec(ec);
|
1117
|
+
m_tec = ec;
|
1118
|
+
|
1119
|
+
if (tec == transport::error::tls_short_read) {
|
1120
|
+
// TLS short read at this point is somewhat expected if both
|
1121
|
+
// sides try and end the connection at the same time or if
|
1122
|
+
// SSLv2 is being used. In general there is nothing that can
|
1123
|
+
// be done here other than a low level development log.
|
1124
|
+
} else {
|
1125
|
+
// all other errors are effectively pass through errors of
|
1126
|
+
// some sort so print some detail on the info channel for
|
1127
|
+
// library users to look up if needed.
|
1128
|
+
log_err(log::elevel::info,"asio async_shutdown",ec);
|
1129
|
+
}
|
1130
|
+
}
|
1131
|
+
} else {
|
1132
|
+
if (m_alog.static_test(log::alevel::devel)) {
|
1133
|
+
m_alog.write(log::alevel::devel,
|
1134
|
+
"asio con handle_async_shutdown");
|
1135
|
+
}
|
1136
|
+
}
|
1137
|
+
callback(tec);
|
1138
|
+
}
|
1139
|
+
|
1140
|
+
/// Cancel the underlying socket and log any errors
|
1141
|
+
void cancel_socket_checked() {
|
1142
|
+
lib::asio::error_code cec = socket_con_type::cancel_socket();
|
1143
|
+
if (cec) {
|
1144
|
+
if (cec == lib::asio::error::operation_not_supported) {
|
1145
|
+
// cancel not supported on this OS, ignore and log at dev level
|
1146
|
+
m_alog.write(log::alevel::devel, "socket cancel not supported");
|
1147
|
+
} else {
|
1148
|
+
log_err(log::elevel::warn, "socket cancel failed", cec);
|
1149
|
+
}
|
1150
|
+
}
|
1151
|
+
}
|
1152
|
+
|
1153
|
+
private:
|
1154
|
+
/// Convenience method for logging the code and message for an error_code
|
1155
|
+
template <typename error_type>
|
1156
|
+
void log_err(log::level l, const char * msg, const error_type & ec) {
|
1157
|
+
std::stringstream s;
|
1158
|
+
s << msg << " error: " << ec << " (" << ec.message() << ")";
|
1159
|
+
m_elog.write(l,s.str());
|
1160
|
+
}
|
1161
|
+
|
1162
|
+
// static settings
|
1163
|
+
const bool m_is_server;
|
1164
|
+
alog_type& m_alog;
|
1165
|
+
elog_type& m_elog;
|
1166
|
+
|
1167
|
+
struct proxy_data {
|
1168
|
+
proxy_data() : timeout_proxy(config::timeout_proxy) {}
|
1169
|
+
|
1170
|
+
request_type req;
|
1171
|
+
response_type res;
|
1172
|
+
std::string write_buf;
|
1173
|
+
lib::asio::streambuf read_buf;
|
1174
|
+
long timeout_proxy;
|
1175
|
+
timer_ptr timer;
|
1176
|
+
};
|
1177
|
+
|
1178
|
+
std::string m_proxy;
|
1179
|
+
lib::shared_ptr<proxy_data> m_proxy_data;
|
1180
|
+
|
1181
|
+
// transport resources
|
1182
|
+
io_service_ptr m_io_service;
|
1183
|
+
strand_ptr m_strand;
|
1184
|
+
connection_hdl m_connection_hdl;
|
1185
|
+
|
1186
|
+
std::vector<lib::asio::const_buffer> m_bufs;
|
1187
|
+
|
1188
|
+
/// Detailed internal error code
|
1189
|
+
lib::asio::error_code m_tec;
|
1190
|
+
|
1191
|
+
// Handlers
|
1192
|
+
tcp_init_handler m_tcp_pre_init_handler;
|
1193
|
+
tcp_init_handler m_tcp_post_init_handler;
|
1194
|
+
|
1195
|
+
handler_allocator m_read_handler_allocator;
|
1196
|
+
handler_allocator m_write_handler_allocator;
|
1197
|
+
};
|
1198
|
+
|
1199
|
+
|
1200
|
+
} // namespace asio
|
1201
|
+
} // namespace transport
|
1202
|
+
} // namespace websocketpp
|
1203
|
+
|
1204
|
+
#endif // WEBSOCKETPP_TRANSPORT_ASIO_CON_HPP
|