couchbase 3.0.0.alpha.2-universal-darwin-19 → 3.0.0-universal-darwin-19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +227 -0
- data/.rubocop_todo.yml +47 -0
- data/.yardopts +1 -0
- data/CONTRIBUTING.md +110 -0
- data/Gemfile +16 -3
- data/README.md +6 -4
- data/Rakefile +6 -2
- data/couchbase.gemspec +46 -13
- data/examples/analytics.rb +236 -0
- data/examples/auth.rb +33 -0
- data/examples/crud.rb +16 -2
- data/examples/managing_analytics_indexes.rb +86 -0
- data/examples/managing_buckets.rb +17 -3
- data/examples/managing_collections.rb +22 -9
- data/examples/managing_query_indexes.rb +39 -19
- data/examples/managing_search_indexes.rb +77 -0
- data/examples/managing_view_indexes.rb +68 -0
- data/examples/query.rb +17 -3
- data/examples/query_with_consistency.rb +30 -20
- data/examples/search.rb +202 -0
- data/examples/search_with_consistency.rb +97 -0
- data/examples/subdocument.rb +42 -30
- data/examples/view.rb +59 -0
- data/ext/.clang-tidy +2 -0
- data/ext/.idea/misc.xml +12 -0
- data/ext/CMakeLists.txt +50 -3
- data/ext/build_config.hxx.in +20 -0
- data/ext/build_version.hxx.in +1 -1
- data/ext/couchbase/bucket.hxx +228 -51
- data/ext/couchbase/cluster.hxx +147 -87
- data/ext/couchbase/cluster_options.hxx +53 -0
- data/ext/couchbase/configuration.hxx +232 -14
- data/ext/couchbase/couchbase.cxx +4250 -1458
- data/ext/couchbase/error_map.hxx +202 -2
- data/ext/couchbase/errors.hxx +8 -2
- data/ext/couchbase/io/dns_client.hxx +217 -0
- data/ext/couchbase/io/dns_codec.hxx +207 -0
- data/ext/couchbase/io/dns_config.hxx +116 -0
- data/ext/couchbase/io/dns_message.hxx +555 -0
- data/ext/couchbase/io/http_command.hxx +91 -0
- data/ext/couchbase/io/http_session.hxx +119 -47
- data/ext/couchbase/io/{session_manager.hxx → http_session_manager.hxx} +34 -34
- data/ext/couchbase/io/mcbp_command.hxx +237 -0
- data/ext/couchbase/io/mcbp_message.hxx +24 -2
- data/ext/couchbase/io/mcbp_parser.hxx +2 -0
- data/ext/couchbase/io/mcbp_session.hxx +455 -173
- data/ext/couchbase/io/retry_action.hxx +30 -0
- data/ext/couchbase/io/retry_context.hxx +39 -0
- data/ext/couchbase/io/retry_orchestrator.hxx +96 -0
- data/ext/couchbase/io/retry_reason.hxx +235 -0
- data/ext/couchbase/io/retry_strategy.hxx +156 -0
- data/ext/couchbase/io/streams.hxx +165 -0
- data/ext/couchbase/mutation_token.hxx +1 -1
- data/ext/couchbase/operations.hxx +33 -1
- data/ext/couchbase/operations/analytics_dataset_create.hxx +117 -0
- data/ext/couchbase/operations/analytics_dataset_drop.hxx +103 -0
- data/ext/couchbase/operations/analytics_dataset_get_all.hxx +107 -0
- data/ext/couchbase/operations/analytics_dataverse_create.hxx +104 -0
- data/ext/couchbase/operations/analytics_dataverse_drop.hxx +104 -0
- data/ext/couchbase/operations/analytics_get_pending_mutations.hxx +91 -0
- data/ext/couchbase/operations/analytics_index_create.hxx +128 -0
- data/ext/couchbase/operations/analytics_index_drop.hxx +110 -0
- data/ext/couchbase/operations/analytics_index_get_all.hxx +106 -0
- data/ext/couchbase/operations/analytics_link_connect.hxx +102 -0
- data/ext/couchbase/operations/analytics_link_disconnect.hxx +101 -0
- data/ext/couchbase/operations/bucket_create.hxx +5 -2
- data/ext/couchbase/operations/bucket_drop.hxx +5 -2
- data/ext/couchbase/operations/bucket_flush.hxx +5 -2
- data/ext/couchbase/operations/bucket_get.hxx +5 -2
- data/ext/couchbase/operations/bucket_get_all.hxx +5 -2
- data/ext/couchbase/operations/bucket_update.hxx +5 -2
- data/ext/couchbase/operations/cluster_developer_preview_enable.hxx +5 -2
- data/ext/couchbase/operations/collection_create.hxx +10 -3
- data/ext/couchbase/operations/collection_drop.hxx +5 -2
- data/ext/couchbase/operations/design_document.hxx +59 -0
- data/ext/couchbase/operations/document_analytics.hxx +288 -0
- data/ext/couchbase/operations/document_decrement.hxx +11 -4
- data/ext/couchbase/operations/document_exists.hxx +5 -1
- data/ext/couchbase/operations/document_get.hxx +8 -1
- data/ext/couchbase/operations/document_get_and_lock.hxx +8 -1
- data/ext/couchbase/operations/document_get_and_touch.hxx +10 -3
- data/ext/couchbase/operations/document_get_projected.hxx +249 -0
- data/ext/couchbase/operations/document_increment.hxx +14 -5
- data/ext/couchbase/operations/document_insert.hxx +10 -3
- data/ext/couchbase/operations/document_lookup_in.hxx +27 -1
- data/ext/couchbase/operations/document_mutate_in.hxx +51 -2
- data/ext/couchbase/operations/document_query.hxx +31 -11
- data/ext/couchbase/operations/document_remove.hxx +8 -1
- data/ext/couchbase/operations/document_replace.hxx +10 -3
- data/ext/couchbase/operations/document_search.hxx +360 -0
- data/ext/couchbase/operations/document_touch.hxx +10 -3
- data/ext/couchbase/operations/document_unlock.hxx +8 -1
- data/ext/couchbase/operations/document_upsert.hxx +10 -3
- data/ext/couchbase/operations/document_view.hxx +228 -0
- data/ext/couchbase/operations/query_index_build_deferred.hxx +4 -3
- data/ext/couchbase/operations/query_index_create.hxx +18 -7
- data/ext/couchbase/operations/query_index_drop.hxx +16 -5
- data/ext/couchbase/operations/query_index_get_all.hxx +15 -5
- data/ext/couchbase/operations/scope_create.hxx +5 -2
- data/ext/couchbase/operations/scope_drop.hxx +5 -2
- data/ext/couchbase/operations/scope_get_all.hxx +6 -2
- data/ext/couchbase/operations/search_index.hxx +79 -0
- data/ext/couchbase/operations/search_index_analyze_document.hxx +92 -0
- data/ext/couchbase/operations/search_index_control_ingest.hxx +80 -0
- data/ext/couchbase/operations/search_index_control_plan_freeze.hxx +80 -0
- data/ext/couchbase/operations/search_index_control_query.hxx +80 -0
- data/ext/couchbase/operations/search_index_drop.hxx +77 -0
- data/ext/couchbase/operations/search_index_get.hxx +80 -0
- data/ext/couchbase/operations/search_index_get_all.hxx +82 -0
- data/ext/couchbase/operations/search_index_get_documents_count.hxx +81 -0
- data/ext/couchbase/operations/search_index_upsert.hxx +106 -0
- data/ext/couchbase/operations/view_index_drop.hxx +67 -0
- data/ext/couchbase/operations/view_index_get.hxx +90 -0
- data/ext/couchbase/operations/view_index_get_all.hxx +125 -0
- data/ext/couchbase/operations/view_index_upsert.hxx +87 -0
- data/ext/couchbase/origin.hxx +178 -0
- data/ext/couchbase/platform/backtrace.c +189 -0
- data/ext/couchbase/platform/backtrace.h +54 -0
- data/ext/couchbase/platform/terminate_handler.cc +122 -0
- data/ext/couchbase/platform/terminate_handler.h +36 -0
- data/ext/couchbase/protocol/client_opcode.hxx +17 -3
- data/ext/couchbase/protocol/client_response.hxx +1 -1
- data/ext/couchbase/protocol/cmd_cluster_map_change_notification.hxx +1 -6
- data/ext/couchbase/protocol/cmd_decrement.hxx +5 -5
- data/ext/couchbase/protocol/cmd_get_and_touch.hxx +5 -5
- data/ext/couchbase/protocol/cmd_get_cluster_config.hxx +7 -7
- data/ext/couchbase/protocol/cmd_get_collection_id.hxx +117 -0
- data/ext/couchbase/protocol/cmd_hello.hxx +10 -0
- data/ext/couchbase/protocol/cmd_increment.hxx +5 -5
- data/ext/couchbase/protocol/cmd_info.hxx +0 -11
- data/ext/couchbase/protocol/cmd_insert.hxx +5 -5
- data/ext/couchbase/protocol/cmd_lookup_in.hxx +1 -0
- data/ext/couchbase/protocol/cmd_mutate_in.hxx +53 -5
- data/ext/couchbase/protocol/cmd_replace.hxx +5 -5
- data/ext/couchbase/protocol/cmd_touch.hxx +1 -1
- data/ext/couchbase/protocol/cmd_upsert.hxx +5 -5
- data/ext/couchbase/protocol/status.hxx +14 -4
- data/ext/couchbase/service_type.hxx +38 -1
- data/ext/couchbase/timeout_defaults.hxx +41 -0
- data/ext/couchbase/utils/connection_string.hxx +370 -0
- data/ext/couchbase/version.hxx +2 -2
- data/ext/extconf.rb +60 -24
- data/ext/test/main.cxx +139 -22
- data/ext/third_party/http_parser/Makefile +160 -0
- data/ext/third_party/json/Makefile +77 -0
- data/lib/couchbase.rb +0 -1
- data/lib/couchbase/analytics_options.rb +177 -0
- data/lib/couchbase/authenticator.rb +14 -0
- data/lib/couchbase/binary_collection.rb +17 -13
- data/lib/couchbase/binary_collection_options.rb +14 -8
- data/lib/couchbase/bucket.rb +55 -3
- data/lib/couchbase/cluster.rb +219 -250
- data/lib/couchbase/collection.rb +67 -33
- data/lib/couchbase/collection_options.rb +95 -15
- data/lib/couchbase/common_options.rb +1 -1
- data/{bin/console → lib/couchbase/datastructures.rb} +4 -7
- data/lib/couchbase/datastructures/couchbase_list.rb +171 -0
- data/lib/couchbase/datastructures/couchbase_map.rb +205 -0
- data/lib/couchbase/datastructures/couchbase_queue.rb +145 -0
- data/lib/couchbase/datastructures/couchbase_set.rb +139 -0
- data/lib/couchbase/errors.rb +76 -66
- data/lib/couchbase/json_transcoder.rb +4 -4
- data/lib/couchbase/libcouchbase.bundle +0 -0
- data/lib/couchbase/management/analytics_index_manager.rb +139 -25
- data/lib/couchbase/management/bucket_manager.rb +19 -5
- data/lib/couchbase/management/collection_manager.rb +16 -7
- data/lib/couchbase/management/query_index_manager.rb +75 -20
- data/lib/couchbase/management/search_index_manager.rb +65 -15
- data/lib/couchbase/management/user_manager.rb +2 -2
- data/lib/couchbase/management/view_index_manager.rb +70 -11
- data/lib/couchbase/mutation_state.rb +13 -0
- data/lib/couchbase/query_options.rb +256 -0
- data/lib/couchbase/scope.rb +61 -8
- data/lib/couchbase/search_options.rb +1512 -0
- data/lib/couchbase/subdoc.rb +87 -23
- data/lib/couchbase/version.rb +2 -2
- data/lib/couchbase/view_options.rb +155 -0
- metadata +86 -781
- data/.github/workflows/tests-6.0.3.yml +0 -49
- data/.github/workflows/tests.yml +0 -47
- data/.gitignore +0 -20
- data/.gitmodules +0 -18
- data/.idea/.gitignore +0 -5
- data/.idea/dictionaries/gem_terms.xml +0 -18
- data/.idea/inspectionProfiles/Project_Default.xml +0 -8
- data/.idea/vcs.xml +0 -12
- data/bin/init-cluster +0 -62
- data/bin/setup +0 -24
- data/ext/couchbase/configuration_monitor.hxx +0 -93
- data/ext/couchbase/operations/command.hxx +0 -77
- data/ext/third_party/asio/asio/src/examples/cpp03/Makefile.am +0 -251
- data/ext/third_party/asio/asio/src/examples/cpp03/allocation/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/allocation/server.cpp +0 -285
- data/ext/third_party/asio/asio/src/examples/cpp03/buffers/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/buffers/reference_counted.cpp +0 -131
- data/ext/third_party/asio/asio/src/examples/cpp03/chat/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/chat/chat_client.cpp +0 -177
- data/ext/third_party/asio/asio/src/examples/cpp03/chat/chat_message.hpp +0 -93
- data/ext/third_party/asio/asio/src/examples/cpp03/chat/chat_server.cpp +0 -249
- data/ext/third_party/asio/asio/src/examples/cpp03/chat/posix_chat_client.cpp +0 -204
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/async_tcp_echo_server.cpp +0 -137
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/async_udp_echo_server.cpp +0 -92
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/blocking_tcp_echo_client.cpp +0 -59
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/blocking_tcp_echo_server.cpp +0 -79
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/blocking_udp_echo_client.cpp +0 -59
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/blocking_udp_echo_server.cpp +0 -53
- data/ext/third_party/asio/asio/src/examples/cpp03/fork/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/fork/daemon.cpp +0 -190
- data/ext/third_party/asio/asio/src/examples/cpp03/fork/process_per_connection.cpp +0 -161
- data/ext/third_party/asio/asio/src/examples/cpp03/http/client/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/http/client/async_client.cpp +0 -204
- data/ext/third_party/asio/asio/src/examples/cpp03/http/client/sync_client.cpp +0 -106
- data/ext/third_party/asio/asio/src/examples/cpp03/http/doc_root/data_1K.html +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp03/http/doc_root/data_2K.html +0 -49
- data/ext/third_party/asio/asio/src/examples/cpp03/http/doc_root/data_4K.html +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp03/http/doc_root/data_8K.html +0 -175
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/connection.cpp +0 -99
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/connection.hpp +0 -83
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/connection_manager.cpp +0 -38
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/connection_manager.hpp +0 -44
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/header.hpp +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/main.cpp +0 -44
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/mime_types.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/mime_types.hpp +0 -27
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/reply.cpp +0 -256
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/reply.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/request.hpp +0 -34
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/request_handler.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/request_handler.hpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/request_parser.cpp +0 -315
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/request_parser.hpp +0 -95
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/server.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/server.hpp +0 -69
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/connection.cpp +0 -93
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/connection.hpp +0 -75
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/header.hpp +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/io_context_pool.cpp +0 -69
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/io_context_pool.hpp +0 -58
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/main.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/mime_types.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/mime_types.hpp +0 -27
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/reply.cpp +0 -256
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/reply.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/request.hpp +0 -34
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/request_handler.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/request_handler.hpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/request_parser.cpp +0 -315
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/request_parser.hpp +0 -95
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/server.cpp +0 -77
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/server.hpp +0 -68
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/connection.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/connection.hpp +0 -78
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/header.hpp +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/main.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/mime_types.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/mime_types.hpp +0 -27
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/reply.cpp +0 -256
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/reply.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/request.hpp +0 -34
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/request_handler.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/request_handler.hpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/request_parser.cpp +0 -315
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/request_parser.hpp +0 -95
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/server.cpp +0 -89
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/server.hpp +0 -70
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/file_handler.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/file_handler.hpp +0 -44
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/header.hpp +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/main.cpp +0 -58
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/mime_types.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/mime_types.hpp +0 -27
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/reply.cpp +0 -256
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/reply.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/request.hpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/request_parser.cpp +0 -226
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/request_parser.hpp +0 -78
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/server.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/server.hpp +0 -73
- data/ext/third_party/asio/asio/src/examples/cpp03/icmp/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/icmp/icmp_header.hpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp03/icmp/ipv4_header.hpp +0 -102
- data/ext/third_party/asio/asio/src/examples/cpp03/icmp/ping.cpp +0 -163
- data/ext/third_party/asio/asio/src/examples/cpp03/invocation/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/invocation/prioritised_handlers.cpp +0 -171
- data/ext/third_party/asio/asio/src/examples/cpp03/iostreams/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/iostreams/daytime_client.cpp +0 -44
- data/ext/third_party/asio/asio/src/examples/cpp03/iostreams/daytime_server.cpp +0 -51
- data/ext/third_party/asio/asio/src/examples/cpp03/iostreams/http_client.cpp +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp03/local/.gitignore +0 -13
- data/ext/third_party/asio/asio/src/examples/cpp03/local/connect_pair.cpp +0 -141
- data/ext/third_party/asio/asio/src/examples/cpp03/local/iostream_client.cpp +0 -62
- data/ext/third_party/asio/asio/src/examples/cpp03/local/stream_client.cpp +0 -61
- data/ext/third_party/asio/asio/src/examples/cpp03/local/stream_server.cpp +0 -141
- data/ext/third_party/asio/asio/src/examples/cpp03/multicast/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/multicast/receiver.cpp +0 -93
- data/ext/third_party/asio/asio/src/examples/cpp03/multicast/sender.cpp +0 -98
- data/ext/third_party/asio/asio/src/examples/cpp03/nonblocking/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/nonblocking/third_party_lib.cpp +0 -240
- data/ext/third_party/asio/asio/src/examples/cpp03/porthopper/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/porthopper/client.cpp +0 -192
- data/ext/third_party/asio/asio/src/examples/cpp03/porthopper/protocol.hpp +0 -156
- data/ext/third_party/asio/asio/src/examples/cpp03/porthopper/server.cpp +0 -187
- data/ext/third_party/asio/asio/src/examples/cpp03/serialization/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/serialization/client.cpp +0 -125
- data/ext/third_party/asio/asio/src/examples/cpp03/serialization/connection.hpp +0 -188
- data/ext/third_party/asio/asio/src/examples/cpp03/serialization/server.cpp +0 -123
- data/ext/third_party/asio/asio/src/examples/cpp03/serialization/stock.hpp +0 -50
- data/ext/third_party/asio/asio/src/examples/cpp03/services/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/services/basic_logger.hpp +0 -83
- data/ext/third_party/asio/asio/src/examples/cpp03/services/daytime_client.cpp +0 -97
- data/ext/third_party/asio/asio/src/examples/cpp03/services/logger.hpp +0 -24
- data/ext/third_party/asio/asio/src/examples/cpp03/services/logger_service.cpp +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/services/logger_service.hpp +0 -145
- data/ext/third_party/asio/asio/src/examples/cpp03/socks4/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/socks4/socks4.hpp +0 -144
- data/ext/third_party/asio/asio/src/examples/cpp03/socks4/sync_client.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp03/spawn/.gitignore +0 -12
- data/ext/third_party/asio/asio/src/examples/cpp03/spawn/echo_server.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/spawn/parallel_grep.cpp +0 -89
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/README +0 -8
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/ca.pem +0 -49
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/client.cpp +0 -157
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/dh2048.pem +0 -8
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/server.cpp +0 -170
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/server.pem +0 -71
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/async_tcp_client.cpp +0 -311
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/blocking_tcp_client.cpp +0 -191
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp +0 -200
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/blocking_udp_client.cpp +0 -154
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/server.cpp +0 -433
- data/ext/third_party/asio/asio/src/examples/cpp03/timers/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/timers/time_t_timer.cpp +0 -106
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime1/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime1/client.cpp +0 -57
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime2/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime2/server.cpp +0 -50
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime3/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime3/server.cpp +0 -119
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime4/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime4/client.cpp +0 -52
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime5/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime5/server.cpp +0 -53
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime6/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime6/server.cpp +0 -89
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime7/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime7/server.cpp +0 -160
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime_dox.txt +0 -500
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/index_dox.txt +0 -48
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer1/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer1/timer.cpp +0 -24
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer2/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer2/timer.cpp +0 -29
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer3/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer3/timer.cpp +0 -43
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer4/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer4/timer.cpp +0 -54
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer5/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer5/timer.cpp +0 -80
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer_dox.txt +0 -378
- data/ext/third_party/asio/asio/src/examples/cpp03/windows/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/windows/transmit_file.cpp +0 -177
- data/ext/third_party/asio/asio/src/examples/cpp11/Makefile.am +0 -161
- data/ext/third_party/asio/asio/src/examples/cpp11/allocation/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/allocation/server.cpp +0 -255
- data/ext/third_party/asio/asio/src/examples/cpp11/buffers/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/buffers/reference_counted.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp11/chat/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/chat/chat_client.cpp +0 -167
- data/ext/third_party/asio/asio/src/examples/cpp11/chat/chat_message.hpp +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp11/chat/chat_server.cpp +0 -227
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/async_tcp_echo_server.cpp +0 -114
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/async_udp_echo_server.cpp +0 -82
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/blocking_tcp_echo_client.cpp +0 -55
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp +0 -74
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/blocking_udp_echo_client.cpp +0 -58
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/blocking_udp_echo_server.cpp +0 -52
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/.gitignore +0 -5
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/actor.cpp +0 -286
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/bank_account_1.cpp +0 -54
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/bank_account_2.cpp +0 -54
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/fork_join.cpp +0 -328
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/pipeline.cpp +0 -299
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/priority_scheduler.cpp +0 -174
- data/ext/third_party/asio/asio/src/examples/cpp11/fork/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/fork/daemon.cpp +0 -189
- data/ext/third_party/asio/asio/src/examples/cpp11/fork/process_per_connection.cpp +0 -162
- data/ext/third_party/asio/asio/src/examples/cpp11/futures/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/futures/daytime_client.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp +0 -201
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/connection.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/connection.hpp +0 -79
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.cpp +0 -40
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp +0 -48
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/header.hpp +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/main.cpp +0 -43
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/mime_types.cpp +0 -45
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/mime_types.hpp +0 -27
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/reply.cpp +0 -255
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/reply.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/request.hpp +0 -34
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/request_handler.cpp +0 -121
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/request_handler.hpp +0 -47
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/request_parser.cpp +0 -315
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/request_parser.hpp +0 -96
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/server.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/server.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp11/invocation/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp +0 -202
- data/ext/third_party/asio/asio/src/examples/cpp11/iostreams/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/iostreams/http_client.cpp +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp11/local/.gitignore +0 -13
- data/ext/third_party/asio/asio/src/examples/cpp11/local/connect_pair.cpp +0 -129
- data/ext/third_party/asio/asio/src/examples/cpp11/local/iostream_client.cpp +0 -61
- data/ext/third_party/asio/asio/src/examples/cpp11/local/stream_client.cpp +0 -60
- data/ext/third_party/asio/asio/src/examples/cpp11/local/stream_server.cpp +0 -121
- data/ext/third_party/asio/asio/src/examples/cpp11/multicast/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/multicast/receiver.cpp +0 -88
- data/ext/third_party/asio/asio/src/examples/cpp11/multicast/sender.cpp +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp11/nonblocking/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/nonblocking/third_party_lib.cpp +0 -212
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_1.cpp +0 -113
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_2.cpp +0 -131
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_3.cpp +0 -192
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_4.cpp +0 -207
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_5.cpp +0 -243
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_6.cpp +0 -302
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_7.cpp +0 -222
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_8.cpp +0 -217
- data/ext/third_party/asio/asio/src/examples/cpp11/socks4/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/socks4/socks4.hpp +0 -143
- data/ext/third_party/asio/asio/src/examples/cpp11/socks4/sync_client.cpp +0 -93
- data/ext/third_party/asio/asio/src/examples/cpp11/spawn/.gitignore +0 -12
- data/ext/third_party/asio/asio/src/examples/cpp11/spawn/echo_server.cpp +0 -111
- data/ext/third_party/asio/asio/src/examples/cpp11/spawn/parallel_grep.cpp +0 -84
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/README +0 -8
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/ca.pem +0 -49
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/client.cpp +0 -165
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/dh2048.pem +0 -8
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/server.cpp +0 -143
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/server.pem +0 -71
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/async_tcp_client.cpp +0 -311
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/blocking_tcp_client.cpp +0 -192
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/blocking_token_tcp_client.cpp +0 -197
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/blocking_udp_client.cpp +0 -155
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/server.cpp +0 -433
- data/ext/third_party/asio/asio/src/examples/cpp11/timers/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/timers/time_t_timer.cpp +0 -106
- data/ext/third_party/asio/asio/src/examples/cpp14/Makefile.am +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/async_tcp_echo_server.cpp +0 -117
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/async_udp_echo_server.cpp +0 -83
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/blocking_tcp_echo_client.cpp +0 -55
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/blocking_tcp_echo_server.cpp +0 -77
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/blocking_udp_echo_client.cpp +0 -59
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/blocking_udp_echo_server.cpp +0 -53
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/.gitignore +0 -6
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/actor.cpp +0 -281
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/async_1.cpp +0 -47
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/async_2.cpp +0 -68
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/bank_account_1.cpp +0 -54
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/bank_account_2.cpp +0 -53
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/fork_join.cpp +0 -327
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/pipeline.cpp +0 -294
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/priority_scheduler.cpp +0 -173
- data/ext/third_party/asio/asio/src/examples/cpp14/iostreams/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp14/iostreams/http_client.cpp +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_1.cpp +0 -113
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_2.cpp +0 -131
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_3.cpp +0 -186
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_4.cpp +0 -201
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_5.cpp +0 -238
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_6.cpp +0 -298
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_7.cpp +0 -219
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_8.cpp +0 -212
- data/ext/third_party/asio/asio/src/examples/cpp17/Makefile.am +0 -8
- data/ext/third_party/asio/asio/src/examples/cpp17/coroutines_ts/chat_server.cpp +0 -225
- data/ext/third_party/asio/asio/src/examples/cpp17/coroutines_ts/echo_server.cpp +0 -76
- data/ext/third_party/asio/asio/src/examples/cpp17/coroutines_ts/echo_server_with_default.cpp +0 -78
- data/ext/third_party/asio/asio/src/examples/cpp17/coroutines_ts/range_based_for.cpp +0 -107
- data/ext/third_party/asio/asio/src/examples/cpp17/coroutines_ts/refactored_echo_server.cpp +0 -85
- data/ext/third_party/asio/asio/src/tests/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/tests/Makefile.am +0 -432
- data/ext/third_party/asio/asio/src/tests/latency/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/tests/latency/allocator.hpp +0 -52
- data/ext/third_party/asio/asio/src/tests/latency/high_res_clock.hpp +0 -53
- data/ext/third_party/asio/asio/src/tests/latency/tcp_client.cpp +0 -124
- data/ext/third_party/asio/asio/src/tests/latency/tcp_server.cpp +0 -114
- data/ext/third_party/asio/asio/src/tests/latency/udp_client.cpp +0 -104
- data/ext/third_party/asio/asio/src/tests/latency/udp_server.cpp +0 -125
- data/ext/third_party/asio/asio/src/tests/performance/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/tests/performance/client.cpp +0 -286
- data/ext/third_party/asio/asio/src/tests/performance/handler_allocator.hpp +0 -112
- data/ext/third_party/asio/asio/src/tests/performance/server.cpp +0 -233
- data/ext/third_party/asio/asio/src/tests/unit/.gitignore +0 -75
- data/ext/third_party/asio/asio/src/tests/unit/archetypes/async_ops.hpp +0 -415
- data/ext/third_party/asio/asio/src/tests/unit/archetypes/async_result.hpp +0 -94
- data/ext/third_party/asio/asio/src/tests/unit/archetypes/gettable_socket_option.hpp +0 -54
- data/ext/third_party/asio/asio/src/tests/unit/archetypes/io_control_command.hpp +0 -32
- data/ext/third_party/asio/asio/src/tests/unit/archetypes/settable_socket_option.hpp +0 -49
- data/ext/third_party/asio/asio/src/tests/unit/associated_allocator.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/associated_executor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/async_result.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/awaitable.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_datagram_socket.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_deadline_timer.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_raw_socket.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_seq_packet_socket.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_serial_port.cpp +0 -26
- data/ext/third_party/asio/asio/src/tests/unit/basic_signal_set.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_socket.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_socket_acceptor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_stream_socket.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_streambuf.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_waitable_timer.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/bind_executor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/buffer.cpp +0 -830
- data/ext/third_party/asio/asio/src/tests/unit/buffered_read_stream.cpp +0 -338
- data/ext/third_party/asio/asio/src/tests/unit/buffered_stream.cpp +0 -364
- data/ext/third_party/asio/asio/src/tests/unit/buffered_write_stream.cpp +0 -353
- data/ext/third_party/asio/asio/src/tests/unit/buffers_iterator.cpp +0 -292
- data/ext/third_party/asio/asio/src/tests/unit/co_spawn.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/completion_condition.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/compose.cpp +0 -185
- data/ext/third_party/asio/asio/src/tests/unit/connect.cpp +0 -1190
- data/ext/third_party/asio/asio/src/tests/unit/coroutine.cpp +0 -112
- data/ext/third_party/asio/asio/src/tests/unit/deadline_timer.cpp +0 -392
- data/ext/third_party/asio/asio/src/tests/unit/defer.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/detached.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/dispatch.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/error.cpp +0 -89
- data/ext/third_party/asio/asio/src/tests/unit/execution_context.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/executor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/executor_work_guard.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/generic/.gitignore +0 -14
- data/ext/third_party/asio/asio/src/tests/unit/generic/basic_endpoint.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/generic/datagram_protocol.cpp +0 -263
- data/ext/third_party/asio/asio/src/tests/unit/generic/raw_protocol.cpp +0 -263
- data/ext/third_party/asio/asio/src/tests/unit/generic/seq_packet_protocol.cpp +0 -205
- data/ext/third_party/asio/asio/src/tests/unit/generic/stream_protocol.cpp +0 -248
- data/ext/third_party/asio/asio/src/tests/unit/high_resolution_timer.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/io_context.cpp +0 -362
- data/ext/third_party/asio/asio/src/tests/unit/io_context_strand.cpp +0 -325
- data/ext/third_party/asio/asio/src/tests/unit/ip/.gitignore +0 -27
- data/ext/third_party/asio/asio/src/tests/unit/ip/address.cpp +0 -144
- data/ext/third_party/asio/asio/src/tests/unit/ip/basic_endpoint.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/basic_resolver.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/basic_resolver_entry.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/basic_resolver_iterator.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/basic_resolver_query.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/host_name.cpp +0 -55
- data/ext/third_party/asio/asio/src/tests/unit/ip/icmp.cpp +0 -577
- data/ext/third_party/asio/asio/src/tests/unit/ip/multicast.cpp +0 -363
- data/ext/third_party/asio/asio/src/tests/unit/ip/network_v4.cpp +0 -314
- data/ext/third_party/asio/asio/src/tests/unit/ip/network_v6.cpp +0 -238
- data/ext/third_party/asio/asio/src/tests/unit/ip/resolver_query_base.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/tcp.cpp +0 -1346
- data/ext/third_party/asio/asio/src/tests/unit/ip/udp.cpp +0 -673
- data/ext/third_party/asio/asio/src/tests/unit/ip/unicast.cpp +0 -171
- data/ext/third_party/asio/asio/src/tests/unit/ip/v6_only.cpp +0 -135
- data/ext/third_party/asio/asio/src/tests/unit/is_read_buffered.cpp +0 -129
- data/ext/third_party/asio/asio/src/tests/unit/is_write_buffered.cpp +0 -129
- data/ext/third_party/asio/asio/src/tests/unit/local/.gitignore +0 -13
- data/ext/third_party/asio/asio/src/tests/unit/local/basic_endpoint.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/local/connect_pair.cpp +0 -76
- data/ext/third_party/asio/asio/src/tests/unit/local/datagram_protocol.cpp +0 -242
- data/ext/third_party/asio/asio/src/tests/unit/local/stream_protocol.cpp +0 -219
- data/ext/third_party/asio/asio/src/tests/unit/packaged_task.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/placeholders.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/posix/.gitignore +0 -14
- data/ext/third_party/asio/asio/src/tests/unit/posix/basic_descriptor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/posix/basic_stream_descriptor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/posix/descriptor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/posix/descriptor_base.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/posix/stream_descriptor.cpp +0 -183
- data/ext/third_party/asio/asio/src/tests/unit/post.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/read.cpp +0 -4997
- data/ext/third_party/asio/asio/src/tests/unit/read_at.cpp +0 -7502
- data/ext/third_party/asio/asio/src/tests/unit/read_until.cpp +0 -1658
- data/ext/third_party/asio/asio/src/tests/unit/redirect_error.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/serial_port.cpp +0 -173
- data/ext/third_party/asio/asio/src/tests/unit/serial_port_base.cpp +0 -99
- data/ext/third_party/asio/asio/src/tests/unit/signal_set.cpp +0 -95
- data/ext/third_party/asio/asio/src/tests/unit/socket_base.cpp +0 -650
- data/ext/third_party/asio/asio/src/tests/unit/ssl/.gitignore +0 -15
- data/ext/third_party/asio/asio/src/tests/unit/ssl/context.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ssl/context_base.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ssl/error.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ssl/host_name_verification.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ssl/rfc2818_verification.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ssl/stream.cpp +0 -191
- data/ext/third_party/asio/asio/src/tests/unit/ssl/stream_base.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/steady_timer.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/strand.cpp +0 -263
- data/ext/third_party/asio/asio/src/tests/unit/streambuf.cpp +0 -62
- data/ext/third_party/asio/asio/src/tests/unit/system_context.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/system_executor.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/system_timer.cpp +0 -399
- data/ext/third_party/asio/asio/src/tests/unit/this_coro.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/thread.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/time_traits.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ts/.gitignore +0 -17
- data/ext/third_party/asio/asio/src/tests/unit/ts/buffer.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/executor.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/internet.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/io_context.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/net.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/netfwd.cpp +0 -33
- data/ext/third_party/asio/asio/src/tests/unit/ts/socket.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/timer.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/unit_test.hpp +0 -175
- data/ext/third_party/asio/asio/src/tests/unit/use_awaitable.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/use_future.cpp +0 -670
- data/ext/third_party/asio/asio/src/tests/unit/uses_executor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/wait_traits.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/windows/.gitignore +0 -18
- data/ext/third_party/asio/asio/src/tests/unit/windows/basic_object_handle.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/windows/basic_overlapped_handle.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/windows/basic_random_access_handle.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/windows/basic_stream_handle.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/windows/object_handle.cpp +0 -130
- data/ext/third_party/asio/asio/src/tests/unit/windows/overlapped_handle.cpp +0 -26
- data/ext/third_party/asio/asio/src/tests/unit/windows/overlapped_ptr.cpp +0 -107
- data/ext/third_party/asio/asio/src/tests/unit/windows/random_access_handle.cpp +0 -155
- data/ext/third_party/asio/asio/src/tests/unit/windows/stream_handle.cpp +0 -148
- data/ext/third_party/asio/asio/src/tests/unit/write.cpp +0 -4904
- data/ext/third_party/asio/asio/src/tests/unit/write_at.cpp +0 -7563
- data/ext/third_party/asio/asio/src/tools/handlerviz.pl +0 -299
- data/ext/third_party/gsl/tests/CMakeLists.txt +0 -267
- data/ext/third_party/gsl/tests/CMakeLists.txt.in +0 -14
- data/ext/third_party/gsl/tests/algorithm_tests.cpp +0 -227
- data/ext/third_party/gsl/tests/assertion_tests.cpp +0 -61
- data/ext/third_party/gsl/tests/at_tests.cpp +0 -135
- data/ext/third_party/gsl/tests/bounds_tests.cpp +0 -102
- data/ext/third_party/gsl/tests/byte_tests.cpp +0 -129
- data/ext/third_party/gsl/tests/multi_span_tests.cpp +0 -1866
- data/ext/third_party/gsl/tests/no_exception_ensure_tests.cpp +0 -48
- data/ext/third_party/gsl/tests/notnull_tests.cpp +0 -535
- data/ext/third_party/gsl/tests/owner_tests.cpp +0 -43
- data/ext/third_party/gsl/tests/span_compatibility_tests.cpp +0 -1021
- data/ext/third_party/gsl/tests/span_ext_tests.cpp +0 -360
- data/ext/third_party/gsl/tests/span_tests.cpp +0 -1244
- data/ext/third_party/gsl/tests/strict_notnull_tests.cpp +0 -190
- data/ext/third_party/gsl/tests/strided_span_tests.cpp +0 -790
- data/ext/third_party/gsl/tests/string_span_tests.cpp +0 -1217
- data/ext/third_party/gsl/tests/utils_tests.cpp +0 -129
- data/ext/third_party/http_parser/contrib/parsertrace.c +0 -157
- data/ext/third_party/http_parser/contrib/url_parser.c +0 -47
- data/ext/third_party/http_parser/fuzzers/fuzz_parser.c +0 -26
- data/ext/third_party/http_parser/fuzzers/fuzz_url.c +0 -14
- data/ext/third_party/json/contrib/nlohmann.cpp +0 -48
- data/ext/third_party/json/contrib/nlohmann/from_value.hpp +0 -62
- data/ext/third_party/json/contrib/nlohmann/json.hpp +0 -18928
- data/ext/third_party/json/contrib/nlohmann/to_value.hpp +0 -109
- data/ext/third_party/json/doc/Advanced-Use-Cases.md +0 -83
- data/ext/third_party/json/doc/Batteries-Included.md +0 -212
- data/ext/third_party/json/doc/Binding-Traits.md +0 -319
- data/ext/third_party/json/doc/Changelog.md +0 -31
- data/ext/third_party/json/doc/Common-Use-Cases.md +0 -148
- data/ext/third_party/json/doc/Design-Decisions.md +0 -36
- data/ext/third_party/json/doc/Events-Interface.md +0 -140
- data/ext/third_party/json/doc/Getting-Started.md +0 -19
- data/ext/third_party/json/doc/Instance-Sharing.md +0 -163
- data/ext/third_party/json/doc/Interoperability.md +0 -75
- data/ext/third_party/json/doc/Overview.md +0 -24
- data/ext/third_party/json/doc/Overview.png +0 -0
- data/ext/third_party/json/doc/Parser-Interface.md +0 -84
- data/ext/third_party/json/doc/README.md +0 -78
- data/ext/third_party/json/doc/Scratchpad.md +0 -25
- data/ext/third_party/json/doc/Type-Traits.md +0 -364
- data/ext/third_party/json/doc/Types.png +0 -0
- data/ext/third_party/json/doc/Value-Class.md +0 -525
- data/ext/third_party/json/src/example/json/CMakeLists.txt +0 -67
- data/ext/third_party/json/src/example/json/cbor_to_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/cbor_to_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/cbor_to_msgpack.cpp +0 -18
- data/ext/third_party/json/src/example/json/cbor_to_pretty_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/cbor_to_pretty_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/cbor_to_ubjson.cpp +0 -18
- data/ext/third_party/json/src/example/json/jaxn_to_cbor.cpp +0 -18
- data/ext/third_party/json/src/example/json/jaxn_to_cplusplus.cpp +0 -249
- data/ext/third_party/json/src/example/json/jaxn_to_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/jaxn_to_msgpack.cpp +0 -18
- data/ext/third_party/json/src/example/json/jaxn_to_pretty_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/jaxn_to_ubjson.cpp +0 -18
- data/ext/third_party/json/src/example/json/json_to_cbor.cpp +0 -18
- data/ext/third_party/json/src/example/json/json_to_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/json_to_msgpack.cpp +0 -18
- data/ext/third_party/json/src/example/json/json_to_pretty_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/json_to_ubjson.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_cbor.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_pretty_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_pretty_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_ubjson.cpp +0 -18
- data/ext/third_party/json/src/example/json/printf_doubles.cpp +0 -51
- data/ext/third_party/json/src/example/json/ubjson_to_cbor.cpp +0 -18
- data/ext/third_party/json/src/example/json/ubjson_to_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/ubjson_to_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/ubjson_to_msgpack.cpp +0 -18
- data/ext/third_party/json/src/example/json/ubjson_to_pretty_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/ubjson_to_pretty_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/validate_event_order.cpp +0 -27
- data/ext/third_party/json/src/example/json/validate_integer.cpp +0 -56
- data/ext/third_party/json/src/perf/json/bench_mark.hpp +0 -43
- data/ext/third_party/json/src/perf/json/benchmark.cpp +0 -34
- data/ext/third_party/json/src/perf/json/parse_file.cpp +0 -17
- data/ext/third_party/json/src/perf/json/pretty_print_file.cpp +0 -19
- data/ext/third_party/json/src/perf/json/print_double.cpp +0 -34
- data/ext/third_party/json/src/perf/json/print_file.cpp +0 -19
- data/ext/third_party/json/src/perf/json/sizes.cpp +0 -24
- data/ext/third_party/json/src/perf/json/syntax_only.cpp +0 -27
- data/ext/third_party/json/src/test/json/CMakeLists.txt +0 -97
- data/ext/third_party/json/src/test/json/big_list_of_naughty_strings.cpp +0 -43
- data/ext/third_party/json/src/test/json/binding_array.cpp +0 -549
- data/ext/third_party/json/src/test/json/binding_factory.cpp +0 -265
- data/ext/third_party/json/src/test/json/binding_object.cpp +0 -208
- data/ext/third_party/json/src/test/json/binding_versions.cpp +0 -95
- data/ext/third_party/json/src/test/json/cbor.cpp +0 -149
- data/ext/third_party/json/src/test/json/cbor_parts_parser.cpp +0 -36
- data/ext/third_party/json/src/test/json/contrib_diff.cpp +0 -43
- data/ext/third_party/json/src/test/json/contrib_get.cpp +0 -42
- data/ext/third_party/json/src/test/json/contrib_patch_add.cpp +0 -75
- data/ext/third_party/json/src/test/json/contrib_patch_copy.cpp +0 -113
- data/ext/third_party/json/src/test/json/contrib_patch_move.cpp +0 -97
- data/ext/third_party/json/src/test/json/contrib_patch_remove.cpp +0 -85
- data/ext/third_party/json/src/test/json/contrib_patch_replace.cpp +0 -79
- data/ext/third_party/json/src/test/json/contrib_patch_test.cpp +0 -69
- data/ext/third_party/json/src/test/json/contrib_position.cpp +0 -48
- data/ext/third_party/json/src/test/json/contrib_reference.cpp +0 -44
- data/ext/third_party/json/src/test/json/contrib_schema.cpp +0 -132
- data/ext/third_party/json/src/test/json/contrib_traits.cpp +0 -258
- data/ext/third_party/json/src/test/json/double.cpp +0 -182
- data/ext/third_party/json/src/test/json/enable_implicit_constructor.cpp +0 -54
- data/ext/third_party/json/src/test/json/escape.cpp +0 -42
- data/ext/third_party/json/src/test/json/events_binary_to.cpp +0 -56
- data/ext/third_party/json/src/test/json/events_compare.cpp +0 -433
- data/ext/third_party/json/src/test/json/events_debug.cpp +0 -24
- data/ext/third_party/json/src/test/json/events_hash.cpp +0 -65
- data/ext/third_party/json/src/test/json/events_to_stream.cpp +0 -28
- data/ext/third_party/json/src/test/json/events_to_string.cpp +0 -25
- data/ext/third_party/json/src/test/json/include_json.cpp +0 -14
- data/ext/third_party/json/src/test/json/integer.cpp +0 -118
- data/ext/third_party/json/src/test/json/jaxn_ostream.cpp +0 -76
- data/ext/third_party/json/src/test/json/jaxn_parse.cpp +0 -239
- data/ext/third_party/json/src/test/json/jaxn_parts_parser.cpp +0 -220
- data/ext/third_party/json/src/test/json/json_ostream.cpp +0 -102
- data/ext/third_party/json/src/test/json/json_parse.cpp +0 -153
- data/ext/third_party/json/src/test/json/json_parts_parser.cpp +0 -124
- data/ext/third_party/json/src/test/json/json_pointer.cpp +0 -176
- data/ext/third_party/json/src/test/json/key_camel_case_to_snake_case.cpp +0 -38
- data/ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp +0 -33
- data/ext/third_party/json/src/test/json/literal.cpp +0 -18
- data/ext/third_party/json/src/test/json/main.hpp +0 -20
- data/ext/third_party/json/src/test/json/make_events.hpp +0 -362
- data/ext/third_party/json/src/test/json/msgpack.cpp +0 -136
- data/ext/third_party/json/src/test/json/object_construction.cpp +0 -167
- data/ext/third_party/json/src/test/json/opaque_pointer.cpp +0 -192
- data/ext/third_party/json/src/test/json/operators.cpp +0 -494
- data/ext/third_party/json/src/test/json/optional.cpp +0 -79
- data/ext/third_party/json/src/test/json/public_base.cpp +0 -142
- data/ext/third_party/json/src/test/json/self_contained.cpp +0 -106
- data/ext/third_party/json/src/test/json/sha256.cpp +0 -38
- data/ext/third_party/json/src/test/json/string_view.cpp +0 -70
- data/ext/third_party/json/src/test/json/temporary_parsing.cpp +0 -339
- data/ext/third_party/json/src/test/json/test.hpp +0 -74
- data/ext/third_party/json/src/test/json/test_events.hpp +0 -250
- data/ext/third_party/json/src/test/json/test_types.hpp +0 -557
- data/ext/third_party/json/src/test/json/test_unhex.hpp +0 -42
- data/ext/third_party/json/src/test/json/type.cpp +0 -35
- data/ext/third_party/json/src/test/json/ubjson.cpp +0 -119
- data/ext/third_party/json/src/test/json/uri_fragment.cpp +0 -52
- data/ext/third_party/json/src/test/json/validate_event_interfaces.cpp +0 -177
- data/ext/third_party/json/src/test/json/validate_utf8.cpp +0 -37
- data/ext/third_party/json/src/test/json/value_access.cpp +0 -144
- data/ext/third_party/json/src/test/json/value_basics.cpp +0 -241
- data/ext/third_party/json/src/test/json/value_create.cpp +0 -372
- data/ext/third_party/json/src/test/json/value_ptr.cpp +0 -33
- data/ext/third_party/json/src/test/json/value_subscript.cpp +0 -89
- data/ext/third_party/json/src/test/json/with_arguments.cpp +0 -98
- data/ext/third_party/json/tests/blns.json +0 -496
- data/ext/third_party/json/tests/canada.json +0 -9
- data/ext/third_party/json/tests/citm_catalog.json +0 -50469
- data/ext/third_party/json/tests/draft4/additionalItems.json +0 -82
- data/ext/third_party/json/tests/draft4/additionalProperties.json +0 -88
- data/ext/third_party/json/tests/draft4/allOf.json +0 -112
- data/ext/third_party/json/tests/draft4/anyOf.json +0 -68
- data/ext/third_party/json/tests/draft4/default.json +0 -49
- data/ext/third_party/json/tests/draft4/definitions.json +0 -32
- data/ext/third_party/json/tests/draft4/dependencies.json +0 -113
- data/ext/third_party/json/tests/draft4/enum.json +0 -72
- data/ext/third_party/json/tests/draft4/items.json +0 -46
- data/ext/third_party/json/tests/draft4/maxItems.json +0 -28
- data/ext/third_party/json/tests/draft4/maxLength.json +0 -33
- data/ext/third_party/json/tests/draft4/maxProperties.json +0 -28
- data/ext/third_party/json/tests/draft4/maximum.json +0 -42
- data/ext/third_party/json/tests/draft4/minItems.json +0 -28
- data/ext/third_party/json/tests/draft4/minLength.json +0 -33
- data/ext/third_party/json/tests/draft4/minProperties.json +0 -28
- data/ext/third_party/json/tests/draft4/minimum.json +0 -42
- data/ext/third_party/json/tests/draft4/multipleOf.json +0 -60
- data/ext/third_party/json/tests/draft4/not.json +0 -96
- data/ext/third_party/json/tests/draft4/oneOf.json +0 -68
- data/ext/third_party/json/tests/draft4/optional/bignum.json +0 -107
- data/ext/third_party/json/tests/draft4/optional/format.json +0 -148
- data/ext/third_party/json/tests/draft4/optional/zeroTerminatedFloats.json +0 -15
- data/ext/third_party/json/tests/draft4/pattern.json +0 -34
- data/ext/third_party/json/tests/draft4/patternProperties.json +0 -110
- data/ext/third_party/json/tests/draft4/properties.json +0 -92
- data/ext/third_party/json/tests/draft4/ref.json +0 -179
- data/ext/third_party/json/tests/draft4/refRemote.json +0 -74
- data/ext/third_party/json/tests/draft4/required.json +0 -44
- data/ext/third_party/json/tests/draft4/type.json +0 -345
- data/ext/third_party/json/tests/draft4/uniqueItems.json +0 -79
- data/ext/third_party/json/tests/taocpp/binary.jaxn +0 -4
- data/ext/third_party/json/tests/taocpp/dateTime.json +0 -108
- data/ext/third_party/json/tests/taocpp/make_events.cbor +0 -0
- data/ext/third_party/json/tests/taocpp/number.json +0 -682
- data/ext/third_party/json/tests/taocpp/position.json +0 -8
- data/ext/third_party/json/tests/taocpp/schema.json +0 -378
- data/ext/third_party/json/tests/twitter.json +0 -15482
- data/ext/third_party/snappy/testdata/alice29.txt +0 -3609
- data/ext/third_party/snappy/testdata/asyoulik.txt +0 -4122
- data/ext/third_party/snappy/testdata/baddata1.snappy +0 -0
- data/ext/third_party/snappy/testdata/baddata2.snappy +0 -0
- data/ext/third_party/snappy/testdata/baddata3.snappy +0 -0
- data/ext/third_party/snappy/testdata/fireworks.jpeg +0 -0
- data/ext/third_party/snappy/testdata/geo.protodata +0 -0
- data/ext/third_party/snappy/testdata/html +0 -1
- data/ext/third_party/snappy/testdata/html_x_4 +0 -1
- data/ext/third_party/snappy/testdata/kppkn.gtb +0 -0
- data/ext/third_party/snappy/testdata/lcet10.txt +0 -7519
- data/ext/third_party/snappy/testdata/paper-100k.pdf +2 -600
- data/ext/third_party/snappy/testdata/plrabn12.txt +0 -10699
- data/ext/third_party/snappy/testdata/urls.10K +0 -10000
- data/ext/third_party/spdlog/bench/CMakeLists.txt +0 -25
- data/ext/third_party/spdlog/bench/async_bench.cpp +0 -179
- data/ext/third_party/spdlog/bench/bench.cpp +0 -238
- data/ext/third_party/spdlog/bench/formatter-bench.cpp +0 -80
- data/ext/third_party/spdlog/bench/latency.cpp +0 -166
- data/ext/third_party/spdlog/bench/utils.h +0 -34
- data/ext/third_party/spdlog/example/CMakeLists.txt +0 -23
- data/ext/third_party/spdlog/example/example.cpp +0 -282
- data/ext/third_party/spdlog/logos/jetbrains-variant-4.svg +0 -43
- data/ext/third_party/spdlog/scripts/extract_version.py +0 -17
- data/ext/third_party/spdlog/scripts/format.sh +0 -16
- data/ext/third_party/spdlog/tests/CMakeLists.txt +0 -70
- data/ext/third_party/spdlog/tests/catch.hpp +0 -15372
- data/ext/third_party/spdlog/tests/catch.license +0 -23
- data/ext/third_party/spdlog/tests/includes.h +0 -26
- data/ext/third_party/spdlog/tests/main.cpp +0 -2
- data/ext/third_party/spdlog/tests/test_async.cpp +0 -188
- data/ext/third_party/spdlog/tests/test_backtrace.cpp +0 -65
- data/ext/third_party/spdlog/tests/test_cfg.cpp +0 -93
- data/ext/third_party/spdlog/tests/test_create_dir.cpp +0 -80
- data/ext/third_party/spdlog/tests/test_daily_logger.cpp +0 -149
- data/ext/third_party/spdlog/tests/test_dup_filter.cpp +0 -88
- data/ext/third_party/spdlog/tests/test_errors.cpp +0 -118
- data/ext/third_party/spdlog/tests/test_eventlog.cpp +0 -71
- data/ext/third_party/spdlog/tests/test_file_helper.cpp +0 -102
- data/ext/third_party/spdlog/tests/test_file_logging.cpp +0 -98
- data/ext/third_party/spdlog/tests/test_fmt_helper.cpp +0 -86
- data/ext/third_party/spdlog/tests/test_macros.cpp +0 -60
- data/ext/third_party/spdlog/tests/test_misc.cpp +0 -271
- data/ext/third_party/spdlog/tests/test_mpmc_q.cpp +0 -106
- data/ext/third_party/spdlog/tests/test_pattern_formatter.cpp +0 -443
- data/ext/third_party/spdlog/tests/test_registry.cpp +0 -116
- data/ext/third_party/spdlog/tests/test_sink.h +0 -79
- data/ext/third_party/spdlog/tests/test_stdout_api.cpp +0 -98
- data/ext/third_party/spdlog/tests/test_systemd.cpp +0 -15
- data/ext/third_party/spdlog/tests/test_time_point.cpp +0 -36
- data/ext/third_party/spdlog/tests/utils.cpp +0 -125
- data/ext/third_party/spdlog/tests/utils.h +0 -18
- data/rbi/couchbase.rbi +0 -79
@@ -0,0 +1,237 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2020 Couchbase, Inc.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#pragma once
|
19
|
+
|
20
|
+
#include <io/mcbp_session.hxx>
|
21
|
+
#include <io/retry_orchestrator.hxx>
|
22
|
+
|
23
|
+
#include <protocol/cmd_get_collection_id.hxx>
|
24
|
+
#include <functional>
|
25
|
+
#include <utility>
|
26
|
+
|
27
|
+
namespace couchbase::operations
|
28
|
+
{
|
29
|
+
|
30
|
+
using mcbp_command_handler = std::function<void(std::error_code, std::optional<io::mcbp_message>)>;
|
31
|
+
|
32
|
+
template<typename Manager, typename Request>
|
33
|
+
struct mcbp_command : public std::enable_shared_from_this<mcbp_command<Manager, Request>> {
|
34
|
+
using encoded_request_type = typename Request::encoded_request_type;
|
35
|
+
using encoded_response_type = typename Request::encoded_response_type;
|
36
|
+
asio::steady_timer deadline;
|
37
|
+
asio::steady_timer retry_backoff;
|
38
|
+
Request request;
|
39
|
+
encoded_request_type encoded;
|
40
|
+
std::optional<std::uint32_t> opaque_{};
|
41
|
+
std::shared_ptr<io::mcbp_session> session_{};
|
42
|
+
mcbp_command_handler handler_{};
|
43
|
+
std::shared_ptr<Manager> manager_{};
|
44
|
+
|
45
|
+
mcbp_command(asio::io_context& ctx, std::shared_ptr<Manager> manager, Request req)
|
46
|
+
: deadline(ctx)
|
47
|
+
, retry_backoff(ctx)
|
48
|
+
, request(req)
|
49
|
+
, manager_(manager)
|
50
|
+
{
|
51
|
+
}
|
52
|
+
|
53
|
+
void start(mcbp_command_handler&& handler)
|
54
|
+
{
|
55
|
+
handler_ = handler;
|
56
|
+
deadline.expires_after(request.timeout);
|
57
|
+
deadline.async_wait([self = this->shared_from_this()](std::error_code ec) {
|
58
|
+
if (ec == asio::error::operation_aborted) {
|
59
|
+
return;
|
60
|
+
}
|
61
|
+
self->cancel(io::retry_reason::do_not_retry);
|
62
|
+
});
|
63
|
+
}
|
64
|
+
|
65
|
+
void cancel(io::retry_reason reason)
|
66
|
+
{
|
67
|
+
if (opaque_ && session_) {
|
68
|
+
if (session_->cancel(opaque_.value(), asio::error::operation_aborted, reason)) {
|
69
|
+
handler_ = nullptr;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
invoke_handler(std::make_error_code(request.retries.idempotent ? error::common_errc::unambiguous_timeout
|
73
|
+
: error::common_errc::ambiguous_timeout));
|
74
|
+
retry_backoff.cancel();
|
75
|
+
deadline.cancel();
|
76
|
+
}
|
77
|
+
|
78
|
+
void invoke_handler(std::error_code ec, std::optional<io::mcbp_message> msg = {})
|
79
|
+
{
|
80
|
+
if (handler_) {
|
81
|
+
handler_(ec, std::move(msg));
|
82
|
+
}
|
83
|
+
handler_ = nullptr;
|
84
|
+
}
|
85
|
+
|
86
|
+
void request_collection_id()
|
87
|
+
{
|
88
|
+
protocol::client_request<protocol::get_collection_id_request_body> req;
|
89
|
+
req.opaque(session_->next_opaque());
|
90
|
+
req.body().collection_path(request.id.collection);
|
91
|
+
session_->write_and_subscribe(
|
92
|
+
req.opaque(),
|
93
|
+
req.data(session_->supports_feature(protocol::hello_feature::snappy)),
|
94
|
+
[self = this->shared_from_this()](std::error_code ec, io::retry_reason /* reason */, io::mcbp_message&& msg) mutable {
|
95
|
+
if (ec == asio::error::operation_aborted) {
|
96
|
+
return self->invoke_handler(std::make_error_code(error::common_errc::ambiguous_timeout));
|
97
|
+
}
|
98
|
+
if (ec == std::make_error_code(error::common_errc::collection_not_found)) {
|
99
|
+
if (self->request.id.collection_uid) {
|
100
|
+
return self->handle_unknown_collection();
|
101
|
+
}
|
102
|
+
return self->invoke_handler(ec);
|
103
|
+
}
|
104
|
+
if (ec) {
|
105
|
+
return self->invoke_handler(ec);
|
106
|
+
}
|
107
|
+
protocol::client_response<protocol::get_collection_id_response_body> resp(msg);
|
108
|
+
self->session_->update_collection_uid(self->request.id.collection, resp.body().collection_uid());
|
109
|
+
self->request.id.collection_uid = resp.body().collection_uid();
|
110
|
+
return self->send();
|
111
|
+
});
|
112
|
+
}
|
113
|
+
|
114
|
+
void handle_unknown_collection()
|
115
|
+
{
|
116
|
+
auto backoff = std::chrono::milliseconds(500);
|
117
|
+
auto time_left = deadline.expiry() - std::chrono::steady_clock::now();
|
118
|
+
spdlog::debug("{} unknown collection response for \"{}/{}/{}\", time_left={}ms",
|
119
|
+
session_->log_prefix(),
|
120
|
+
request.id.bucket,
|
121
|
+
request.id.collection,
|
122
|
+
request.id.key,
|
123
|
+
std::chrono::duration_cast<std::chrono::milliseconds>(time_left).count());
|
124
|
+
if (time_left < backoff) {
|
125
|
+
return invoke_handler(std::make_error_code(request.retries.idempotent ? error::common_errc::unambiguous_timeout
|
126
|
+
: error::common_errc::ambiguous_timeout));
|
127
|
+
}
|
128
|
+
retry_backoff.expires_after(backoff);
|
129
|
+
retry_backoff.async_wait([self = this->shared_from_this()](std::error_code ec) mutable {
|
130
|
+
if (ec == asio::error::operation_aborted) {
|
131
|
+
return;
|
132
|
+
}
|
133
|
+
self->request_collection_id();
|
134
|
+
});
|
135
|
+
}
|
136
|
+
|
137
|
+
void send()
|
138
|
+
{
|
139
|
+
opaque_ = session_->next_opaque();
|
140
|
+
request.opaque = *opaque_;
|
141
|
+
if (!request.id.collection_uid) {
|
142
|
+
if (session_->supports_feature(protocol::hello_feature::collections)) {
|
143
|
+
auto collection_id = session_->get_collection_uid(request.id.collection);
|
144
|
+
if (collection_id) {
|
145
|
+
request.id.collection_uid = *collection_id;
|
146
|
+
} else {
|
147
|
+
spdlog::debug("{} no cache entry for collection, resolve collection id for \"{}/{}/{}\", timeout={}ms",
|
148
|
+
session_->log_prefix(),
|
149
|
+
request.id.bucket,
|
150
|
+
request.id.collection,
|
151
|
+
request.id.key,
|
152
|
+
request.timeout.count());
|
153
|
+
return request_collection_id();
|
154
|
+
}
|
155
|
+
} else {
|
156
|
+
if (!request.id.collection.empty() && request.id.collection != "_default._default") {
|
157
|
+
return invoke_handler(std::make_error_code(error::common_errc::unsupported_operation));
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
161
|
+
request.encode_to(encoded);
|
162
|
+
|
163
|
+
session_->write_and_subscribe(
|
164
|
+
request.opaque,
|
165
|
+
encoded.data(session_->supports_feature(protocol::hello_feature::snappy)),
|
166
|
+
[self = this->shared_from_this()](std::error_code ec, io::retry_reason reason, io::mcbp_message&& msg) mutable {
|
167
|
+
self->retry_backoff.cancel();
|
168
|
+
if (ec == asio::error::operation_aborted) {
|
169
|
+
return self->invoke_handler(std::make_error_code(
|
170
|
+
self->request.retries.idempotent ? error::common_errc::unambiguous_timeout : error::common_errc::ambiguous_timeout));
|
171
|
+
}
|
172
|
+
if (ec == std::make_error_code(error::common_errc::request_canceled)) {
|
173
|
+
if (reason == io::retry_reason::do_not_retry) {
|
174
|
+
return self->invoke_handler(ec);
|
175
|
+
}
|
176
|
+
return io::retry_orchestrator::maybe_retry(self->manager_, self, reason, ec);
|
177
|
+
}
|
178
|
+
protocol::status status = protocol::status::invalid;
|
179
|
+
std::optional<error_map::error_info> error_code{};
|
180
|
+
if (protocol::is_valid_status(msg.header.status())) {
|
181
|
+
status = static_cast<protocol::status>(msg.header.status());
|
182
|
+
} else {
|
183
|
+
error_code = self->session_->decode_error_code(msg.header.status());
|
184
|
+
}
|
185
|
+
if (status == protocol::status::not_my_vbucket) {
|
186
|
+
self->session_->handle_not_my_vbucket(std::move(msg));
|
187
|
+
return io::retry_orchestrator::maybe_retry(self->manager_, self, io::retry_reason::kv_not_my_vbucket, ec);
|
188
|
+
}
|
189
|
+
if (status == protocol::status::unknown_collection) {
|
190
|
+
return self->handle_unknown_collection();
|
191
|
+
}
|
192
|
+
if (error_code && error_code.value().has_retry_attribute()) {
|
193
|
+
reason = io::retry_reason::kv_error_map_retry_indicated;
|
194
|
+
} else {
|
195
|
+
switch (status) {
|
196
|
+
case protocol::status::locked:
|
197
|
+
if (encoded_request_type::body_type::opcode != protocol::client_opcode::unlock) {
|
198
|
+
/**
|
199
|
+
* special case for unlock command, when it should not be retried, because it does not make sense
|
200
|
+
* (someone else unlocked the document)
|
201
|
+
*/
|
202
|
+
reason = io::retry_reason::kv_locked;
|
203
|
+
}
|
204
|
+
break;
|
205
|
+
case protocol::status::temporary_failure:
|
206
|
+
reason = io::retry_reason::kv_temporary_failure;
|
207
|
+
break;
|
208
|
+
case protocol::status::sync_write_in_progress:
|
209
|
+
reason = io::retry_reason::kv_sync_write_in_progress;
|
210
|
+
break;
|
211
|
+
case protocol::status::sync_write_re_commit_in_progress:
|
212
|
+
reason = io::retry_reason::kv_sync_write_re_commit_in_progress;
|
213
|
+
break;
|
214
|
+
default:
|
215
|
+
break;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
if (reason == io::retry_reason::do_not_retry) {
|
219
|
+
self->deadline.cancel();
|
220
|
+
self->invoke_handler(ec, msg);
|
221
|
+
} else {
|
222
|
+
io::retry_orchestrator::maybe_retry(self->manager_, self, reason, ec);
|
223
|
+
}
|
224
|
+
});
|
225
|
+
}
|
226
|
+
|
227
|
+
void send_to(std::shared_ptr<io::mcbp_session> session)
|
228
|
+
{
|
229
|
+
if (!handler_) {
|
230
|
+
return;
|
231
|
+
}
|
232
|
+
session_ = std::move(session);
|
233
|
+
send();
|
234
|
+
}
|
235
|
+
};
|
236
|
+
|
237
|
+
} // namespace couchbase::operations
|
@@ -19,8 +19,17 @@
|
|
19
19
|
|
20
20
|
#include <cstdint>
|
21
21
|
#include <vector>
|
22
|
+
#include <array>
|
22
23
|
|
23
|
-
namespace couchbase
|
24
|
+
namespace couchbase
|
25
|
+
{
|
26
|
+
namespace protocol
|
27
|
+
{
|
28
|
+
static const size_t header_size = 24;
|
29
|
+
using header_buffer = std::array<std::uint8_t, header_size>;
|
30
|
+
} // namespace protocol
|
31
|
+
|
32
|
+
namespace io
|
24
33
|
{
|
25
34
|
struct binary_header {
|
26
35
|
std::uint8_t magic;
|
@@ -32,10 +41,23 @@ struct binary_header {
|
|
32
41
|
std::uint32_t bodylen;
|
33
42
|
std::uint32_t opaque;
|
34
43
|
std::uint64_t cas;
|
44
|
+
|
45
|
+
std::uint16_t status()
|
46
|
+
{
|
47
|
+
return htons(specific);
|
48
|
+
}
|
35
49
|
};
|
36
50
|
|
37
51
|
struct mcbp_message {
|
38
52
|
binary_header header;
|
39
53
|
std::vector<std::uint8_t> body;
|
54
|
+
|
55
|
+
protocol::header_buffer header_data()
|
56
|
+
{
|
57
|
+
protocol::header_buffer buf;
|
58
|
+
std::memcpy(buf.data(), &header, sizeof(header));
|
59
|
+
return buf;
|
60
|
+
}
|
40
61
|
};
|
41
|
-
} // namespace
|
62
|
+
} // namespace io
|
63
|
+
} // namespace couchbase
|
@@ -73,6 +73,8 @@ struct mcbp_parser {
|
|
73
73
|
if (success) {
|
74
74
|
std::copy(uncompressed.begin(), uncompressed.end(), std::back_inserter(msg.body));
|
75
75
|
use_raw_value = false;
|
76
|
+
// patch header with new body size
|
77
|
+
msg.header.bodylen = htonl(static_cast<std::uint32_t>(prefix_size + uncompressed.size()));
|
76
78
|
}
|
77
79
|
}
|
78
80
|
if (use_raw_value) {
|
@@ -27,6 +27,10 @@
|
|
27
27
|
|
28
28
|
#include <io/mcbp_message.hxx>
|
29
29
|
#include <io/mcbp_parser.hxx>
|
30
|
+
#include <io/streams.hxx>
|
31
|
+
#include <io/retry_orchestrator.hxx>
|
32
|
+
|
33
|
+
#include <timeout_defaults.hxx>
|
30
34
|
|
31
35
|
#include <protocol/hello_feature.hxx>
|
32
36
|
#include <protocol/client_request.hxx>
|
@@ -39,7 +43,6 @@
|
|
39
43
|
#include <protocol/cmd_select_bucket.hxx>
|
40
44
|
#include <protocol/cmd_get_cluster_config.hxx>
|
41
45
|
#include <protocol/cmd_get_error_map.hxx>
|
42
|
-
#include <protocol/cmd_get_collections_manifest.hxx>
|
43
46
|
#include <protocol/cmd_get.hxx>
|
44
47
|
#include <protocol/cmd_cluster_map_change_notification.hxx>
|
45
48
|
|
@@ -47,6 +50,7 @@
|
|
47
50
|
|
48
51
|
#include <spdlog/fmt/bin_to_hex.h>
|
49
52
|
|
53
|
+
#include <origin.hxx>
|
50
54
|
#include <errors.hxx>
|
51
55
|
#include <version.hxx>
|
52
56
|
|
@@ -55,6 +59,35 @@ namespace couchbase::io
|
|
55
59
|
|
56
60
|
class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
57
61
|
{
|
62
|
+
class collection_cache
|
63
|
+
{
|
64
|
+
private:
|
65
|
+
std::map<std::string, std::uint32_t> cid_map_{ { "_default._default", 0 } };
|
66
|
+
|
67
|
+
public:
|
68
|
+
[[nodiscard]] std::optional<std::uint32_t> get(const std::string& path)
|
69
|
+
{
|
70
|
+
Expects(!path.empty());
|
71
|
+
auto ptr = cid_map_.find(path);
|
72
|
+
if (ptr != cid_map_.end()) {
|
73
|
+
return ptr->second;
|
74
|
+
}
|
75
|
+
return {};
|
76
|
+
}
|
77
|
+
|
78
|
+
void update(const std::string& path, std::uint32_t id)
|
79
|
+
{
|
80
|
+
Expects(!path.empty());
|
81
|
+
cid_map_[path] = id;
|
82
|
+
}
|
83
|
+
|
84
|
+
void reset()
|
85
|
+
{
|
86
|
+
cid_map_.clear();
|
87
|
+
cid_map_["_default._default"] = 0;
|
88
|
+
}
|
89
|
+
};
|
90
|
+
|
58
91
|
class message_handler
|
59
92
|
{
|
60
93
|
public:
|
@@ -88,41 +121,47 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
88
121
|
|
89
122
|
explicit bootstrap_handler(std::shared_ptr<mcbp_session> session)
|
90
123
|
: session_(session)
|
91
|
-
, sasl_([
|
92
|
-
[
|
124
|
+
, sasl_([origin = session_->origin_]() -> std::string { return origin.username(); },
|
125
|
+
[origin = session_->origin_]() -> std::string { return origin.password(); },
|
93
126
|
{ "SCRAM-SHA512", "SCRAM-SHA256", "SCRAM-SHA1", "PLAIN" })
|
94
127
|
{
|
95
128
|
tao::json::value user_agent{
|
96
|
-
{ "a",
|
97
|
-
|
129
|
+
{ "a",
|
130
|
+
fmt::format(
|
131
|
+
"ruby/{}.{}.{}/{}", BACKEND_VERSION_MAJOR, BACKEND_VERSION_MINOR, BACKEND_VERSION_PATCH, BACKEND_GIT_REVISION) },
|
132
|
+
{ "i", fmt::format("{}/{}", session_->client_id_, session_->id_) }
|
98
133
|
};
|
99
134
|
protocol::client_request<protocol::hello_request_body> hello_req;
|
100
135
|
hello_req.opaque(session_->next_opaque());
|
101
136
|
hello_req.body().user_agent(tao::json::to_string(user_agent));
|
137
|
+
spdlog::debug("{} user_agent={}, requested_features=[{}]",
|
138
|
+
session_->log_prefix_,
|
139
|
+
hello_req.body().user_agent(),
|
140
|
+
fmt::join(hello_req.body().features(), ", "));
|
102
141
|
session_->write(hello_req.data());
|
103
142
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
143
|
+
if (!session->origin_.credentials().uses_certificate()) {
|
144
|
+
protocol::client_request<protocol::sasl_list_mechs_request_body> list_req;
|
145
|
+
list_req.opaque(session_->next_opaque());
|
146
|
+
session_->write(list_req.data());
|
147
|
+
|
148
|
+
protocol::client_request<protocol::sasl_auth_request_body> auth_req;
|
149
|
+
sasl::error sasl_code;
|
150
|
+
std::string_view sasl_payload;
|
151
|
+
std::tie(sasl_code, sasl_payload) = sasl_.start();
|
152
|
+
auth_req.opaque(session_->next_opaque());
|
153
|
+
auth_req.body().mechanism(sasl_.get_name());
|
154
|
+
auth_req.body().sasl_data(sasl_payload);
|
155
|
+
session_->write(auth_req.data());
|
156
|
+
}
|
116
157
|
|
117
158
|
session_->flush();
|
118
159
|
}
|
119
160
|
|
120
161
|
void complete(std::error_code ec)
|
121
162
|
{
|
163
|
+
stopped_ = true;
|
122
164
|
session_->invoke_bootstrap_handler(ec);
|
123
|
-
if (!ec) {
|
124
|
-
session_->handler_ = std::make_unique<normal_handler>(session_);
|
125
|
-
}
|
126
165
|
}
|
127
166
|
|
128
167
|
void auth_success()
|
@@ -138,10 +177,6 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
138
177
|
sb_req.opaque(session_->next_opaque());
|
139
178
|
sb_req.body().bucket_name(session_->bucket_name_.value());
|
140
179
|
session_->write(sb_req.data());
|
141
|
-
|
142
|
-
protocol::client_request<protocol::get_collections_manifest_request_body> gcm_req;
|
143
|
-
gcm_req.opaque(session_->next_opaque());
|
144
|
-
session_->write(gcm_req.data());
|
145
180
|
}
|
146
181
|
protocol::client_request<protocol::get_cluster_config_request_body> cfg_req;
|
147
182
|
cfg_req.opaque(session_->next_opaque());
|
@@ -161,15 +196,20 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
161
196
|
protocol::client_response<protocol::hello_response_body> resp(msg);
|
162
197
|
if (resp.status() == protocol::status::success) {
|
163
198
|
session_->supported_features_ = resp.body().supported_features();
|
199
|
+
spdlog::debug("{} supported_features=[{}]", session_->log_prefix_, fmt::join(session_->supported_features_, ", "));
|
200
|
+
if (session_->origin_.credentials().uses_certificate()) {
|
201
|
+
spdlog::debug("{} skip SASL authentication, because TLS certificate was specified", session_->log_prefix_);
|
202
|
+
return auth_success();
|
203
|
+
}
|
164
204
|
} else {
|
165
|
-
spdlog::warn("unexpected message status during bootstrap: {}", resp.error_message());
|
205
|
+
spdlog::warn("{} unexpected message status during bootstrap: {}", session_->log_prefix_, resp.error_message());
|
166
206
|
return complete(std::make_error_code(error::network_errc::handshake_failure));
|
167
207
|
}
|
168
208
|
} break;
|
169
209
|
case protocol::client_opcode::sasl_list_mechs: {
|
170
210
|
protocol::client_response<protocol::sasl_list_mechs_response_body> resp(msg);
|
171
211
|
if (resp.status() != protocol::status::success) {
|
172
|
-
spdlog::warn("unexpected message status during bootstrap: {}", resp.error_message());
|
212
|
+
spdlog::warn("{} unexpected message status during bootstrap: {}", session_->log_prefix_, resp.error_message());
|
173
213
|
return complete(std::make_error_code(error::common_errc::authentication_failure));
|
174
214
|
}
|
175
215
|
} break;
|
@@ -192,11 +232,14 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
192
232
|
req.body().sasl_data(sasl_payload);
|
193
233
|
session_->write_and_flush(req.data());
|
194
234
|
} else {
|
195
|
-
spdlog::error("unable to authenticate: sasl_code={}", sasl_code);
|
235
|
+
spdlog::error("{} unable to authenticate: sasl_code={}", session_->log_prefix_, sasl_code);
|
196
236
|
return complete(std::make_error_code(error::common_errc::authentication_failure));
|
197
237
|
}
|
198
238
|
} else {
|
199
|
-
spdlog::warn("unexpected message status during bootstrap: {} (opcode={})",
|
239
|
+
spdlog::warn("{} unexpected message status during bootstrap: {} (opcode={})",
|
240
|
+
session_->log_prefix_,
|
241
|
+
resp.error_message(),
|
242
|
+
opcode);
|
200
243
|
return complete(std::make_error_code(error::common_errc::authentication_failure));
|
201
244
|
}
|
202
245
|
} break;
|
@@ -210,39 +253,28 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
210
253
|
case protocol::client_opcode::get_error_map: {
|
211
254
|
protocol::client_response<protocol::get_error_map_response_body> resp(msg);
|
212
255
|
if (resp.status() == protocol::status::success) {
|
213
|
-
session_->
|
256
|
+
session_->error_map_.emplace(resp.body().errmap());
|
214
257
|
} else {
|
215
|
-
spdlog::warn("unexpected message status during bootstrap: {} (opcode={})",
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
case protocol::client_opcode::get_collections_manifest: {
|
220
|
-
protocol::client_response<protocol::get_collections_manifest_response_body> resp(msg);
|
221
|
-
if (resp.status() == protocol::status::success) {
|
222
|
-
session_->manifest_.emplace(resp.body().manifest());
|
223
|
-
spdlog::trace(
|
224
|
-
"collections manifest for bucket \"{}\": {}", session_->bucket_name_.value_or(""), *session_->manifest_);
|
225
|
-
} else if (resp.status() == protocol::status::no_collections_manifest) {
|
226
|
-
spdlog::trace("collection manifest is not available for bucket \"{}\": {}",
|
227
|
-
session_->bucket_name_.value_or(""),
|
228
|
-
resp.error_message());
|
229
|
-
} else {
|
230
|
-
spdlog::warn("unexpected message status during bootstrap: {} (opcode={})", resp.error_message(), opcode);
|
258
|
+
spdlog::warn("{} unexpected message status during bootstrap: {} (opcode={})",
|
259
|
+
session_->log_prefix_,
|
260
|
+
resp.error_message(),
|
261
|
+
opcode);
|
231
262
|
return complete(std::make_error_code(error::network_errc::protocol_error));
|
232
263
|
}
|
233
264
|
} break;
|
234
265
|
case protocol::client_opcode::select_bucket: {
|
235
266
|
protocol::client_response<protocol::select_bucket_response_body> resp(msg);
|
236
267
|
if (resp.status() == protocol::status::success) {
|
237
|
-
spdlog::
|
268
|
+
spdlog::debug("{} selected bucket: {}", session_->log_prefix_, session_->bucket_name_.value_or(""));
|
238
269
|
session_->bucket_selected_ = true;
|
239
270
|
} else if (resp.status() == protocol::status::no_access) {
|
240
|
-
spdlog::
|
271
|
+
spdlog::debug("{} unable to select bucket: {}, probably the bucket does not exist",
|
272
|
+
session_->log_prefix_,
|
241
273
|
session_->bucket_name_.value_or(""));
|
242
274
|
session_->bucket_selected_ = false;
|
243
275
|
return complete(std::make_error_code(error::common_errc::bucket_not_found));
|
244
276
|
} else {
|
245
|
-
spdlog::warn("unexpected message status during bootstrap: {}", resp.error_message());
|
277
|
+
spdlog::warn("{} unexpected message status during bootstrap: {}", session_->log_prefix_, resp.error_message());
|
246
278
|
return complete(std::make_error_code(error::common_errc::bucket_not_found));
|
247
279
|
}
|
248
280
|
} break;
|
@@ -254,17 +286,21 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
254
286
|
} else if (resp.status() == protocol::status::no_bucket && !session_->bucket_name_) {
|
255
287
|
// bucket-less session, but the server wants bucket
|
256
288
|
session_->supports_gcccp_ = false;
|
257
|
-
spdlog::warn("this server does not support GCCCP, open bucket before making any cluster-level command"
|
289
|
+
spdlog::warn("{} this server does not support GCCCP, open bucket before making any cluster-level command",
|
290
|
+
session_->log_prefix_);
|
258
291
|
session_->update_configuration(
|
259
|
-
make_blank_configuration(session_->
|
292
|
+
make_blank_configuration(session_->endpoint_address_, session_->endpoint_.port(), 0));
|
260
293
|
complete({});
|
261
294
|
} else {
|
262
|
-
spdlog::warn("unexpected message status during bootstrap: {} (opcode={})",
|
295
|
+
spdlog::warn("{} unexpected message status during bootstrap: {} (opcode={})",
|
296
|
+
session_->log_prefix_,
|
297
|
+
resp.error_message(),
|
298
|
+
opcode);
|
263
299
|
return complete(std::make_error_code(error::network_errc::protocol_error));
|
264
300
|
}
|
265
301
|
} break;
|
266
302
|
default:
|
267
|
-
spdlog::warn("unexpected message during bootstrap: {}", opcode);
|
303
|
+
spdlog::warn("{} unexpected message during bootstrap: {}", session_->log_prefix_, opcode);
|
268
304
|
return complete(std::make_error_code(error::network_errc::protocol_error));
|
269
305
|
}
|
270
306
|
}
|
@@ -317,9 +353,10 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
317
353
|
session_->update_configuration(resp.body().config());
|
318
354
|
}
|
319
355
|
} else {
|
320
|
-
spdlog::warn("unexpected message status: {}", resp.error_message());
|
356
|
+
spdlog::warn("{} unexpected message status: {}", session_->log_prefix_, resp.error_message());
|
321
357
|
}
|
322
358
|
} break;
|
359
|
+
case protocol::client_opcode::get_collection_id:
|
323
360
|
case protocol::client_opcode::get:
|
324
361
|
case protocol::client_opcode::get_and_lock:
|
325
362
|
case protocol::client_opcode::get_and_touch:
|
@@ -338,14 +375,24 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
338
375
|
std::uint16_t status = ntohs(msg.header.specific);
|
339
376
|
auto handler = session_->command_handlers_.find(opaque);
|
340
377
|
if (handler != session_->command_handlers_.end()) {
|
341
|
-
|
378
|
+
auto ec = session_->map_status_code(opcode, status);
|
379
|
+
spdlog::trace("{} MCBP invoke operation handler: opaque={}, status={}, ec={}",
|
380
|
+
session_->log_prefix_,
|
381
|
+
opaque,
|
382
|
+
protocol::status_to_string(status),
|
383
|
+
ec.message());
|
384
|
+
auto fun = handler->second;
|
342
385
|
session_->command_handlers_.erase(handler);
|
386
|
+
fun(ec, retry_reason::do_not_retry, std::move(msg));
|
343
387
|
} else {
|
344
|
-
spdlog::debug("unexpected orphan response opcode={}, opaque={}",
|
388
|
+
spdlog::debug("{} unexpected orphan response: opcode={}, opaque={}",
|
389
|
+
session_->log_prefix_,
|
390
|
+
msg.header.opcode,
|
391
|
+
msg.header.opaque);
|
345
392
|
}
|
346
393
|
} break;
|
347
394
|
default:
|
348
|
-
spdlog::warn("unexpected client response: {}", opcode);
|
395
|
+
spdlog::warn("{} unexpected client response: {}", session_->log_prefix_, opcode);
|
349
396
|
}
|
350
397
|
break;
|
351
398
|
case protocol::magic::server_request:
|
@@ -362,23 +409,21 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
362
409
|
}
|
363
410
|
} break;
|
364
411
|
default:
|
365
|
-
spdlog::warn("unexpected server request: {}", opcode);
|
412
|
+
spdlog::warn("{} unexpected server request: {}", session_->log_prefix_, opcode);
|
366
413
|
}
|
367
414
|
break;
|
368
415
|
case protocol::magic::client_request:
|
369
416
|
case protocol::magic::alt_client_request:
|
370
417
|
case protocol::magic::server_response:
|
371
|
-
spdlog::warn(
|
418
|
+
spdlog::warn(
|
419
|
+
"{} unexpected magic: {}, opcode={}, opaque={}", session_->log_prefix_, magic, msg.header.opcode, msg.header.opaque);
|
372
420
|
break;
|
373
421
|
}
|
374
422
|
}
|
375
423
|
|
376
424
|
void fetch_config(std::error_code ec)
|
377
425
|
{
|
378
|
-
if (ec == asio::error::operation_aborted) {
|
379
|
-
return;
|
380
|
-
}
|
381
|
-
if (stopped_ || !session_) {
|
426
|
+
if (ec == asio::error::operation_aborted || stopped_ || !session_) {
|
382
427
|
return;
|
383
428
|
}
|
384
429
|
protocol::client_request<protocol::get_cluster_config_request_body> req;
|
@@ -390,55 +435,149 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
390
435
|
};
|
391
436
|
|
392
437
|
public:
|
393
|
-
mcbp_session(
|
438
|
+
mcbp_session() = delete;
|
439
|
+
mcbp_session(const std::string& client_id,
|
440
|
+
asio::io_context& ctx,
|
441
|
+
const couchbase::origin& origin,
|
442
|
+
std::optional<std::string> bucket_name = {},
|
443
|
+
std::vector<protocol::hello_feature> known_features = {})
|
444
|
+
: client_id_(client_id)
|
445
|
+
, id_(uuid::to_string(uuid::random()))
|
446
|
+
, ctx_(ctx)
|
447
|
+
, resolver_(ctx_)
|
448
|
+
, stream_(std::make_unique<plain_stream_impl>(ctx_))
|
449
|
+
, bootstrap_deadline_(ctx_)
|
450
|
+
, connection_deadline_(ctx_)
|
451
|
+
, retry_backoff_(ctx_)
|
452
|
+
, origin_(origin)
|
453
|
+
, bucket_name_(std::move(bucket_name))
|
454
|
+
, supported_features_(known_features)
|
455
|
+
{
|
456
|
+
log_prefix_ = fmt::format("[{}/{}/{}/{}]", stream_->log_prefix(), client_id_, id_, bucket_name_.value_or("-"));
|
457
|
+
}
|
458
|
+
|
459
|
+
mcbp_session(const std::string& client_id,
|
460
|
+
asio::io_context& ctx,
|
461
|
+
asio::ssl::context& tls,
|
462
|
+
const couchbase::origin& origin,
|
463
|
+
std::optional<std::string> bucket_name = {},
|
464
|
+
std::vector<protocol::hello_feature> known_features = {})
|
394
465
|
: client_id_(client_id)
|
395
|
-
, id_(uuid::random())
|
466
|
+
, id_(uuid::to_string(uuid::random()))
|
396
467
|
, ctx_(ctx)
|
397
468
|
, resolver_(ctx_)
|
398
|
-
,
|
399
|
-
,
|
400
|
-
,
|
469
|
+
, stream_(std::make_unique<tls_stream_impl>(ctx_, tls))
|
470
|
+
, bootstrap_deadline_(ctx_)
|
471
|
+
, connection_deadline_(ctx_)
|
472
|
+
, retry_backoff_(ctx_)
|
473
|
+
, origin_(origin)
|
401
474
|
, bucket_name_(std::move(bucket_name))
|
475
|
+
, supported_features_(known_features)
|
402
476
|
{
|
477
|
+
log_prefix_ = fmt::format("[{}/{}/{}/{}]", stream_->log_prefix(), client_id_, id_, bucket_name_.value_or("-"));
|
403
478
|
}
|
404
479
|
|
405
480
|
~mcbp_session()
|
406
481
|
{
|
407
|
-
stop();
|
482
|
+
stop(retry_reason::do_not_retry);
|
408
483
|
}
|
409
484
|
|
410
|
-
|
411
|
-
const std::string& service,
|
412
|
-
const std::string& username,
|
413
|
-
const std::string& password,
|
414
|
-
std::function<void(std::error_code, configuration)>&& handler)
|
485
|
+
[[nodiscard]] const std::string& log_prefix() const
|
415
486
|
{
|
416
|
-
|
417
|
-
|
487
|
+
return log_prefix_;
|
488
|
+
}
|
489
|
+
|
490
|
+
void bootstrap(std::function<void(std::error_code, configuration)>&& handler, bool retry_on_bucket_not_found = false)
|
491
|
+
{
|
492
|
+
retry_bootstrap_on_bucket_not_found_ = retry_on_bucket_not_found;
|
418
493
|
bootstrap_handler_ = std::move(handler);
|
419
|
-
|
420
|
-
|
494
|
+
bootstrap_deadline_.expires_after(timeout_defaults::bootstrap_timeout);
|
495
|
+
bootstrap_deadline_.async_wait([self = shared_from_this()](std::error_code ec) {
|
496
|
+
if (ec == asio::error::operation_aborted || self->stopped_) {
|
497
|
+
return;
|
498
|
+
}
|
499
|
+
spdlog::warn("{} unable to bootstrap in time", self->log_prefix_);
|
500
|
+
self->bootstrap_handler_(std::make_error_code(error::common_errc::unambiguous_timeout), {});
|
501
|
+
self->bootstrap_handler_ = nullptr;
|
502
|
+
self->stop(retry_reason::socket_closed_while_in_flight);
|
503
|
+
});
|
504
|
+
initiate_bootstrap();
|
421
505
|
}
|
422
506
|
|
423
|
-
|
507
|
+
void initiate_bootstrap()
|
424
508
|
{
|
425
|
-
|
509
|
+
if (stopped_) {
|
510
|
+
return;
|
511
|
+
}
|
512
|
+
if (origin_.exhausted()) {
|
513
|
+
auto backoff = std::chrono::milliseconds(500);
|
514
|
+
spdlog::debug("{} reached the end of list of bootstrap nodes, waiting for {}ms before restart", log_prefix_, backoff.count());
|
515
|
+
retry_backoff_.expires_after(backoff);
|
516
|
+
retry_backoff_.async_wait([self = shared_from_this()](std::error_code ec) mutable {
|
517
|
+
if (ec == asio::error::operation_aborted || self->stopped_) {
|
518
|
+
return;
|
519
|
+
}
|
520
|
+
self->origin_.restart();
|
521
|
+
self->initiate_bootstrap();
|
522
|
+
});
|
523
|
+
return;
|
524
|
+
}
|
525
|
+
std::tie(bootstrap_hostname_, bootstrap_port_) = origin_.next_address();
|
526
|
+
log_prefix_ = fmt::format("[{}/{}/{}/{}] <{}:{}>",
|
527
|
+
stream_->log_prefix(),
|
528
|
+
client_id_,
|
529
|
+
id_,
|
530
|
+
bucket_name_.value_or("-"),
|
531
|
+
bootstrap_hostname_,
|
532
|
+
bootstrap_port_);
|
533
|
+
spdlog::debug("{} attempt to establish MCBP connection", log_prefix_);
|
534
|
+
resolver_.async_resolve(bootstrap_hostname_,
|
535
|
+
bootstrap_port_,
|
536
|
+
std::bind(&mcbp_session::on_resolve, shared_from_this(), std::placeholders::_1, std::placeholders::_2));
|
537
|
+
}
|
538
|
+
|
539
|
+
[[nodiscard]] const std::string& id() const
|
540
|
+
{
|
541
|
+
return id_;
|
542
|
+
}
|
543
|
+
|
544
|
+
void on_stop(std::function<void(io::retry_reason)> handler)
|
545
|
+
{
|
546
|
+
on_stop_handler_ = std::move(handler);
|
426
547
|
}
|
427
548
|
|
428
|
-
void stop()
|
549
|
+
void stop(retry_reason reason)
|
429
550
|
{
|
430
551
|
if (stopped_) {
|
431
552
|
return;
|
432
553
|
}
|
554
|
+
spdlog::debug("{} stop MCBP connection, reason={}", log_prefix_, reason);
|
433
555
|
stopped_ = true;
|
434
|
-
|
556
|
+
bootstrap_deadline_.cancel();
|
557
|
+
connection_deadline_.cancel();
|
558
|
+
retry_backoff_.cancel();
|
435
559
|
resolver_.cancel();
|
436
|
-
if (
|
437
|
-
|
560
|
+
if (stream_->is_open()) {
|
561
|
+
stream_->close();
|
562
|
+
}
|
563
|
+
auto ec = std::make_error_code(error::common_errc::request_canceled);
|
564
|
+
if (!bootstrapped_ && bootstrap_handler_) {
|
565
|
+
bootstrap_handler_(ec, {});
|
566
|
+
bootstrap_handler_ = nullptr;
|
438
567
|
}
|
439
568
|
if (handler_) {
|
440
569
|
handler_->stop();
|
441
570
|
}
|
571
|
+
for (auto& handler : command_handlers_) {
|
572
|
+
spdlog::debug("{} MCBP cancel operation during session close, opaque={}, ec={}", log_prefix_, handler.first, ec.message());
|
573
|
+
handler.second(ec, reason, {});
|
574
|
+
}
|
575
|
+
command_handlers_.clear();
|
576
|
+
config_listeners_.clear();
|
577
|
+
if (on_stop_handler_) {
|
578
|
+
on_stop_handler_(reason);
|
579
|
+
}
|
580
|
+
on_stop_handler_ = nullptr;
|
442
581
|
}
|
443
582
|
|
444
583
|
void write(const std::vector<uint8_t>& buf)
|
@@ -446,6 +585,11 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
446
585
|
if (stopped_) {
|
447
586
|
return;
|
448
587
|
}
|
588
|
+
std::uint32_t opaque{ 0 };
|
589
|
+
std::memcpy(&opaque, buf.data() + 12, sizeof(opaque));
|
590
|
+
spdlog::trace("{} MCBP send, opaque={}, {:n}", log_prefix_, opaque, spdlog::to_hex(buf.begin(), buf.begin() + 24));
|
591
|
+
SPDLOG_TRACE("{} MCBP send, opaque={}{:a}", log_prefix_, opaque, spdlog::to_hex(data));
|
592
|
+
std::scoped_lock lock(output_buffer_mutex_);
|
449
593
|
output_buffer_.push_back(buf);
|
450
594
|
}
|
451
595
|
|
@@ -468,30 +612,49 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
468
612
|
|
469
613
|
void write_and_subscribe(uint32_t opaque,
|
470
614
|
std::vector<std::uint8_t>& data,
|
471
|
-
std::function<void(std::error_code, io::mcbp_message&&)> handler)
|
615
|
+
std::function<void(std::error_code, retry_reason, io::mcbp_message&&)> handler)
|
472
616
|
{
|
473
617
|
if (stopped_) {
|
618
|
+
spdlog::warn("{} MCBP cancel operation, while trying to write to closed session, opaque={}", log_prefix_, opaque);
|
619
|
+
handler(std::make_error_code(error::common_errc::request_canceled), retry_reason::socket_closed_while_in_flight, {});
|
474
620
|
return;
|
475
621
|
}
|
476
622
|
command_handlers_.emplace(opaque, std::move(handler));
|
477
|
-
if (bootstrapped_ &&
|
623
|
+
if (bootstrapped_ && stream_->is_open()) {
|
478
624
|
write_and_flush(data);
|
479
625
|
} else {
|
626
|
+
spdlog::debug("{} the stream is not ready yet, put the message into pending buffer, opaque={}", log_prefix_, opaque);
|
627
|
+
std::scoped_lock lock(pending_buffer_mutex_);
|
480
628
|
pending_buffer_.push_back(data);
|
481
629
|
}
|
482
630
|
}
|
483
631
|
|
484
|
-
[[nodiscard]] std::
|
632
|
+
[[nodiscard]] bool cancel(uint32_t opaque, std::error_code ec, retry_reason reason)
|
485
633
|
{
|
486
|
-
|
634
|
+
if (stopped_) {
|
635
|
+
return false;
|
636
|
+
}
|
637
|
+
auto handler = command_handlers_.find(opaque);
|
638
|
+
if (handler != command_handlers_.end()) {
|
639
|
+
spdlog::debug("{} MCBP cancel operation, opaque={}, ec={}", log_prefix_, opaque, ec.message());
|
640
|
+
handler->second(ec, reason, {});
|
641
|
+
command_handlers_.erase(handler);
|
642
|
+
return true;
|
643
|
+
}
|
644
|
+
return false;
|
487
645
|
}
|
488
646
|
|
489
|
-
bool supports_feature(protocol::hello_feature feature)
|
647
|
+
[[nodiscard]] bool supports_feature(protocol::hello_feature feature)
|
490
648
|
{
|
491
649
|
return std::find(supported_features_.begin(), supported_features_.end(), feature) != supported_features_.end();
|
492
650
|
}
|
493
651
|
|
494
|
-
|
652
|
+
[[nodiscard]] std::vector<protocol::hello_feature> supported_features() const
|
653
|
+
{
|
654
|
+
return supported_features_;
|
655
|
+
}
|
656
|
+
|
657
|
+
[[nodiscard]] bool supports_gcccp()
|
495
658
|
{
|
496
659
|
return supports_gcccp_;
|
497
660
|
}
|
@@ -512,6 +675,16 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
512
675
|
return config_->index_for_this_node();
|
513
676
|
}
|
514
677
|
|
678
|
+
[[nodiscard]] const std::string& bootstrap_hostname() const
|
679
|
+
{
|
680
|
+
return bootstrap_hostname_;
|
681
|
+
}
|
682
|
+
|
683
|
+
[[nodiscard]] const std::string& bootstrap_port() const
|
684
|
+
{
|
685
|
+
return bootstrap_port_;
|
686
|
+
}
|
687
|
+
|
515
688
|
[[nodiscard]] uint32_t next_opaque()
|
516
689
|
{
|
517
690
|
return ++opaque_;
|
@@ -531,16 +704,17 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
531
704
|
return std::make_error_code(error::key_value_errc::document_not_found);
|
532
705
|
|
533
706
|
case protocol::status::exists:
|
534
|
-
if (opcode == protocol::client_opcode::
|
535
|
-
return std::make_error_code(error::
|
707
|
+
if (opcode == protocol::client_opcode::insert) {
|
708
|
+
return std::make_error_code(error::key_value_errc::document_exists);
|
536
709
|
}
|
537
|
-
return std::make_error_code(error::
|
710
|
+
return std::make_error_code(error::common_errc::cas_mismatch);
|
538
711
|
|
539
712
|
case protocol::status::too_big:
|
540
713
|
return std::make_error_code(error::key_value_errc::value_too_large);
|
541
714
|
|
542
715
|
case protocol::status::invalid:
|
543
716
|
case protocol::status::xattr_invalid:
|
717
|
+
case protocol::status::subdoc_invalid_combo:
|
544
718
|
return std::make_error_code(error::common_errc::invalid_argument);
|
545
719
|
|
546
720
|
case protocol::status::delta_bad_value:
|
@@ -565,7 +739,7 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
565
739
|
return std::make_error_code(error::common_errc::internal_server_failure);
|
566
740
|
|
567
741
|
case protocol::status::busy:
|
568
|
-
case protocol::status::
|
742
|
+
case protocol::status::temporary_failure:
|
569
743
|
case protocol::status::no_memory:
|
570
744
|
case protocol::status::not_initialized:
|
571
745
|
return std::make_error_code(error::common_errc::temporary_failure);
|
@@ -624,7 +798,6 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
624
798
|
case protocol::status::subdoc_value_too_deep:
|
625
799
|
return std::make_error_code(error::key_value_errc::value_too_deep);
|
626
800
|
|
627
|
-
case protocol::status::subdoc_invalid_combo:
|
628
801
|
case protocol::status::subdoc_xattr_invalid_flag_combo:
|
629
802
|
case protocol::status::subdoc_xattr_invalid_key_combo:
|
630
803
|
return std::make_error_code(error::key_value_errc::xattr_invalid_key_combo);
|
@@ -651,29 +824,107 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
651
824
|
break;
|
652
825
|
}
|
653
826
|
// FIXME: use error map here
|
654
|
-
spdlog::warn("unknown status code: {} (opcode={})", status, opcode);
|
827
|
+
spdlog::warn("{} unknown status code: {} (opcode={})", log_prefix_, protocol::status_to_string(status), opcode);
|
655
828
|
return std::make_error_code(error::network_errc::protocol_error);
|
656
829
|
}
|
657
830
|
|
831
|
+
std::optional<error_map::error_info> decode_error_code(std::uint16_t code)
|
832
|
+
{
|
833
|
+
if (error_map_) {
|
834
|
+
auto info = error_map_->errors.find(code);
|
835
|
+
if (info != error_map_->errors.end()) {
|
836
|
+
return info->second;
|
837
|
+
}
|
838
|
+
}
|
839
|
+
return {};
|
840
|
+
}
|
841
|
+
|
842
|
+
void on_configuration_update(std::function<void(const configuration&)> handler)
|
843
|
+
{
|
844
|
+
config_listeners_.emplace_back(std::move(handler));
|
845
|
+
}
|
846
|
+
|
658
847
|
void update_configuration(configuration&& config)
|
659
848
|
{
|
849
|
+
if (stopped_) {
|
850
|
+
return;
|
851
|
+
}
|
660
852
|
if (!config_ || config.rev > config_->rev) {
|
853
|
+
for (auto& node : config.nodes) {
|
854
|
+
if (node.hostname.empty()) {
|
855
|
+
node.hostname = bootstrap_hostname_;
|
856
|
+
}
|
857
|
+
}
|
661
858
|
config_.emplace(config);
|
662
|
-
spdlog::
|
859
|
+
spdlog::debug("{} received new configuration: {}", log_prefix_, config_.value());
|
860
|
+
for (auto& listener : config_listeners_) {
|
861
|
+
listener(*config_);
|
862
|
+
}
|
663
863
|
}
|
664
864
|
}
|
665
865
|
|
866
|
+
void handle_not_my_vbucket(io::mcbp_message&& msg)
|
867
|
+
{
|
868
|
+
if (stopped_) {
|
869
|
+
return;
|
870
|
+
}
|
871
|
+
Expects(msg.header.magic == static_cast<std::uint8_t>(protocol::magic::alt_client_response) ||
|
872
|
+
msg.header.magic == static_cast<std::uint8_t>(protocol::magic::client_response));
|
873
|
+
if (protocol::has_json_datatype(msg.header.datatype)) {
|
874
|
+
auto magic = static_cast<protocol::magic>(msg.header.magic);
|
875
|
+
uint8_t extras_size = msg.header.extlen;
|
876
|
+
uint8_t framing_extras_size = 0;
|
877
|
+
uint16_t key_size = htons(msg.header.keylen);
|
878
|
+
if (magic == protocol::magic::alt_client_response) {
|
879
|
+
framing_extras_size = static_cast<std::uint8_t>(msg.header.keylen >> 8U);
|
880
|
+
key_size = msg.header.keylen & 0xffU;
|
881
|
+
}
|
882
|
+
|
883
|
+
std::vector<uint8_t>::difference_type offset = framing_extras_size + key_size + extras_size;
|
884
|
+
if (ntohl(msg.header.bodylen) - offset > 0) {
|
885
|
+
auto config = protocol::parse_config(msg.body.begin() + offset, msg.body.end());
|
886
|
+
spdlog::debug("{} received not_my_vbucket status for {}, opaque={} with config rev={} in the payload",
|
887
|
+
log_prefix_,
|
888
|
+
static_cast<protocol::client_opcode>(msg.header.opcode),
|
889
|
+
msg.header.opaque,
|
890
|
+
config.rev);
|
891
|
+
update_configuration(std::move(config));
|
892
|
+
}
|
893
|
+
}
|
894
|
+
}
|
895
|
+
|
896
|
+
std::optional<std::uint32_t> get_collection_uid(const std::string& collection_path)
|
897
|
+
{
|
898
|
+
return collection_cache_.get(collection_path);
|
899
|
+
}
|
900
|
+
|
901
|
+
void update_collection_uid(const std::string& path, std::uint32_t uid)
|
902
|
+
{
|
903
|
+
if (stopped_) {
|
904
|
+
return;
|
905
|
+
}
|
906
|
+
collection_cache_.update(path, uid);
|
907
|
+
}
|
908
|
+
|
666
909
|
private:
|
667
910
|
void invoke_bootstrap_handler(std::error_code ec)
|
668
911
|
{
|
912
|
+
if (retry_bootstrap_on_bucket_not_found_ && ec == std::make_error_code(error::common_errc::bucket_not_found)) {
|
913
|
+
spdlog::debug(R"({} server returned {}, it must be transient condition, retrying)", log_prefix_, ec.message());
|
914
|
+
return initiate_bootstrap();
|
915
|
+
}
|
916
|
+
|
669
917
|
if (!bootstrapped_ && bootstrap_handler_) {
|
918
|
+
bootstrap_deadline_.cancel();
|
670
919
|
bootstrap_handler_(ec, config_.value_or(configuration{}));
|
671
920
|
bootstrap_handler_ = nullptr;
|
672
921
|
}
|
673
|
-
bootstrapped_ = true;
|
674
922
|
if (ec) {
|
675
|
-
stop();
|
923
|
+
return stop(retry_reason::node_not_available);
|
676
924
|
}
|
925
|
+
bootstrapped_ = true;
|
926
|
+
handler_ = std::make_unique<normal_handler>(shared_from_this());
|
927
|
+
std::scoped_lock lock(pending_buffer_mutex_);
|
677
928
|
if (!pending_buffer_.empty()) {
|
678
929
|
for (const auto& buf : pending_buffer_) {
|
679
930
|
write(buf);
|
@@ -689,12 +940,13 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
689
940
|
return;
|
690
941
|
}
|
691
942
|
if (ec) {
|
692
|
-
spdlog::error("error on resolve: {}", ec.message());
|
693
|
-
return
|
943
|
+
spdlog::error("{} error on resolve: {}", log_prefix_, ec.message());
|
944
|
+
return initiate_bootstrap();
|
694
945
|
}
|
695
946
|
endpoints_ = endpoints;
|
696
947
|
do_connect(endpoints_.begin());
|
697
|
-
|
948
|
+
connection_deadline_.expires_after(timeout_defaults::connect_timeout);
|
949
|
+
connection_deadline_.async_wait(std::bind(&mcbp_session::check_deadline, shared_from_this(), std::placeholders::_1));
|
698
950
|
}
|
699
951
|
|
700
952
|
void do_connect(asio::ip::tcp::resolver::results_type::iterator it)
|
@@ -703,13 +955,12 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
703
955
|
return;
|
704
956
|
}
|
705
957
|
if (it != endpoints_.end()) {
|
706
|
-
spdlog::
|
707
|
-
|
708
|
-
|
958
|
+
spdlog::debug("{} connecting to {}:{}", log_prefix_, it->endpoint().address().to_string(), it->endpoint().port());
|
959
|
+
connection_deadline_.expires_after(timeout_defaults::connect_timeout);
|
960
|
+
stream_->async_connect(it->endpoint(), std::bind(&mcbp_session::on_connect, shared_from_this(), std::placeholders::_1, it));
|
709
961
|
} else {
|
710
|
-
spdlog::error("no more endpoints left to connect");
|
711
|
-
|
712
|
-
stop();
|
962
|
+
spdlog::error("{} no more endpoints left to connect, will try another address", log_prefix_);
|
963
|
+
return initiate_bootstrap();
|
713
964
|
}
|
714
965
|
}
|
715
966
|
|
@@ -718,32 +969,39 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
718
969
|
if (stopped_) {
|
719
970
|
return;
|
720
971
|
}
|
721
|
-
if (!
|
972
|
+
if (!stream_->is_open() || ec) {
|
973
|
+
spdlog::warn(
|
974
|
+
"{} unable to connect to {}:{}: {}", log_prefix_, it->endpoint().address().to_string(), it->endpoint().port(), ec.message());
|
722
975
|
do_connect(++it);
|
723
976
|
} else {
|
724
|
-
|
725
|
-
socket_.set_option(asio::socket_base::keep_alive{ true });
|
977
|
+
stream_->set_options();
|
726
978
|
endpoint_ = it->endpoint();
|
727
|
-
|
979
|
+
endpoint_address_ = endpoint_.address().to_string();
|
980
|
+
spdlog::debug("{} connected to {}:{}", log_prefix_, endpoint_address_, it->endpoint().port());
|
981
|
+
log_prefix_ = fmt::format("[{}/{}/{}/{}] <{}/{}:{}>",
|
982
|
+
stream_->log_prefix(),
|
983
|
+
client_id_,
|
984
|
+
id_,
|
985
|
+
bucket_name_.value_or("-"),
|
986
|
+
bootstrap_hostname_,
|
987
|
+
endpoint_address_,
|
988
|
+
endpoint_.port());
|
728
989
|
handler_ = std::make_unique<bootstrap_handler>(shared_from_this());
|
729
|
-
|
730
|
-
|
990
|
+
connection_deadline_.expires_at(asio::steady_timer::time_point::max());
|
991
|
+
connection_deadline_.cancel();
|
731
992
|
}
|
732
993
|
}
|
733
994
|
|
734
995
|
void check_deadline(std::error_code ec)
|
735
996
|
{
|
736
|
-
if (ec == asio::error::operation_aborted) {
|
997
|
+
if (ec == asio::error::operation_aborted || stopped_) {
|
737
998
|
return;
|
738
999
|
}
|
739
|
-
if (
|
740
|
-
|
1000
|
+
if (connection_deadline_.expiry() <= asio::steady_timer::clock_type::now()) {
|
1001
|
+
stream_->close();
|
1002
|
+
connection_deadline_.expires_at(asio::steady_timer::time_point::max());
|
741
1003
|
}
|
742
|
-
|
743
|
-
socket_.close();
|
744
|
-
deadline_timer_.expires_at(asio::steady_timer::time_point::max());
|
745
|
-
}
|
746
|
-
deadline_timer_.async_wait(std::bind(&mcbp_session::check_deadline, this, std::placeholders::_1));
|
1004
|
+
connection_deadline_.async_wait(std::bind(&mcbp_session::check_deadline, shared_from_this(), std::placeholders::_1));
|
747
1005
|
}
|
748
1006
|
|
749
1007
|
void do_read()
|
@@ -755,35 +1013,47 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
755
1013
|
return;
|
756
1014
|
}
|
757
1015
|
reading_ = true;
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
1016
|
+
stream_->async_read_some(
|
1017
|
+
asio::buffer(input_buffer_), [self = shared_from_this()](std::error_code ec, std::size_t bytes_transferred) {
|
1018
|
+
if (ec == asio::error::operation_aborted || self->stopped_) {
|
1019
|
+
return;
|
1020
|
+
}
|
1021
|
+
if (ec) {
|
1022
|
+
spdlog::error("{} IO error while reading from the socket: {}, pending_handlers={}",
|
1023
|
+
self->log_prefix_,
|
1024
|
+
ec.message(),
|
1025
|
+
self->command_handlers_.size());
|
1026
|
+
return self->stop(retry_reason::socket_closed_while_in_flight);
|
1027
|
+
}
|
1028
|
+
self->parser_.feed(self->input_buffer_.data(), self->input_buffer_.data() + ssize_t(bytes_transferred));
|
1029
|
+
|
1030
|
+
for (;;) {
|
1031
|
+
mcbp_message msg{};
|
1032
|
+
switch (self->parser_.next(msg)) {
|
1033
|
+
case mcbp_parser::ok:
|
1034
|
+
spdlog::trace(
|
1035
|
+
"{} MCBP recv, opaque={}, {:n}", self->log_prefix_, msg.header.opaque, spdlog::to_hex(msg.header_data()));
|
1036
|
+
SPDLOG_TRACE("{} MCBP recv, opaque={}{:a}{:a}",
|
1037
|
+
self->log_prefix_,
|
1038
|
+
msg.header.opaque,
|
1039
|
+
spdlog::to_hex(msg.header_data()),
|
1040
|
+
spdlog::to_hex(msg.body));
|
1041
|
+
self->handler_->handle(std::move(msg));
|
1042
|
+
if (self->stopped_) {
|
1043
|
+
return;
|
1044
|
+
}
|
1045
|
+
break;
|
1046
|
+
case mcbp_parser::need_data:
|
1047
|
+
self->reading_ = false;
|
1048
|
+
if (!self->stopped_) {
|
1049
|
+
self->do_read();
|
1050
|
+
}
|
1051
|
+
return;
|
1052
|
+
case mcbp_parser::failure:
|
1053
|
+
return self->stop(retry_reason::kv_temporary_failure);
|
1054
|
+
}
|
1055
|
+
}
|
1056
|
+
});
|
787
1057
|
}
|
788
1058
|
|
789
1059
|
void do_write()
|
@@ -791,7 +1061,8 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
791
1061
|
if (stopped_) {
|
792
1062
|
return;
|
793
1063
|
}
|
794
|
-
|
1064
|
+
std::scoped_lock lock(writing_buffer_mutex_, output_buffer_mutex_);
|
1065
|
+
if (!writing_buffer_.empty() || output_buffer_.empty()) {
|
795
1066
|
return;
|
796
1067
|
}
|
797
1068
|
std::swap(writing_buffer_, output_buffer_);
|
@@ -800,60 +1071,71 @@ class mcbp_session : public std::enable_shared_from_this<mcbp_session>
|
|
800
1071
|
for (auto& buf : writing_buffer_) {
|
801
1072
|
buffers.emplace_back(asio::buffer(buf));
|
802
1073
|
}
|
803
|
-
|
804
|
-
if (self->stopped_) {
|
1074
|
+
stream_->async_write(buffers, [self = shared_from_this()](std::error_code ec, std::size_t /*unused*/) {
|
1075
|
+
if (ec == asio::error::operation_aborted || self->stopped_) {
|
805
1076
|
return;
|
806
1077
|
}
|
807
1078
|
if (ec) {
|
808
|
-
spdlog::error("
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
return self->stop();
|
1079
|
+
spdlog::error("{} IO error while writing to the socket: {}, pending_handlers={}",
|
1080
|
+
self->log_prefix_,
|
1081
|
+
ec.message(),
|
1082
|
+
self->command_handlers_.size());
|
1083
|
+
return self->stop(retry_reason::socket_closed_while_in_flight);
|
813
1084
|
}
|
814
|
-
|
815
|
-
|
816
|
-
self->
|
1085
|
+
{
|
1086
|
+
std::scoped_lock inner_lock(self->writing_buffer_mutex_);
|
1087
|
+
self->writing_buffer_.clear();
|
817
1088
|
}
|
1089
|
+
self->do_write();
|
818
1090
|
self->do_read();
|
819
1091
|
});
|
820
1092
|
}
|
821
1093
|
|
822
|
-
|
823
|
-
|
1094
|
+
std::string client_id_;
|
1095
|
+
std::string id_;
|
824
1096
|
asio::io_context& ctx_;
|
825
1097
|
asio::ip::tcp::resolver resolver_;
|
826
|
-
|
827
|
-
asio::
|
828
|
-
asio::steady_timer
|
1098
|
+
std::unique_ptr<stream_impl> stream_;
|
1099
|
+
asio::steady_timer bootstrap_deadline_;
|
1100
|
+
asio::steady_timer connection_deadline_;
|
1101
|
+
asio::steady_timer retry_backoff_;
|
1102
|
+
couchbase::origin origin_;
|
829
1103
|
std::optional<std::string> bucket_name_;
|
830
1104
|
mcbp_parser parser_;
|
831
1105
|
std::unique_ptr<message_handler> handler_;
|
832
|
-
std::function<void(std::error_code, configuration)> bootstrap_handler_;
|
833
|
-
std::map<uint32_t, std::function<void(std::error_code, io::mcbp_message&&)>> command_handlers_{};
|
1106
|
+
std::function<void(std::error_code, const configuration&)> bootstrap_handler_{};
|
1107
|
+
std::map<uint32_t, std::function<void(std::error_code, retry_reason, io::mcbp_message&&)>> command_handlers_{};
|
1108
|
+
std::vector<std::function<void(const configuration&)>> config_listeners_{};
|
1109
|
+
std::function<void(io::retry_reason)> on_stop_handler_{};
|
834
1110
|
|
835
1111
|
bool bootstrapped_{ false };
|
836
1112
|
std::atomic_bool stopped_{ false };
|
837
1113
|
bool authenticated_{ false };
|
838
1114
|
bool bucket_selected_{ false };
|
839
1115
|
bool supports_gcccp_{ true };
|
1116
|
+
bool retry_bootstrap_on_bucket_not_found_{ false };
|
840
1117
|
|
841
1118
|
std::atomic<std::uint32_t> opaque_{ 0 };
|
842
1119
|
|
843
|
-
std::string username_;
|
844
|
-
std::string password_;
|
845
|
-
|
846
1120
|
std::array<std::uint8_t, 16384> input_buffer_{};
|
847
1121
|
std::vector<std::vector<std::uint8_t>> output_buffer_{};
|
848
1122
|
std::vector<std::vector<std::uint8_t>> pending_buffer_{};
|
849
1123
|
std::vector<std::vector<std::uint8_t>> writing_buffer_{};
|
1124
|
+
std::mutex output_buffer_mutex_{};
|
1125
|
+
std::mutex pending_buffer_mutex_{};
|
1126
|
+
std::mutex writing_buffer_mutex_{};
|
1127
|
+
std::string bootstrap_hostname_{};
|
1128
|
+
std::string bootstrap_port_{};
|
850
1129
|
asio::ip::tcp::endpoint endpoint_{}; // connected endpoint
|
1130
|
+
std::string endpoint_address_{}; // cached string with endpoint address
|
851
1131
|
asio::ip::tcp::resolver::results_type endpoints_;
|
852
1132
|
std::vector<protocol::hello_feature> supported_features_;
|
853
1133
|
std::optional<configuration> config_;
|
854
|
-
std::optional<error_map>
|
855
|
-
|
1134
|
+
std::optional<error_map> error_map_;
|
1135
|
+
collection_cache collection_cache_;
|
856
1136
|
|
857
1137
|
std::atomic_bool reading_{ false };
|
1138
|
+
|
1139
|
+
std::string log_prefix_{};
|
858
1140
|
};
|
859
1141
|
} // namespace couchbase::io
|