aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-10-26 16:16:06 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-10-26 16:16:06 -0700
commitd41a4a720f76c6555b80f82ee771071e09d55e03 (patch)
tree1ca017c927b7b3f80204ecc362c22468d3775887
parent6b5d682c981f365d1f3c1bf771f113bd727d5ee0 (diff)
s/gpr_slice/grpc_slice, and move around tests, impls
-rw-r--r--Makefile32
-rw-r--r--build.yaml30
-rw-r--r--grpc.def56
-rw-r--r--include/grpc++/impl/codegen/core_codegen.h16
-rw-r--r--include/grpc++/impl/codegen/core_codegen_interface.h14
-rw-r--r--include/grpc++/impl/codegen/proto_utils.h26
-rw-r--r--include/grpc++/impl/codegen/thrift_serializer.h8
-rw-r--r--include/grpc++/support/slice.h12
-rw-r--r--include/grpc/byte_buffer.h10
-rw-r--r--include/grpc/impl/codegen/gpr_types.h65
-rw-r--r--include/grpc/impl/codegen/grpc_types.h3
-rw-r--r--include/grpc/impl/codegen/slice.h66
-rw-r--r--include/grpc/slice.h (renamed from include/grpc/support/slice.h)54
-rw-r--r--include/grpc/slice_buffer.h (renamed from include/grpc/support/slice_buffer.h)34
-rw-r--r--src/core/ext/client_channel/connector.h2
-rw-r--r--src/core/ext/client_channel/default_initial_connect_string.c2
-rw-r--r--src/core/ext/client_channel/http_connect_handshaker.c30
-rw-r--r--src/core/ext/client_channel/initial_connect_string.c4
-rw-r--r--src/core/ext/client_channel/initial_connect_string.h4
-rw-r--r--src/core/ext/client_channel/subchannel.c4
-rw-r--r--src/core/ext/client_channel/uri_parser.c24
-rw-r--r--src/core/ext/lb_policy/grpclb/grpclb.c10
-rw-r--r--src/core/ext/lb_policy/grpclb/load_balancer_api.c10
-rw-r--r--src/core/ext/lb_policy/grpclb/load_balancer_api.h6
-rw-r--r--src/core/ext/resolver/sockaddr/sockaddr_resolver.c14
-rw-r--r--src/core/ext/transport/chttp2/client/insecure/channel_create.c8
-rw-r--r--src/core/ext/transport/chttp2/client/secure/secure_channel_create.c8
-rw-r--r--src/core/ext/transport/chttp2/server/insecure/server_chttp2.c2
-rw-r--r--src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c2
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_decoder.c18
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_decoder.h4
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_encoder.c14
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_encoder.h12
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.c88
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.h2
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_data.c22
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_data.h6
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_goaway.c14
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_goaway.h6
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_ping.c8
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_ping.h4
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_rst_stream.c8
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_rst_stream.h4
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_settings.c16
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_settings.h6
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_window_update.c6
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_window_update.h4
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_encoder.c36
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_encoder.h2
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_parser.c2
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_parser.h2
-rw-r--r--src/core/ext/transport/chttp2/transport/internal.h28
-rw-r--r--src/core/ext/transport/chttp2/transport/parsing.c18
-rw-r--r--src/core/ext/transport/chttp2/transport/writing.c14
-rw-r--r--src/core/ext/transport/cronet/transport/cronet_transport.c24
-rw-r--r--src/core/lib/channel/channel_stack.c4
-rw-r--r--src/core/lib/channel/channel_stack.h4
-rw-r--r--src/core/lib/channel/compress_filter.c22
-rw-r--r--src/core/lib/channel/deadline_filter.c4
-rw-r--r--src/core/lib/channel/handshaker.c8
-rw-r--r--src/core/lib/channel/handshaker.h6
-rw-r--r--src/core/lib/channel/http_client_filter.c16
-rw-r--r--src/core/lib/channel/http_server_filter.c8
-rw-r--r--src/core/lib/channel/message_size_filter.c2
-rw-r--r--src/core/lib/compression/message_compress.c32
-rw-r--r--src/core/lib/compression/message_compress.h4
-rw-r--r--src/core/lib/http/format_request.c12
-rw-r--r--src/core/lib/http/format_request.h6
-rw-r--r--src/core/lib/http/httpcli.c22
-rw-r--r--src/core/lib/http/httpcli_security_connector.c2
-rw-r--r--src/core/lib/http/parser.c2
-rw-r--r--src/core/lib/http/parser.h2
-rw-r--r--src/core/lib/iomgr/endpoint.c4
-rw-r--r--src/core/lib/iomgr/endpoint.h8
-rw-r--r--src/core/lib/iomgr/load_file.c6
-rw-r--r--src/core/lib/iomgr/load_file.h2
-rw-r--r--src/core/lib/iomgr/resource_quota.c12
-rw-r--r--src/core/lib/iomgr/resource_quota.h4
-rw-r--r--src/core/lib/iomgr/tcp_posix.c36
-rw-r--r--src/core/lib/iomgr/tcp_windows.c24
-rw-r--r--src/core/lib/security/credentials/credentials.h6
-rw-r--r--src/core/lib/security/credentials/credentials_metadata.c14
-rw-r--r--src/core/lib/security/credentials/google_default/google_default_credentials.c4
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_verifier.c40
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_verifier.h2
-rw-r--r--src/core/lib/security/credentials/plugin/plugin_credentials.c8
-rw-r--r--src/core/lib/security/transport/client_auth_filter.c6
-rw-r--r--src/core/lib/security/transport/handshake.c38
-rw-r--r--src/core/lib/security/transport/handshake.h2
-rw-r--r--src/core/lib/security/transport/secure_endpoint.c76
-rw-r--r--src/core/lib/security/transport/secure_endpoint.h2
-rw-r--r--src/core/lib/security/transport/security_connector.c22
-rw-r--r--src/core/lib/security/transport/security_connector.h10
-rw-r--r--src/core/lib/security/transport/server_auth_filter.c4
-rw-r--r--src/core/lib/security/util/b64.c8
-rw-r--r--src/core/lib/security/util/b64.h4
-rw-r--r--src/core/lib/slice/percent_encoding.c (renamed from src/core/lib/support/percent_encoding.c)20
-rw-r--r--src/core/lib/slice/percent_encoding.h (renamed from src/core/lib/support/percent_encoding.h)8
-rw-r--r--src/core/lib/slice/slice.c (renamed from src/core/lib/support/slice.c)72
-rw-r--r--src/core/lib/slice/slice_buffer.c (renamed from src/core/lib/support/slice_buffer.c)96
-rw-r--r--src/core/lib/slice/slice_string_helpers.c81
-rw-r--r--src/core/lib/slice/slice_string_helpers.h58
-rw-r--r--src/core/lib/support/string.c49
-rw-r--r--src/core/lib/support/string.h7
-rw-r--r--src/core/lib/surface/byte_buffer.c18
-rw-r--r--src/core/lib/surface/byte_buffer_reader.c20
-rw-r--r--src/core/lib/surface/call.c20
-rw-r--r--src/core/lib/surface/server.c8
-rw-r--r--src/core/lib/transport/byte_stream.c8
-rw-r--r--src/core/lib/transport/byte_stream.h8
-rw-r--r--src/core/lib/transport/metadata.c22
-rw-r--r--src/core/lib/transport/metadata.h12
-rw-r--r--src/core/lib/transport/transport.c12
-rw-r--r--src/core/lib/transport/transport.h8
-rw-r--r--src/cpp/common/core_codegen.cc22
-rw-r--r--src/cpp/util/byte_buffer_cc.cc14
-rw-r--r--src/cpp/util/slice_cc.cc8
-rw-r--r--src/csharp/ext/grpc_csharp_ext.c8
-rw-r--r--src/node/ext/byte_buffer.cc8
-rw-r--r--src/objective-c/GRPCClient/private/NSData+GRPC.m12
-rw-r--r--src/php/ext/grpc/byte_buffer.c8
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi26
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi14
-rw-r--r--src/ruby/ext/grpc/rb_byte_buffer.c8
-rw-r--r--src/ruby/ext/grpc/rb_grpc_imports.generated.c112
-rw-r--r--src/ruby/ext/grpc/rb_grpc_imports.generated.h178
-rw-r--r--test/core/bad_client/bad_client.c18
-rw-r--r--test/core/bad_client/bad_client.h2
-rw-r--r--test/core/bad_client/tests/large_metadata.c16
-rw-r--r--test/core/bad_ssl/servers/cert.c6
-rw-r--r--test/core/client_channel/set_initial_connect_string_test.c24
-rw-r--r--test/core/compression/message_compress_test.c144
-rw-r--r--test/core/end2end/bad_server_response_test.c18
-rw-r--r--test/core/end2end/cq_verifier.c18
-rw-r--r--test/core/end2end/cq_verifier.h2
-rw-r--r--test/core/end2end/dualstack_socket_test.c14
-rw-r--r--test/core/end2end/fake_resolver.c14
-rw-r--r--test/core/end2end/fixtures/http_proxy.c62
-rw-r--r--test/core/end2end/fuzzers/api_fuzzer.c4
-rw-r--r--test/core/end2end/fuzzers/client_fuzzer.c4
-rw-r--r--test/core/end2end/fuzzers/server_fuzzer.c4
-rw-r--r--test/core/end2end/invalid_call_argument_test.c2
-rw-r--r--test/core/end2end/tests/binary_metadata.c4
-rw-r--r--test/core/end2end/tests/call_creds.c6
-rw-r--r--test/core/end2end/tests/cancel_after_accept.c4
-rw-r--r--test/core/end2end/tests/cancel_after_client_done.c4
-rw-r--r--test/core/end2end/tests/cancel_after_invoke.c2
-rw-r--r--test/core/end2end/tests/cancel_before_invoke.c2
-rw-r--r--test/core/end2end/tests/compressed_payload.c16
-rw-r--r--test/core/end2end/tests/filter_call_init_fails.c2
-rw-r--r--test/core/end2end/tests/filter_causes_close.c6
-rw-r--r--test/core/end2end/tests/invoke_large_request.c12
-rw-r--r--test/core/end2end/tests/large_metadata.c2
-rw-r--r--test/core/end2end/tests/load_reporting_hook.c4
-rw-r--r--test/core/end2end/tests/max_message_length.c6
-rw-r--r--test/core/end2end/tests/network_status_change.c2
-rw-r--r--test/core/end2end/tests/payload.c10
-rw-r--r--test/core/end2end/tests/ping_pong_streaming.c8
-rw-r--r--test/core/end2end/tests/request_with_flags.c2
-rw-r--r--test/core/end2end/tests/request_with_payload.c2
-rw-r--r--test/core/end2end/tests/resource_quota_server.c10
-rw-r--r--test/core/end2end/tests/simple_cacheable_request.c4
-rw-r--r--test/core/end2end/tests/simple_metadata.c4
-rw-r--r--test/core/end2end/tests/streaming_error_response.c4
-rw-r--r--test/core/end2end/tests/trailing_metadata.c4
-rw-r--r--test/core/fling/client.c4
-rw-r--r--test/core/http/format_request_test.c24
-rw-r--r--test/core/http/parser_test.c32
-rw-r--r--test/core/http/request_fuzzer.c4
-rw-r--r--test/core/http/response_fuzzer.c4
-rw-r--r--test/core/internal_api_canaries/transport.c2
-rw-r--r--test/core/iomgr/endpoint_tests.c34
-rw-r--r--test/core/iomgr/load_file_test.c24
-rw-r--r--test/core/iomgr/resource_quota_test.c12
-rw-r--r--test/core/iomgr/tcp_posix_test.c32
-rw-r--r--test/core/nanopb/fuzzer_response.c4
-rw-r--r--test/core/nanopb/fuzzer_serverlist.c4
-rw-r--r--test/core/security/b64_test.c40
-rw-r--r--test/core/security/create_jwt.c4
-rw-r--r--test/core/security/credentials_test.c40
-rw-r--r--test/core/security/fetch_oauth2.c2
-rw-r--r--test/core/security/json_token_test.c8
-rw-r--r--test/core/security/jwt_verifier_test.c12
-rw-r--r--test/core/security/oauth2_utils.c2
-rw-r--r--test/core/security/secure_endpoint_test.c30
-rw-r--r--test/core/security/security_connector_test.c8
-rw-r--r--test/core/slice/percent_decode_corpus/04cb8ccc553f9b2f5e52c421aff6d1c954d3dae6 (renamed from test/core/support/percent_decode_corpus/04cb8ccc553f9b2f5e52c421aff6d1c954d3dae6)0
-rw-r--r--test/core/slice/percent_decode_corpus/0dd8f3a63745b3a2d39791559b5c1b311447b537 (renamed from test/core/support/percent_decode_corpus/0dd8f3a63745b3a2d39791559b5c1b311447b537)0
-rw-r--r--test/core/slice/percent_decode_corpus/17eeaca784409adbe43365c32ac87915d736bba3 (renamed from test/core/support/percent_decode_corpus/17eeaca784409adbe43365c32ac87915d736bba3)0
-rw-r--r--test/core/slice/percent_decode_corpus/2040c1ff65f52a7ae668c2c8f324de5dacc9d695 (renamed from test/core/support/percent_decode_corpus/2040c1ff65f52a7ae668c2c8f324de5dacc9d695)0
-rw-r--r--test/core/slice/percent_decode_corpus/26b0d1da23027ae54db96e125e4a9e98842d77fb (renamed from test/core/support/percent_decode_corpus/26b0d1da23027ae54db96e125e4a9e98842d77fb)0
-rw-r--r--test/core/slice/percent_decode_corpus/2a089c0db45acdb4c6ed8e7ff81ca7235792c0b9 (renamed from test/core/support/percent_decode_corpus/2a089c0db45acdb4c6ed8e7ff81ca7235792c0b9)0
-rw-r--r--test/core/slice/percent_decode_corpus/35b7b3bc3a740d5c3abca0d75b53f0e1e1ee998a (renamed from test/core/support/percent_decode_corpus/35b7b3bc3a740d5c3abca0d75b53f0e1e1ee998a)0
-rw-r--r--test/core/slice/percent_decode_corpus/36367ba1adba47a1cbc3a88707fde8cc7abdc248 (renamed from test/core/support/percent_decode_corpus/36367ba1adba47a1cbc3a88707fde8cc7abdc248)0
-rw-r--r--test/core/slice/percent_decode_corpus/39c2ba51548a0beaf0d6d1164531f1447dc311b5 (renamed from test/core/support/percent_decode_corpus/39c2ba51548a0beaf0d6d1164531f1447dc311b5)0
-rw-r--r--test/core/slice/percent_decode_corpus/56d08fea787c041395c6697ce26cfbc0decbe688 (renamed from test/core/support/percent_decode_corpus/56d08fea787c041395c6697ce26cfbc0decbe688)0
-rw-r--r--test/core/slice/percent_decode_corpus/678d981fdabb9f0d6640235cf1719dd1e1e66ae9 (renamed from test/core/support/percent_decode_corpus/678d981fdabb9f0d6640235cf1719dd1e1e66ae9)0
-rw-r--r--test/core/slice/percent_decode_corpus/68751961609ec010565de0aa87521dcbf0722c5d (renamed from test/core/support/percent_decode_corpus/68751961609ec010565de0aa87521dcbf0722c5d)0
-rw-r--r--test/core/slice/percent_decode_corpus/7875c06c6f03c9aa2f8e9c59f8d8957c8a32e759 (renamed from test/core/support/percent_decode_corpus/7875c06c6f03c9aa2f8e9c59f8d8957c8a32e759)0
-rw-r--r--test/core/slice/percent_decode_corpus/7b302090e090a5829b6d1dd7be30bd4e36a7e60f (renamed from test/core/support/percent_decode_corpus/7b302090e090a5829b6d1dd7be30bd4e36a7e60f)0
-rw-r--r--test/core/slice/percent_decode_corpus/875e1022169c9e4c541a9ad894e69e989df22ba1 (renamed from test/core/support/percent_decode_corpus/875e1022169c9e4c541a9ad894e69e989df22ba1)0
-rw-r--r--test/core/slice/percent_decode_corpus/8c1051ce066f5a26de9a9d133180621d0da957b4 (renamed from test/core/support/percent_decode_corpus/8c1051ce066f5a26de9a9d133180621d0da957b4)0
-rw-r--r--test/core/slice/percent_decode_corpus/8e084e628ab83a18ac7ca7cb3506525263655c63 (renamed from test/core/support/percent_decode_corpus/8e084e628ab83a18ac7ca7cb3506525263655c63)0
-rw-r--r--test/core/slice/percent_decode_corpus/9d316c4675f40ddccaf8f1cc7aea94170b1e4223 (renamed from test/core/support/percent_decode_corpus/9d316c4675f40ddccaf8f1cc7aea94170b1e4223)0
-rw-r--r--test/core/slice/percent_decode_corpus/ad1c7c11d18a7d116e2c2ef4d4c5afb1270836ae (renamed from test/core/support/percent_decode_corpus/ad1c7c11d18a7d116e2c2ef4d4c5afb1270836ae)0
-rw-r--r--test/core/slice/percent_decode_corpus/b471f94aa4facf502e622e4a248f1ba4063ae681 (renamed from test/core/support/percent_decode_corpus/b471f94aa4facf502e622e4a248f1ba4063ae681)0
-rw-r--r--test/core/slice/percent_decode_corpus/bf52ece030f16136d46e0dc97f58d60a0d8a1f0b (renamed from test/core/support/percent_decode_corpus/bf52ece030f16136d46e0dc97f58d60a0d8a1f0b)0
-rw-r--r--test/core/slice/percent_decode_corpus/d5b2a7177339ba2b7ce2f60e5f4459bef1e72758 (renamed from test/core/support/percent_decode_corpus/d5b2a7177339ba2b7ce2f60e5f4459bef1e72758)0
-rw-r--r--test/core/slice/percent_decode_corpus/de867b64c54a7ed773dc611fc5cd2f17c5433113 (renamed from test/core/support/percent_decode_corpus/de867b64c54a7ed773dc611fc5cd2f17c5433113)0
-rw-r--r--test/core/slice/percent_decode_corpus/e3948dbe004950591630dd5c52f4e0fcbd5e388a (renamed from test/core/support/percent_decode_corpus/e3948dbe004950591630dd5c52f4e0fcbd5e388a)0
-rw-r--r--test/core/slice/percent_decode_corpus/e7064f0b80f61dbc65915311032d27baa569ae2a (renamed from test/core/support/percent_decode_corpus/e7064f0b80f61dbc65915311032d27baa569ae2a)0
-rw-r--r--test/core/slice/percent_decode_corpus/xyz (renamed from test/core/support/percent_decode_corpus/xyz)0
-rw-r--r--test/core/slice/percent_decode_fuzzer.c (renamed from test/core/support/percent_decode_fuzzer.c)12
-rw-r--r--test/core/slice/percent_encode_corpus/0d3ee7fa54e6c66103965fd4409b044ba7db6c3f (renamed from test/core/support/percent_encode_corpus/0d3ee7fa54e6c66103965fd4409b044ba7db6c3f)0
-rw-r--r--test/core/slice/percent_encode_corpus/2e7ccf75e27b9501e3b28cf1c50ed0c45ab7c226 (renamed from test/core/support/percent_encode_corpus/2e7ccf75e27b9501e3b28cf1c50ed0c45ab7c226)0
-rw-r--r--test/core/slice/percent_encode_corpus/55bb859f3942c462b03b7cbcf22ab4a0ac9705cf (renamed from test/core/support/percent_encode_corpus/55bb859f3942c462b03b7cbcf22ab4a0ac9705cf)0
-rw-r--r--test/core/slice/percent_encode_corpus/56070cecd54c845b6d4334953b17b712eb000d93 (renamed from test/core/support/percent_encode_corpus/56070cecd54c845b6d4334953b17b712eb000d93)0
-rw-r--r--test/core/slice/percent_encode_corpus/61f50e891bf7ff5eb7a7af206f1e25d77f8756e7 (renamed from test/core/support/percent_encode_corpus/61f50e891bf7ff5eb7a7af206f1e25d77f8756e7)0
-rw-r--r--test/core/slice/percent_encode_corpus/6e0c60cefc704c7940e475a87dd9ae423061cb5a (renamed from test/core/support/percent_encode_corpus/6e0c60cefc704c7940e475a87dd9ae423061cb5a)0
-rw-r--r--test/core/slice/percent_encode_corpus/7271ebcc6d22a0f186f7bc3c1973a7ed1bec8d8e (renamed from test/core/support/percent_encode_corpus/7271ebcc6d22a0f186f7bc3c1973a7ed1bec8d8e)0
-rw-r--r--test/core/slice/percent_encode_corpus/74c83ece3e2920a67593a9be9c82468f16cbb969 (renamed from test/core/support/percent_encode_corpus/74c83ece3e2920a67593a9be9c82468f16cbb969)0
-rw-r--r--test/core/slice/percent_encode_corpus/98e004fd2a9f141a7a019720820080e12d637c06 (renamed from test/core/support/percent_encode_corpus/98e004fd2a9f141a7a019720820080e12d637c06)0
-rw-r--r--test/core/slice/percent_encode_corpus/ba2c1e98227aa21ea3bb2ca4d0e504119717da8b (renamed from test/core/support/percent_encode_corpus/ba2c1e98227aa21ea3bb2ca4d0e504119717da8b)0
-rw-r--r--test/core/slice/percent_encode_corpus/c16b9fd45370d4afb5d3ebd307a6e263c25ffd45 (renamed from test/core/support/percent_encode_corpus/c16b9fd45370d4afb5d3ebd307a6e263c25ffd45)0
-rw-r--r--test/core/slice/percent_encode_corpus/d58c3cd4eab9b6d2343abfa1c25c90a383fe0ec3 (renamed from test/core/support/percent_encode_corpus/d58c3cd4eab9b6d2343abfa1c25c90a383fe0ec3)0
-rw-r--r--test/core/slice/percent_encode_corpus/e2619218ede30d2b7b8ecd601a9f0ae754b728b4 (renamed from test/core/support/percent_encode_corpus/e2619218ede30d2b7b8ecd601a9f0ae754b728b4)0
-rw-r--r--test/core/slice/percent_encode_corpus/f93b3653e453f0e3eea3198001be6ce46e64bd21 (renamed from test/core/support/percent_encode_corpus/f93b3653e453f0e3eea3198001be6ce46e64bd21)0
-rw-r--r--test/core/slice/percent_encode_corpus/fd41d029c7682ad3d1c40a9fd017a4c85b673a54 (renamed from test/core/support/percent_encode_corpus/fd41d029c7682ad3d1c40a9fd017a4c85b673a54)0
-rw-r--r--test/core/slice/percent_encode_corpus/xyz (renamed from test/core/support/percent_encode_corpus/xyz)0
-rw-r--r--test/core/slice/percent_encode_fuzzer.c (renamed from test/core/support/percent_encode_fuzzer.c)20
-rw-r--r--test/core/slice/percent_encoding_test.c (renamed from test/core/support/percent_encoding_test.c)46
-rw-r--r--test/core/slice/slice_buffer_test.c (renamed from test/core/support/slice_buffer_test.c)62
-rw-r--r--test/core/slice/slice_string_helpers_test.c148
-rw-r--r--test/core/slice/slice_test.c (renamed from test/core/support/slice_test.c)78
-rw-r--r--test/core/support/string_test.c94
-rw-r--r--test/core/surface/byte_buffer_reader_test.c92
-rw-r--r--test/core/transport/chttp2/bin_decoder_test.c34
-rw-r--r--test/core/transport/chttp2/bin_encoder_test.c44
-rw-r--r--test/core/transport/chttp2/hpack_encoder_test.c22
-rw-r--r--test/core/transport/chttp2/hpack_parser_test.c12
-rw-r--r--test/core/transport/chttp2/hpack_table_test.c2
-rw-r--r--test/core/transport/chttp2/varint_test.c12
-rw-r--r--test/core/transport/metadata_test.c38
-rw-r--r--test/core/util/mock_endpoint.c24
-rw-r--r--test/core/util/mock_endpoint.h4
-rw-r--r--test/core/util/one_corpus_entry_fuzzer.c4
-rw-r--r--test/core/util/parse_hexstring.c6
-rw-r--r--test/core/util/parse_hexstring.h2
-rw-r--r--test/core/util/passthru_endpoint.c20
-rw-r--r--test/core/util/slice_splitter.c32
-rw-r--r--test/core/util/slice_splitter.h14
-rw-r--r--test/cpp/grpclb/grpclb_api_test.cc14
-rw-r--r--test/cpp/grpclb/grpclb_test.cc20
-rw-r--r--test/cpp/qps/client.h2
-rw-r--r--test/cpp/qps/server_async.cc2
-rw-r--r--test/cpp/util/byte_buffer_proto_helper.cc2
-rw-r--r--test/cpp/util/byte_buffer_test.cc22
-rw-r--r--test/cpp/util/cli_call.cc2
-rw-r--r--test/cpp/util/slice_test.cc12
-rw-r--r--tools/run_tests/sources_and_headers.json4
-rw-r--r--tools/run_tests/tests.json4
-rw-r--r--vsprojects/buildtests_c.sln4
-rw-r--r--vsprojects/vcxproj/test/gpr_slice_buffer_test/gpr_slice_buffer_test.vcxproj4
-rw-r--r--vsprojects/vcxproj/test/gpr_slice_test/gpr_slice_test.vcxproj4
264 files changed, 2112 insertions, 1971 deletions
diff --git a/Makefile b/Makefile
index 19032419a6..c208c0b471 100644
--- a/Makefile
+++ b/Makefile
@@ -945,8 +945,8 @@ gpr_host_port_test: $(BINDIR)/$(CONFIG)/gpr_host_port_test
gpr_log_test: $(BINDIR)/$(CONFIG)/gpr_log_test
gpr_mpscq_test: $(BINDIR)/$(CONFIG)/gpr_mpscq_test
gpr_percent_encoding_test: $(BINDIR)/$(CONFIG)/gpr_percent_encoding_test
-gpr_slice_buffer_test: $(BINDIR)/$(CONFIG)/gpr_slice_buffer_test
-gpr_slice_test: $(BINDIR)/$(CONFIG)/gpr_slice_test
+grpc_slice_buffer_test: $(BINDIR)/$(CONFIG)/grpc_slice_buffer_test
+grpc_slice_test: $(BINDIR)/$(CONFIG)/grpc_slice_test
gpr_stack_lockfree_test: $(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test
gpr_string_test: $(BINDIR)/$(CONFIG)/gpr_string_test
gpr_sync_test: $(BINDIR)/$(CONFIG)/gpr_sync_test
@@ -1279,8 +1279,8 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/gpr_log_test \
$(BINDIR)/$(CONFIG)/gpr_mpscq_test \
$(BINDIR)/$(CONFIG)/gpr_percent_encoding_test \
- $(BINDIR)/$(CONFIG)/gpr_slice_buffer_test \
- $(BINDIR)/$(CONFIG)/gpr_slice_test \
+ $(BINDIR)/$(CONFIG)/grpc_slice_buffer_test \
+ $(BINDIR)/$(CONFIG)/grpc_slice_test \
$(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test \
$(BINDIR)/$(CONFIG)/gpr_string_test \
$(BINDIR)/$(CONFIG)/gpr_sync_test \
@@ -1631,10 +1631,10 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/gpr_mpscq_test || ( echo test gpr_mpscq_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_percent_encoding_test"
$(Q) $(BINDIR)/$(CONFIG)/gpr_percent_encoding_test || ( echo test gpr_percent_encoding_test failed ; exit 1 )
- $(E) "[RUN] Testing gpr_slice_buffer_test"
- $(Q) $(BINDIR)/$(CONFIG)/gpr_slice_buffer_test || ( echo test gpr_slice_buffer_test failed ; exit 1 )
- $(E) "[RUN] Testing gpr_slice_test"
- $(Q) $(BINDIR)/$(CONFIG)/gpr_slice_test || ( echo test gpr_slice_test failed ; exit 1 )
+ $(E) "[RUN] Testing grpc_slice_buffer_test"
+ $(Q) $(BINDIR)/$(CONFIG)/grpc_slice_buffer_test || ( echo test grpc_slice_buffer_test failed ; exit 1 )
+ $(E) "[RUN] Testing grpc_slice_test"
+ $(Q) $(BINDIR)/$(CONFIG)/grpc_slice_test || ( echo test grpc_slice_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_stack_lockfree_test"
$(Q) $(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test || ( echo test gpr_stack_lockfree_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_string_test"
@@ -8288,22 +8288,22 @@ ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
-$(BINDIR)/$(CONFIG)/gpr_slice_buffer_test: openssl_dep_error
+$(BINDIR)/$(CONFIG)/grpc_slice_buffer_test: openssl_dep_error
else
-$(BINDIR)/$(CONFIG)/gpr_slice_buffer_test: $(GPR_SLICE_BUFFER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(BINDIR)/$(CONFIG)/grpc_slice_buffer_test: $(GPR_SLICE_BUFFER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LD) $(LDFLAGS) $(GPR_SLICE_BUFFER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gpr_slice_buffer_test
+ $(Q) $(LD) $(LDFLAGS) $(GPR_SLICE_BUFFER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/grpc_slice_buffer_test
endif
$(OBJDIR)/$(CONFIG)/test/core/support/slice_buffer_test.o: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-deps_gpr_slice_buffer_test: $(GPR_SLICE_BUFFER_TEST_OBJS:.o=.dep)
+deps_grpc_slice_buffer_test: $(GPR_SLICE_BUFFER_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
@@ -8320,22 +8320,22 @@ ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
-$(BINDIR)/$(CONFIG)/gpr_slice_test: openssl_dep_error
+$(BINDIR)/$(CONFIG)/grpc_slice_test: openssl_dep_error
else
-$(BINDIR)/$(CONFIG)/gpr_slice_test: $(GPR_SLICE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(BINDIR)/$(CONFIG)/grpc_slice_test: $(GPR_SLICE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LD) $(LDFLAGS) $(GPR_SLICE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gpr_slice_test
+ $(Q) $(LD) $(LDFLAGS) $(GPR_SLICE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/grpc_slice_test
endif
$(OBJDIR)/$(CONFIG)/test/core/support/slice_test.o: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-deps_gpr_slice_test: $(GPR_SLICE_TEST_OBJS:.o=.dep)
+deps_grpc_slice_test: $(GPR_SLICE_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
diff --git a/build.yaml b/build.yaml
index c12595205d..d7cd82b9d9 100644
--- a/build.yaml
+++ b/build.yaml
@@ -64,8 +64,6 @@ filegroups:
- include/grpc/support/log.h
- include/grpc/support/log_windows.h
- include/grpc/support/port_platform.h
- - include/grpc/support/slice.h
- - include/grpc/support/slice_buffer.h
- include/grpc/support/string_util.h
- include/grpc/support/subprocess.h
- include/grpc/support/sync.h
@@ -86,7 +84,6 @@ filegroups:
- src/core/lib/support/env.h
- src/core/lib/support/mpscq.h
- src/core/lib/support/murmur_hash.h
- - src/core/lib/support/percent_encoding.h
- src/core/lib/support/stack_lockfree.h
- src/core/lib/support/string.h
- src/core/lib/support/string_windows.h
@@ -116,9 +113,6 @@ filegroups:
- src/core/lib/support/log_windows.c
- src/core/lib/support/mpscq.c
- src/core/lib/support/murmur_hash.c
- - src/core/lib/support/percent_encoding.c
- - src/core/lib/support/slice.c
- - src/core/lib/support/slice_buffer.c
- src/core/lib/support/stack_lockfree.c
- src/core/lib/support/string.c
- src/core/lib/support/string_posix.c
@@ -165,6 +159,8 @@ filegroups:
- include/grpc/grpc_posix.h
- include/grpc/grpc_security_constants.h
- include/grpc/status.h
+ - include/grpc/slice.h
+ - include/grpc/slice_buffer.h
headers:
- src/core/lib/channel/channel_args.h
- src/core/lib/channel/channel_stack.h
@@ -191,6 +187,7 @@ filegroups:
- src/core/lib/iomgr/ev_epoll_linux.h
- src/core/lib/iomgr/ev_poll_and_epoll_posix.h
- src/core/lib/iomgr/ev_poll_posix.h
+ - src/core/lib/slice/percent_encoding.h
- src/core/lib/iomgr/ev_posix.h
- src/core/lib/iomgr/exec_ctx.h
- src/core/lib/iomgr/executor.h
@@ -204,6 +201,7 @@ filegroups:
- src/core/lib/iomgr/pollset.h
- src/core/lib/iomgr/pollset_set.h
- src/core/lib/iomgr/pollset_set_windows.h
+ - src/core/lib/slice/slice_string_helpers.h
- src/core/lib/iomgr/pollset_windows.h
- src/core/lib/iomgr/resolve_address.h
- src/core/lib/iomgr/resource_quota.h
@@ -257,6 +255,10 @@ filegroups:
- src/core/lib/channel/channel_stack.c
- src/core/lib/channel/channel_stack_builder.c
- src/core/lib/channel/compress_filter.c
+ - src/core/lib/slice/slice.c
+ - src/core/lib/slice/percent_encoding.c
+ - src/core/lib/slice/slice_buffer.c
+ - src/core/lib/slice/slice_string_helpers.c
- src/core/lib/channel/connected_channel.c
- src/core/lib/channel/deadline_filter.c
- src/core/lib/channel/handshaker.c
@@ -1748,19 +1750,19 @@ targets:
deps:
- gpr_test_util
- gpr
-- name: gpr_slice_buffer_test
+- name: slice_buffer_test
build: test
language: c
src:
- - test/core/support/slice_buffer_test.c
+ - test/core/slice/slice_buffer_test.c
deps:
- gpr_test_util
- gpr
-- name: gpr_slice_test
+- name: slice_test
build: test
language: c
src:
- - test/core/support/slice_test.c
+ - test/core/slice/slice_test.c
deps:
- gpr_test_util
- gpr
@@ -2313,27 +2315,27 @@ targets:
build: fuzzer
language: c
src:
- - test/core/support/percent_decode_fuzzer.c
+ - test/core/slice/percent_decode_fuzzer.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
corpus_dirs:
- - test/core/support/percent_decode_corpus
+ - test/core/slice/percent_decode_corpus
maxlen: 32
- name: percent_encode_fuzzer
build: fuzzer
language: c
src:
- - test/core/support/percent_encode_fuzzer.c
+ - test/core/slice/percent_encode_fuzzer.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
corpus_dirs:
- - test/core/support/percent_encode_corpus
+ - test/core/slice/percent_encode_corpus
maxlen: 32
- name: resolve_address_test
build: test
diff --git a/grpc.def b/grpc.def
index 0b6db801d8..e2d6ce9b43 100644
--- a/grpc.def
+++ b/grpc.def
@@ -183,35 +183,35 @@ EXPORTS
gpr_log_verbosity_init
gpr_set_log_function
gpr_format_message
- gpr_slice_ref
- gpr_slice_unref
- gpr_slice_new
- gpr_slice_new_with_user_data
- gpr_slice_new_with_len
- gpr_slice_malloc
- gpr_slice_from_copied_string
- gpr_slice_from_copied_buffer
- gpr_slice_from_static_string
- gpr_slice_sub
- gpr_slice_sub_no_ref
- gpr_slice_split_tail
- gpr_slice_split_head
+ grpc_slice_ref
+ grpc_slice_unref
+ grpc_slice_new
+ grpc_slice_new_with_user_data
+ grpc_slice_new_with_len
+ grpc_slice_malloc
+ grpc_slice_from_copied_string
+ grpc_slice_from_copied_buffer
+ grpc_slice_from_static_string
+ grpc_slice_sub
+ grpc_slice_sub_no_ref
+ grpc_slice_split_tail
+ grpc_slice_split_head
gpr_empty_slice
- gpr_slice_cmp
- gpr_slice_str_cmp
- gpr_slice_buffer_init
- gpr_slice_buffer_destroy
- gpr_slice_buffer_add
- gpr_slice_buffer_add_indexed
- gpr_slice_buffer_addn
- gpr_slice_buffer_tiny_add
- gpr_slice_buffer_pop
- gpr_slice_buffer_reset_and_unref
- gpr_slice_buffer_swap
- gpr_slice_buffer_move_into
- gpr_slice_buffer_trim_end
- gpr_slice_buffer_move_first
- gpr_slice_buffer_take_first
+ grpc_slice_cmp
+ grpc_slice_str_cmp
+ grpc_slice_buffer_init
+ grpc_slice_buffer_destroy
+ grpc_slice_buffer_add
+ grpc_slice_buffer_add_indexed
+ grpc_slice_buffer_addn
+ grpc_slice_buffer_tiny_add
+ grpc_slice_buffer_pop
+ grpc_slice_buffer_reset_and_unref
+ grpc_slice_buffer_swap
+ grpc_slice_buffer_move_into
+ grpc_slice_buffer_trim_end
+ grpc_slice_buffer_move_first
+ grpc_slice_buffer_take_first
gpr_strdup
gpr_asprintf
gpr_subprocess_binary_extension
diff --git a/include/grpc++/impl/codegen/core_codegen.h b/include/grpc++/impl/codegen/core_codegen.h
index 0ce009e69d..c2127a771a 100644
--- a/include/grpc++/impl/codegen/core_codegen.h
+++ b/include/grpc++/impl/codegen/core_codegen.h
@@ -73,17 +73,17 @@ class CoreCodegen : public CoreCodegenInterface {
void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader* reader)
GRPC_OVERRIDE;
int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader* reader,
- gpr_slice* slice) GRPC_OVERRIDE;
+ grpc_slice* slice) GRPC_OVERRIDE;
- grpc_byte_buffer* grpc_raw_byte_buffer_create(gpr_slice* slice,
+ grpc_byte_buffer* grpc_raw_byte_buffer_create(grpc_slice* slice,
size_t nslices) GRPC_OVERRIDE;
- gpr_slice gpr_slice_malloc(size_t length) GRPC_OVERRIDE;
- void gpr_slice_unref(gpr_slice slice) GRPC_OVERRIDE;
- gpr_slice gpr_slice_split_tail(gpr_slice* s, size_t split) GRPC_OVERRIDE;
- void gpr_slice_buffer_add(gpr_slice_buffer* sb,
- gpr_slice slice) GRPC_OVERRIDE;
- void gpr_slice_buffer_pop(gpr_slice_buffer* sb) GRPC_OVERRIDE;
+ grpc_slice grpc_slice_malloc(size_t length) GRPC_OVERRIDE;
+ void grpc_slice_unref(grpc_slice slice) GRPC_OVERRIDE;
+ grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) GRPC_OVERRIDE;
+ void grpc_slice_buffer_add(grpc_slice_buffer* sb,
+ grpc_slice slice) GRPC_OVERRIDE;
+ void grpc_slice_buffer_pop(grpc_slice_buffer* sb) GRPC_OVERRIDE;
void grpc_metadata_array_init(grpc_metadata_array* array) GRPC_OVERRIDE;
void grpc_metadata_array_destroy(grpc_metadata_array* array) GRPC_OVERRIDE;
diff --git a/include/grpc++/impl/codegen/core_codegen_interface.h b/include/grpc++/impl/codegen/core_codegen_interface.h
index 68851f15c6..743f528373 100644
--- a/include/grpc++/impl/codegen/core_codegen_interface.h
+++ b/include/grpc++/impl/codegen/core_codegen_interface.h
@@ -88,16 +88,16 @@ class CoreCodegenInterface {
virtual void grpc_byte_buffer_reader_destroy(
grpc_byte_buffer_reader* reader) = 0;
virtual int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader* reader,
- gpr_slice* slice) = 0;
+ grpc_slice* slice) = 0;
- virtual grpc_byte_buffer* grpc_raw_byte_buffer_create(gpr_slice* slice,
+ virtual grpc_byte_buffer* grpc_raw_byte_buffer_create(grpc_slice* slice,
size_t nslices) = 0;
- virtual gpr_slice gpr_slice_malloc(size_t length) = 0;
- virtual void gpr_slice_unref(gpr_slice slice) = 0;
- virtual gpr_slice gpr_slice_split_tail(gpr_slice* s, size_t split) = 0;
- virtual void gpr_slice_buffer_add(gpr_slice_buffer* sb, gpr_slice slice) = 0;
- virtual void gpr_slice_buffer_pop(gpr_slice_buffer* sb) = 0;
+ virtual grpc_slice grpc_slice_malloc(size_t length) = 0;
+ virtual void grpc_slice_unref(grpc_slice slice) = 0;
+ virtual grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) = 0;
+ virtual void grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice slice) = 0;
+ virtual void grpc_slice_buffer_pop(grpc_slice_buffer* sb) = 0;
virtual void grpc_metadata_array_init(grpc_metadata_array* array) = 0;
virtual void grpc_metadata_array_destroy(grpc_metadata_array* array) = 0;
diff --git a/include/grpc++/impl/codegen/proto_utils.h b/include/grpc++/impl/codegen/proto_utils.h
index 6f4786b87b..4885ea0ee7 100644
--- a/include/grpc++/impl/codegen/proto_utils.h
+++ b/include/grpc++/impl/codegen/proto_utils.h
@@ -63,7 +63,7 @@ class GrpcBufferWriter GRPC_FINAL
~GrpcBufferWriter() GRPC_OVERRIDE {
if (have_backup_) {
- g_core_codegen_interface->gpr_slice_unref(backup_slice_);
+ g_core_codegen_interface->grpc_slice_unref(backup_slice_);
}
}
@@ -72,24 +72,24 @@ class GrpcBufferWriter GRPC_FINAL
slice_ = backup_slice_;
have_backup_ = false;
} else {
- slice_ = g_core_codegen_interface->gpr_slice_malloc(block_size_);
+ slice_ = g_core_codegen_interface->grpc_slice_malloc(block_size_);
}
*data = GPR_SLICE_START_PTR(slice_);
// On win x64, int is only 32bit
GPR_CODEGEN_ASSERT(GPR_SLICE_LENGTH(slice_) <= INT_MAX);
byte_count_ += * size = (int)GPR_SLICE_LENGTH(slice_);
- g_core_codegen_interface->gpr_slice_buffer_add(slice_buffer_, slice_);
+ g_core_codegen_interface->grpc_slice_buffer_add(slice_buffer_, slice_);
return true;
}
void BackUp(int count) GRPC_OVERRIDE {
- g_core_codegen_interface->gpr_slice_buffer_pop(slice_buffer_);
+ g_core_codegen_interface->grpc_slice_buffer_pop(slice_buffer_);
if (count == block_size_) {
backup_slice_ = slice_;
} else {
- backup_slice_ = g_core_codegen_interface->gpr_slice_split_tail(
+ backup_slice_ = g_core_codegen_interface->grpc_slice_split_tail(
&slice_, GPR_SLICE_LENGTH(slice_) - count);
- g_core_codegen_interface->gpr_slice_buffer_add(slice_buffer_, slice_);
+ g_core_codegen_interface->grpc_slice_buffer_add(slice_buffer_, slice_);
}
have_backup_ = true;
byte_count_ -= count;
@@ -100,10 +100,10 @@ class GrpcBufferWriter GRPC_FINAL
private:
const int block_size_;
int64_t byte_count_;
- gpr_slice_buffer* slice_buffer_;
+ grpc_slice_buffer* slice_buffer_;
bool have_backup_;
- gpr_slice backup_slice_;
- gpr_slice slice_;
+ grpc_slice backup_slice_;
+ grpc_slice slice_;
};
class GrpcBufferReader GRPC_FINAL
@@ -137,7 +137,7 @@ class GrpcBufferReader GRPC_FINAL
&slice_)) {
return false;
}
- g_core_codegen_interface->gpr_slice_unref(slice_);
+ g_core_codegen_interface->grpc_slice_unref(slice_);
*data = GPR_SLICE_START_PTR(slice_);
// On win x64, int is only 32bit
GPR_CODEGEN_ASSERT(GPR_SLICE_LENGTH(slice_) <= INT_MAX);
@@ -172,7 +172,7 @@ class GrpcBufferReader GRPC_FINAL
int64_t byte_count_;
int64_t backup_count_;
grpc_byte_buffer_reader reader_;
- gpr_slice slice_;
+ grpc_slice slice_;
Status status_;
};
} // namespace internal
@@ -186,12 +186,12 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of<
*own_buffer = true;
int byte_size = msg.ByteSize();
if (byte_size <= internal::kGrpcBufferWriterMaxBufferLength) {
- gpr_slice slice = g_core_codegen_interface->gpr_slice_malloc(byte_size);
+ grpc_slice slice = g_core_codegen_interface->grpc_slice_malloc(byte_size);
GPR_CODEGEN_ASSERT(
GPR_SLICE_END_PTR(slice) ==
msg.SerializeWithCachedSizesToArray(GPR_SLICE_START_PTR(slice)));
*bp = g_core_codegen_interface->grpc_raw_byte_buffer_create(&slice, 1);
- g_core_codegen_interface->gpr_slice_unref(slice);
+ g_core_codegen_interface->grpc_slice_unref(slice);
return g_core_codegen_interface->ok();
} else {
internal::GrpcBufferWriter writer(
diff --git a/include/grpc++/impl/codegen/thrift_serializer.h b/include/grpc++/impl/codegen/thrift_serializer.h
index fd324a994f..691ce1af48 100644
--- a/include/grpc++/impl/codegen/thrift_serializer.h
+++ b/include/grpc++/impl/codegen/thrift_serializer.h
@@ -109,12 +109,12 @@ class ThriftSerializer {
Serialize(fields, &byte_buffer, &byte_buffer_size);
- gpr_slice slice = gpr_slice_from_copied_buffer(
+ grpc_slice slice = grpc_slice_from_copied_buffer(
reinterpret_cast<const char*>(byte_buffer), byte_buffer_size);
*bp = grpc_raw_byte_buffer_create(&slice, 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
// Deserialize the passed char array into the passed type, returns the number
@@ -156,12 +156,12 @@ class ThriftSerializer {
grpc_byte_buffer_reader reader;
grpc_byte_buffer_reader_init(&reader, buffer);
- gpr_slice slice = grpc_byte_buffer_reader_readall(&reader);
+ grpc_slice slice = grpc_byte_buffer_reader_readall(&reader);
uint32_t len =
Deserialize(GPR_SLICE_START_PTR(slice), GPR_SLICE_LENGTH(slice), msg);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
grpc_byte_buffer_reader_destroy(&reader);
diff --git a/include/grpc++/support/slice.h b/include/grpc++/support/slice.h
index 5874b4f5ae..b06b1b69e5 100644
--- a/include/grpc++/support/slice.h
+++ b/include/grpc++/support/slice.h
@@ -39,7 +39,7 @@
namespace grpc {
-/// A wrapper around \a gpr_slice.
+/// A wrapper around \a grpc_slice.
///
/// A slice represents a contiguous reference counted array of bytes.
/// It is cheap to take references to a slice, and it is cheap to create a
@@ -53,11 +53,11 @@ class Slice GRPC_FINAL {
enum AddRef { ADD_REF };
/// Construct a slice from \a slice, adding a reference.
- Slice(gpr_slice slice, AddRef);
+ Slice(grpc_slice slice, AddRef);
enum StealRef { STEAL_REF };
/// Construct a slice from \a slice, stealing a reference.
- Slice(gpr_slice slice, StealRef);
+ Slice(grpc_slice slice, StealRef);
/// Copy constructor, adds a reference.
Slice(const Slice& other);
@@ -77,13 +77,13 @@ class Slice GRPC_FINAL {
/// Raw pointer to the end (one byte \em past the last element) of the slice.
const uint8_t* end() const { return GPR_SLICE_END_PTR(slice_); }
- /// Raw C slice. Caller needs to call gpr_slice_unref when done.
- gpr_slice c_slice() const { return gpr_slice_ref(slice_); }
+ /// Raw C slice. Caller needs to call grpc_slice_unref when done.
+ grpc_slice c_slice() const { return grpc_slice_ref(slice_); }
private:
friend class ByteBuffer;
- gpr_slice slice_;
+ grpc_slice slice_;
};
} // namespace grpc
diff --git a/include/grpc/byte_buffer.h b/include/grpc/byte_buffer.h
index f25c1d51d6..3cf31df0df 100644
--- a/include/grpc/byte_buffer.h
+++ b/include/grpc/byte_buffer.h
@@ -45,7 +45,7 @@ extern "C" {
*
* Increases the reference count for all \a slices processed. The user is
* responsible for invoking grpc_byte_buffer_destroy on the returned instance.*/
-GRPCAPI grpc_byte_buffer *grpc_raw_byte_buffer_create(gpr_slice *slices,
+GRPCAPI grpc_byte_buffer *grpc_raw_byte_buffer_create(grpc_slice *slices,
size_t nslices);
/** Returns a *compressed* RAW byte buffer instance over the given slices (up to
@@ -55,7 +55,7 @@ GRPCAPI grpc_byte_buffer *grpc_raw_byte_buffer_create(gpr_slice *slices,
* Increases the reference count for all \a slices processed. The user is
* responsible for invoking grpc_byte_buffer_destroy on the returned instance.*/
GRPCAPI grpc_byte_buffer *grpc_raw_compressed_byte_buffer_create(
- gpr_slice *slices, size_t nslices, grpc_compression_algorithm compression);
+ grpc_slice *slices, size_t nslices, grpc_compression_algorithm compression);
/** Copies input byte buffer \a bb.
*
@@ -83,12 +83,12 @@ GRPCAPI void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader);
/** Updates \a slice with the next piece of data from from \a reader and returns
* 1. Returns 0 at the end of the stream. Caller is responsible for calling
- * gpr_slice_unref on the result. */
+ * grpc_slice_unref on the result. */
GRPCAPI int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
- gpr_slice *slice);
+ grpc_slice *slice);
/** Merge all data from \a reader into single slice */
-GRPCAPI gpr_slice
+GRPCAPI grpc_slice
grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader *reader);
/** Returns a RAW byte buffer instance from the output of \a reader. */
diff --git a/include/grpc/impl/codegen/gpr_types.h b/include/grpc/impl/codegen/gpr_types.h
index c8f0815f0b..ed9976f429 100644
--- a/include/grpc/impl/codegen/gpr_types.h
+++ b/include/grpc/impl/codegen/gpr_types.h
@@ -68,71 +68,6 @@ typedef struct gpr_timespec {
gpr_clock_type clock_type;
} gpr_timespec;
-/* Slice API
-
- A slice represents a contiguous reference counted array of bytes.
- It is cheap to take references to a slice, and it is cheap to create a
- slice pointing to a subset of another slice.
-
- The data-structure for slices is exposed here to allow non-gpr code to
- build slices from whatever data they have available.
-
- When defining interfaces that handle slices, care should be taken to define
- reference ownership semantics (who should call unref?) and mutability
- constraints (is the callee allowed to modify the slice?) */
-
-/* Reference count container for gpr_slice. Contains function pointers to
- increment and decrement reference counts. Implementations should cleanup
- when the reference count drops to zero.
- Typically client code should not touch this, and use gpr_slice_malloc,
- gpr_slice_new, or gpr_slice_new_with_len instead. */
-typedef struct gpr_slice_refcount {
- void (*ref)(void *);
- void (*unref)(void *);
-} gpr_slice_refcount;
-
-#define GPR_SLICE_INLINED_SIZE (sizeof(size_t) + sizeof(uint8_t *) - 1)
-
-/* A gpr_slice s, if initialized, represents the byte range
- s.bytes[0..s.length-1].
-
- It can have an associated ref count which has a destruction routine to be run
- when the ref count reaches zero (see gpr_slice_new() and grp_slice_unref()).
- Multiple gpr_slice values may share a ref count.
-
- If the slice does not have a refcount, it represents an inlined small piece
- of data that is copied by value. */
-typedef struct gpr_slice {
- struct gpr_slice_refcount *refcount;
- union {
- struct {
- uint8_t *bytes;
- size_t length;
- } refcounted;
- struct {
- uint8_t length;
- uint8_t bytes[GPR_SLICE_INLINED_SIZE];
- } inlined;
- } data;
-} gpr_slice;
-
-#define GRPC_SLICE_BUFFER_INLINE_ELEMENTS 8
-
-/* Represents an expandable array of slices, to be interpreted as a
- single item. */
-typedef struct {
- /* slices in the array */
- gpr_slice *slices;
- /* the number of slices in the array */
- size_t count;
- /* the number of slices allocated in the array */
- size_t capacity;
- /* the combined length of all slices in the array */
- size_t length;
- /* inlined elements to avoid allocations */
- gpr_slice inlined[GRPC_SLICE_BUFFER_INLINE_ELEMENTS];
-} gpr_slice_buffer;
-
#ifdef __cplusplus
}
#endif
diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h
index d2dce0d511..cbd484ba33 100644
--- a/include/grpc/impl/codegen/grpc_types.h
+++ b/include/grpc/impl/codegen/grpc_types.h
@@ -35,6 +35,7 @@
#define GRPC_IMPL_CODEGEN_GRPC_TYPES_H
#include <grpc/impl/codegen/gpr_types.h>
+#include <grpc/impl/codegen/slice.h>
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/status.h>
@@ -60,7 +61,7 @@ typedef struct grpc_byte_buffer {
} reserved;
struct {
grpc_compression_algorithm compression;
- gpr_slice_buffer slice_buffer;
+ grpc_slice_buffer slice_buffer;
} raw;
} data;
} grpc_byte_buffer;
diff --git a/include/grpc/impl/codegen/slice.h b/include/grpc/impl/codegen/slice.h
index a2637eea62..79297ce23d 100644
--- a/include/grpc/impl/codegen/slice.h
+++ b/include/grpc/impl/codegen/slice.h
@@ -35,6 +35,72 @@
#define GRPC_IMPL_CODEGEN_SLICE_H
#include <stddef.h>
+#include <stdint.h>
+
+/* Slice API
+
+ A slice represents a contiguous reference counted array of bytes.
+ It is cheap to take references to a slice, and it is cheap to create a
+ slice pointing to a subset of another slice.
+
+ The data-structure for slices is exposed here to allow non-gpr code to
+ build slices from whatever data they have available.
+
+ When defining interfaces that handle slices, care should be taken to define
+ reference ownership semantics (who should call unref?) and mutability
+ constraints (is the callee allowed to modify the slice?) */
+
+/* Reference count container for grpc_slice. Contains function pointers to
+ increment and decrement reference counts. Implementations should cleanup
+ when the reference count drops to zero.
+ Typically client code should not touch this, and use grpc_slice_malloc,
+ grpc_slice_new, or grpc_slice_new_with_len instead. */
+typedef struct grpc_slice_refcount {
+ void (*ref)(void *);
+ void (*unref)(void *);
+} grpc_slice_refcount;
+
+#define GPR_SLICE_INLINED_SIZE (sizeof(size_t) + sizeof(uint8_t *) - 1)
+
+/* A grpc_slice s, if initialized, represents the byte range
+ s.bytes[0..s.length-1].
+
+ It can have an associated ref count which has a destruction routine to be run
+ when the ref count reaches zero (see grpc_slice_new() and grp_slice_unref()).
+ Multiple grpc_slice values may share a ref count.
+
+ If the slice does not have a refcount, it represents an inlined small piece
+ of data that is copied by value. */
+typedef struct grpc_slice {
+ struct grpc_slice_refcount *refcount;
+ union {
+ struct {
+ uint8_t *bytes;
+ size_t length;
+ } refcounted;
+ struct {
+ uint8_t length;
+ uint8_t bytes[GPR_SLICE_INLINED_SIZE];
+ } inlined;
+ } data;
+} grpc_slice;
+
+#define GRPC_SLICE_BUFFER_INLINE_ELEMENTS 8
+
+/* Represents an expandable array of slices, to be interpreted as a
+ single item. */
+typedef struct {
+ /* slices in the array */
+ grpc_slice *slices;
+ /* the number of slices in the array */
+ size_t count;
+ /* the number of slices allocated in the array */
+ size_t capacity;
+ /* the combined length of all slices in the array */
+ size_t length;
+ /* inlined elements to avoid allocations */
+ grpc_slice inlined[GRPC_SLICE_BUFFER_INLINE_ELEMENTS];
+} grpc_slice_buffer;
#define GPR_SLICE_START_PTR(slice) \
((slice).refcount ? (slice).data.refcounted.bytes \
diff --git a/include/grpc/support/slice.h b/include/grpc/slice.h
index b31fe6c0c5..5953e0ccb7 100644
--- a/include/grpc/support/slice.h
+++ b/include/grpc/slice.h
@@ -43,83 +43,83 @@ extern "C" {
/* Increment the refcount of s. Requires slice is initialized.
Returns s. */
-GPRAPI gpr_slice gpr_slice_ref(gpr_slice s);
+GPRAPI grpc_slice grpc_slice_ref(grpc_slice s);
/* Decrement the ref count of s. If the ref count of s reaches zero, all
slices sharing the ref count are destroyed, and considered no longer
- initialized. If s is ultimately derived from a call to gpr_slice_new(start,
+ initialized. If s is ultimately derived from a call to grpc_slice_new(start,
len, dest) where dest!=NULL , then (*dest)(start) is called, else if s is
- ultimately derived from a call to gpr_slice_new_with_len(start, len, dest)
+ ultimately derived from a call to grpc_slice_new_with_len(start, len, dest)
where dest!=NULL , then (*dest)(start, len). Requires s initialized. */
-GPRAPI void gpr_slice_unref(gpr_slice s);
+GPRAPI void grpc_slice_unref(grpc_slice s);
/* Create a slice pointing at some data. Calls malloc to allocate a refcount
for the object, and arranges that destroy will be called with the pointer
passed in at destruction. */
-GPRAPI gpr_slice gpr_slice_new(void *p, size_t len, void (*destroy)(void *));
+GPRAPI grpc_slice grpc_slice_new(void *p, size_t len, void (*destroy)(void *));
-/* Equivalent to gpr_slice_new, but with a separate pointer that is
+/* Equivalent to grpc_slice_new, but with a separate pointer that is
passed to the destroy function. This function can be useful when
the data is part of a larger structure that must be destroyed when
the data is no longer needed. */
-GPRAPI gpr_slice gpr_slice_new_with_user_data(void *p, size_t len,
- void (*destroy)(void *),
- void *user_data);
+GPRAPI grpc_slice grpc_slice_new_with_user_data(void *p, size_t len,
+ void (*destroy)(void *),
+ void *user_data);
-/* Equivalent to gpr_slice_new, but with a two argument destroy function that
+/* Equivalent to grpc_slice_new, but with a two argument destroy function that
also takes the slice length. */
-GPRAPI gpr_slice gpr_slice_new_with_len(void *p, size_t len,
- void (*destroy)(void *, size_t));
+GPRAPI grpc_slice grpc_slice_new_with_len(void *p, size_t len,
+ void (*destroy)(void *, size_t));
-/* Equivalent to gpr_slice_new(malloc(len), len, free), but saves one malloc()
+/* Equivalent to grpc_slice_new(malloc(len), len, free), but saves one malloc()
call.
Aborts if malloc() fails. */
-GPRAPI gpr_slice gpr_slice_malloc(size_t length);
+GPRAPI grpc_slice grpc_slice_malloc(size_t length);
/* Create a slice by copying a string.
Does not preserve null terminators.
Equivalent to:
size_t len = strlen(source);
- gpr_slice slice = gpr_slice_malloc(len);
+ grpc_slice slice = grpc_slice_malloc(len);
memcpy(slice->data, source, len); */
-GPRAPI gpr_slice gpr_slice_from_copied_string(const char *source);
+GPRAPI grpc_slice grpc_slice_from_copied_string(const char *source);
/* Create a slice by copying a buffer.
Equivalent to:
- gpr_slice slice = gpr_slice_malloc(len);
+ grpc_slice slice = grpc_slice_malloc(len);
memcpy(slice->data, source, len); */
-GPRAPI gpr_slice gpr_slice_from_copied_buffer(const char *source, size_t len);
+GPRAPI grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t len);
/* Create a slice pointing to constant memory */
-GPRAPI gpr_slice gpr_slice_from_static_string(const char *source);
+GPRAPI grpc_slice grpc_slice_from_static_string(const char *source);
/* Return a result slice derived from s, which shares a ref count with s, where
result.data==s.data+begin, and result.length==end-begin.
The ref count of s is increased by one.
Requires s initialized, begin <= end, begin <= s.length, and
end <= source->length. */
-GPRAPI gpr_slice gpr_slice_sub(gpr_slice s, size_t begin, size_t end);
+GPRAPI grpc_slice grpc_slice_sub(grpc_slice s, size_t begin, size_t end);
-/* The same as gpr_slice_sub, but without altering the ref count */
-GPRAPI gpr_slice gpr_slice_sub_no_ref(gpr_slice s, size_t begin, size_t end);
+/* The same as grpc_slice_sub, but without altering the ref count */
+GPRAPI grpc_slice grpc_slice_sub_no_ref(grpc_slice s, size_t begin, size_t end);
/* Splits s into two: modifies s to be s[0:split], and returns a new slice,
sharing a refcount with s, that contains s[split:s.length].
Requires s intialized, split <= s.length */
-GPRAPI gpr_slice gpr_slice_split_tail(gpr_slice *s, size_t split);
+GPRAPI grpc_slice grpc_slice_split_tail(grpc_slice *s, size_t split);
/* Splits s into two: modifies s to be s[split:s.length], and returns a new
slice, sharing a refcount with s, that contains s[0:split].
Requires s intialized, split <= s.length */
-GPRAPI gpr_slice gpr_slice_split_head(gpr_slice *s, size_t split);
+GPRAPI grpc_slice grpc_slice_split_head(grpc_slice *s, size_t split);
-GPRAPI gpr_slice gpr_empty_slice(void);
+GPRAPI grpc_slice gpr_empty_slice(void);
/* Returns <0 if a < b, ==0 if a == b, >0 if a > b
The order is arbitrary, and is not guaranteed to be stable across different
versions of the API. */
-GPRAPI int gpr_slice_cmp(gpr_slice a, gpr_slice b);
-GPRAPI int gpr_slice_str_cmp(gpr_slice a, const char *b);
+GPRAPI int grpc_slice_cmp(grpc_slice a, grpc_slice b);
+GPRAPI int grpc_slice_str_cmp(grpc_slice a, const char *b);
#ifdef __cplusplus
}
diff --git a/include/grpc/support/slice_buffer.h b/include/grpc/slice_buffer.h
index 3920432b02..bff0d76914 100644
--- a/include/grpc/support/slice_buffer.h
+++ b/include/grpc/slice_buffer.h
@@ -41,13 +41,13 @@ extern "C" {
#endif
/* initialize a slice buffer */
-GPRAPI void gpr_slice_buffer_init(gpr_slice_buffer *sb);
+GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer *sb);
/* destroy a slice buffer - unrefs any held elements */
-GPRAPI void gpr_slice_buffer_destroy(gpr_slice_buffer *sb);
+GPRAPI void grpc_slice_buffer_destroy(grpc_slice_buffer *sb);
/* Add an element to a slice buffer - takes ownership of the slice.
This function is allowed to concatenate the passed in slice to the end of
some other slice if desired by the slice buffer. */
-GPRAPI void gpr_slice_buffer_add(gpr_slice_buffer *sb, gpr_slice slice);
+GPRAPI void grpc_slice_buffer_add(grpc_slice_buffer *sb, grpc_slice slice);
/* add an element to a slice buffer - takes ownership of the slice and returns
the index of the slice.
Guarantees that the slice will not be concatenated at the end of another
@@ -55,30 +55,30 @@ GPRAPI void gpr_slice_buffer_add(gpr_slice_buffer *sb, gpr_slice slice);
slice at the returned index in sb->slices)
The implementation MAY decide to concatenate data at the end of a small
slice added in this fashion. */
-GPRAPI size_t gpr_slice_buffer_add_indexed(gpr_slice_buffer *sb,
- gpr_slice slice);
-GPRAPI void gpr_slice_buffer_addn(gpr_slice_buffer *sb, gpr_slice *slices,
+GPRAPI size_t grpc_slice_buffer_add_indexed(grpc_slice_buffer *sb,
+ grpc_slice slice);
+GPRAPI void grpc_slice_buffer_addn(grpc_slice_buffer *sb, grpc_slice *slices,
size_t n);
/* add a very small (less than 8 bytes) amount of data to the end of a slice
buffer: returns a pointer into which to add the data */
-GPRAPI uint8_t *gpr_slice_buffer_tiny_add(gpr_slice_buffer *sb, size_t len);
+GPRAPI uint8_t *grpc_slice_buffer_tiny_add(grpc_slice_buffer *sb, size_t len);
/* pop the last buffer, but don't unref it */
-GPRAPI void gpr_slice_buffer_pop(gpr_slice_buffer *sb);
+GPRAPI void grpc_slice_buffer_pop(grpc_slice_buffer *sb);
/* clear a slice buffer, unref all elements */
-GPRAPI void gpr_slice_buffer_reset_and_unref(gpr_slice_buffer *sb);
+GPRAPI void grpc_slice_buffer_reset_and_unref(grpc_slice_buffer *sb);
/* swap the contents of two slice buffers */
-GPRAPI void gpr_slice_buffer_swap(gpr_slice_buffer *a, gpr_slice_buffer *b);
+GPRAPI void grpc_slice_buffer_swap(grpc_slice_buffer *a, grpc_slice_buffer *b);
/* move all of the elements of src into dst */
-GPRAPI void gpr_slice_buffer_move_into(gpr_slice_buffer *src,
- gpr_slice_buffer *dst);
+GPRAPI void grpc_slice_buffer_move_into(grpc_slice_buffer *src,
+ grpc_slice_buffer *dst);
/* remove n bytes from the end of a slice buffer */
-GPRAPI void gpr_slice_buffer_trim_end(gpr_slice_buffer *src, size_t n,
- gpr_slice_buffer *garbage);
+GPRAPI void grpc_slice_buffer_trim_end(grpc_slice_buffer *src, size_t n,
+ grpc_slice_buffer *garbage);
/* move the first n bytes of src into dst */
-GPRAPI void gpr_slice_buffer_move_first(gpr_slice_buffer *src, size_t n,
- gpr_slice_buffer *dst);
+GPRAPI void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n,
+ grpc_slice_buffer *dst);
/* take the first slice in the slice buffer */
-GPRAPI gpr_slice gpr_slice_buffer_take_first(gpr_slice_buffer *src);
+GPRAPI grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer *src);
#ifdef __cplusplus
}
diff --git a/src/core/ext/client_channel/connector.h b/src/core/ext/client_channel/connector.h
index e08244b2c0..3c2cf7877f 100644
--- a/src/core/ext/client_channel/connector.h
+++ b/src/core/ext/client_channel/connector.h
@@ -52,7 +52,7 @@ typedef struct {
const struct sockaddr *addr;
size_t addr_len;
/** initial connect string to send */
- gpr_slice initial_connect_string;
+ grpc_slice initial_connect_string;
/** deadline for connection */
gpr_timespec deadline;
/** channel arguments (to be passed to transport) */
diff --git a/src/core/ext/client_channel/default_initial_connect_string.c b/src/core/ext/client_channel/default_initial_connect_string.c
index a70da4a84a..784173f0e2 100644
--- a/src/core/ext/client_channel/default_initial_connect_string.c
+++ b/src/core/ext/client_channel/default_initial_connect_string.c
@@ -36,4 +36,4 @@
void grpc_set_default_initial_connect_string(struct sockaddr **addr,
size_t *addr_len,
- gpr_slice *initial_str) {}
+ grpc_slice *initial_str) {}
diff --git a/src/core/ext/client_channel/http_connect_handshaker.c b/src/core/ext/client_channel/http_connect_handshaker.c
index ea2cbbdd97..9c175af09a 100644
--- a/src/core/ext/client_channel/http_connect_handshaker.c
+++ b/src/core/ext/client_channel/http_connect_handshaker.c
@@ -60,8 +60,8 @@ typedef struct http_connect_handshaker {
void* user_data;
// Objects for processing the HTTP CONNECT request and response.
- gpr_slice_buffer write_buffer;
- gpr_slice_buffer* read_buffer; // Ownership passes through this object.
+ grpc_slice_buffer write_buffer;
+ grpc_slice_buffer* read_buffer; // Ownership passes through this object.
grpc_closure request_done_closure;
grpc_closure response_read_closure;
grpc_http_parser http_parser;
@@ -76,7 +76,7 @@ static void http_connect_handshaker_unref(http_connect_handshaker* handshaker) {
if (gpr_unref(&handshaker->refcount)) {
gpr_free(handshaker->proxy_server);
gpr_free(handshaker->server_name);
- gpr_slice_buffer_destroy(&handshaker->write_buffer);
+ grpc_slice_buffer_destroy(&handshaker->write_buffer);
grpc_http_parser_destroy(&handshaker->http_parser);
grpc_http_response_destroy(&handshaker->http_response);
gpr_free(handshaker);
@@ -129,20 +129,20 @@ static void on_read_done(grpc_exec_ctx* exec_ctx, void* arg,
grpc_timer_cancel(exec_ctx, &handshaker->timeout_timer);
// Remove the data we've already read from the read buffer,
// leaving only the leftover bytes (if any).
- gpr_slice_buffer tmp_buffer;
- gpr_slice_buffer_init(&tmp_buffer);
+ grpc_slice_buffer tmp_buffer;
+ grpc_slice_buffer_init(&tmp_buffer);
if (body_start_offset <
GPR_SLICE_LENGTH(handshaker->read_buffer->slices[i])) {
- gpr_slice_buffer_add(
+ grpc_slice_buffer_add(
&tmp_buffer,
- gpr_slice_split_tail(&handshaker->read_buffer->slices[i],
+ grpc_slice_split_tail(&handshaker->read_buffer->slices[i],
body_start_offset));
}
- gpr_slice_buffer_addn(&tmp_buffer,
+ grpc_slice_buffer_addn(&tmp_buffer,
&handshaker->read_buffer->slices[i + 1],
handshaker->read_buffer->count - i - 1);
- gpr_slice_buffer_swap(handshaker->read_buffer, &tmp_buffer);
- gpr_slice_buffer_destroy(&tmp_buffer);
+ grpc_slice_buffer_swap(handshaker->read_buffer, &tmp_buffer);
+ grpc_slice_buffer_destroy(&tmp_buffer);
break;
}
}
@@ -159,7 +159,7 @@ static void on_read_done(grpc_exec_ctx* exec_ctx, void* arg,
// complete (e.g., handling chunked transfer encoding or looking
// at the Content-Length: header).
if (handshaker->http_parser.state != GRPC_HTTP_BODY) {
- gpr_slice_buffer_reset_and_unref(handshaker->read_buffer);
+ grpc_slice_buffer_reset_and_unref(handshaker->read_buffer);
grpc_endpoint_read(exec_ctx, handshaker->endpoint, handshaker->read_buffer,
&handshaker->response_read_closure);
return;
@@ -195,7 +195,7 @@ static void http_connect_handshaker_shutdown(grpc_exec_ctx* exec_ctx,
static void http_connect_handshaker_do_handshake(
grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker_in,
grpc_endpoint* endpoint, grpc_channel_args* args,
- gpr_slice_buffer* read_buffer, gpr_timespec deadline,
+ grpc_slice_buffer* read_buffer, gpr_timespec deadline,
grpc_tcp_server_acceptor* acceptor, grpc_handshaker_done_cb cb,
void* user_data) {
http_connect_handshaker* handshaker = (http_connect_handshaker*)handshaker_in;
@@ -214,8 +214,8 @@ static void http_connect_handshaker_do_handshake(
request.http.method = "CONNECT";
request.http.path = handshaker->server_name;
request.handshaker = &grpc_httpcli_plaintext;
- gpr_slice request_slice = grpc_httpcli_format_connect_request(&request);
- gpr_slice_buffer_add(&handshaker->write_buffer, request_slice);
+ grpc_slice request_slice = grpc_httpcli_format_connect_request(&request);
+ grpc_slice_buffer_add(&handshaker->write_buffer, request_slice);
grpc_endpoint_write(exec_ctx, endpoint, &handshaker->write_buffer,
&handshaker->request_done_closure);
// Set timeout timer. The timer gets a reference to the handshaker.
@@ -239,7 +239,7 @@ grpc_handshaker* grpc_http_connect_handshaker_create(const char* proxy_server,
grpc_handshaker_init(&http_connect_handshaker_vtable, &handshaker->base);
handshaker->proxy_server = gpr_strdup(proxy_server);
handshaker->server_name = gpr_strdup(server_name);
- gpr_slice_buffer_init(&handshaker->write_buffer);
+ grpc_slice_buffer_init(&handshaker->write_buffer);
grpc_closure_init(&handshaker->request_done_closure, on_write_done,
handshaker);
grpc_closure_init(&handshaker->response_read_closure, on_read_done,
diff --git a/src/core/ext/client_channel/initial_connect_string.c b/src/core/ext/client_channel/initial_connect_string.c
index fd8ddb83a8..8737b330a8 100644
--- a/src/core/ext/client_channel/initial_connect_string.c
+++ b/src/core/ext/client_channel/initial_connect_string.c
@@ -37,7 +37,7 @@
extern void grpc_set_default_initial_connect_string(struct sockaddr **addr,
size_t *addr_len,
- gpr_slice *initial_str);
+ grpc_slice *initial_str);
static grpc_set_initial_connect_string_func g_set_initial_connect_string_func =
grpc_set_default_initial_connect_string;
@@ -48,6 +48,6 @@ void grpc_test_set_initial_connect_string_function(
}
void grpc_set_initial_connect_string(struct sockaddr **addr, size_t *addr_len,
- gpr_slice *initial_str) {
+ grpc_slice *initial_str) {
g_set_initial_connect_string_func(addr, addr_len, initial_str);
}
diff --git a/src/core/ext/client_channel/initial_connect_string.h b/src/core/ext/client_channel/initial_connect_string.h
index 39f6465fc9..4cfe8b5fe7 100644
--- a/src/core/ext/client_channel/initial_connect_string.h
+++ b/src/core/ext/client_channel/initial_connect_string.h
@@ -39,12 +39,12 @@
typedef void (*grpc_set_initial_connect_string_func)(struct sockaddr **addr,
size_t *addr_len,
- gpr_slice *initial_str);
+ grpc_slice *initial_str);
void grpc_test_set_initial_connect_string_function(
grpc_set_initial_connect_string_func func);
/** Set a string to be sent once connected. Optionally reset addr. */
void grpc_set_initial_connect_string(struct sockaddr **addr, size_t *addr_len,
- gpr_slice *connect_string);
+ grpc_slice *connect_string);
#endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_INITIAL_CONNECT_STRING_H */
diff --git a/src/core/ext/client_channel/subchannel.c b/src/core/ext/client_channel/subchannel.c
index 672e5c3a91..8d4a457e60 100644
--- a/src/core/ext/client_channel/subchannel.c
+++ b/src/core/ext/client_channel/subchannel.c
@@ -101,7 +101,7 @@ struct grpc_subchannel {
grpc_subchannel_key *key;
/** initial string to send to peer */
- gpr_slice initial_connect_string;
+ grpc_slice initial_connect_string;
/** set during connection */
grpc_connect_out_args connecting_result;
@@ -206,7 +206,7 @@ static void subchannel_destroy(grpc_exec_ctx *exec_ctx, void *arg,
gpr_free((void *)c->filters);
grpc_channel_args_destroy(c->args);
gpr_free(c->addr);
- gpr_slice_unref(c->initial_connect_string);
+ grpc_slice_unref(c->initial_connect_string);
grpc_connectivity_state_destroy(exec_ctx, &c->state_tracker);
grpc_connector_unref(exec_ctx, c->connector);
grpc_pollset_set_destroy(c->pollset_set);
diff --git a/src/core/ext/client_channel/uri_parser.c b/src/core/ext/client_channel/uri_parser.c
index bcb6a1dee4..7bdc5373d9 100644
--- a/src/core/ext/client_channel/uri_parser.c
+++ b/src/core/ext/client_channel/uri_parser.c
@@ -148,20 +148,20 @@ static void parse_query_parts(grpc_uri *uri) {
uri->num_query_parts = 0;
return;
}
- gpr_slice query_slice =
- gpr_slice_new(uri->query, strlen(uri->query), do_nothing);
- gpr_slice_buffer query_parts; /* the &-separated elements of the query */
- gpr_slice_buffer query_param_parts; /* the =-separated subelements */
+ grpc_slice query_slice =
+ grpc_slice_new(uri->query, strlen(uri->query), do_nothing);
+ grpc_slice_buffer query_parts; /* the &-separated elements of the query */
+ grpc_slice_buffer query_param_parts; /* the =-separated subelements */
- gpr_slice_buffer_init(&query_parts);
- gpr_slice_buffer_init(&query_param_parts);
+ grpc_slice_buffer_init(&query_parts);
+ grpc_slice_buffer_init(&query_param_parts);
- gpr_slice_split(query_slice, QUERY_PARTS_SEPARATOR, &query_parts);
+ grpc_slice_split(query_slice, QUERY_PARTS_SEPARATOR, &query_parts);
uri->query_parts = gpr_malloc(query_parts.count * sizeof(char *));
uri->query_parts_values = gpr_malloc(query_parts.count * sizeof(char *));
uri->num_query_parts = query_parts.count;
for (size_t i = 0; i < query_parts.count; i++) {
- gpr_slice_split(query_parts.slices[i], QUERY_PARTS_VALUE_SEPARATOR,
+ grpc_slice_split(query_parts.slices[i], QUERY_PARTS_VALUE_SEPARATOR,
&query_param_parts);
GPR_ASSERT(query_param_parts.count > 0);
uri->query_parts[i] =
@@ -175,11 +175,11 @@ static void parse_query_parts(grpc_uri *uri) {
} else {
uri->query_parts_values[i] = NULL;
}
- gpr_slice_buffer_reset_and_unref(&query_param_parts);
+ grpc_slice_buffer_reset_and_unref(&query_param_parts);
}
- gpr_slice_buffer_destroy(&query_parts);
- gpr_slice_buffer_destroy(&query_param_parts);
- gpr_slice_unref(query_slice);
+ grpc_slice_buffer_destroy(&query_parts);
+ grpc_slice_buffer_destroy(&query_param_parts);
+ grpc_slice_unref(query_slice);
}
grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors) {
diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c
index 412090158a..3c2b87f2cb 100644
--- a/src/core/ext/lb_policy/grpclb/grpclb.c
+++ b/src/core/ext/lb_policy/grpclb/grpclb.c
@@ -952,10 +952,10 @@ static lb_client_data *lb_client_data_create(glb_lb_policy *glb_policy) {
grpc_grpclb_request *request =
grpc_grpclb_request_create(glb_policy->server_name);
- gpr_slice request_payload_slice = grpc_grpclb_request_encode(request);
+ grpc_slice request_payload_slice = grpc_grpclb_request_encode(request);
lb_client->request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
- gpr_slice_unref(request_payload_slice);
+ grpc_slice_unref(request_payload_slice);
grpc_grpclb_request_destroy(request);
lb_client->status_details = NULL;
@@ -1072,12 +1072,12 @@ static void res_recv_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
* lb_client->response_payload, for a serverlist. */
grpc_byte_buffer_reader bbr;
grpc_byte_buffer_reader_init(&bbr, lb_client->response_payload);
- gpr_slice response_slice = grpc_byte_buffer_reader_readall(&bbr);
+ grpc_slice response_slice = grpc_byte_buffer_reader_readall(&bbr);
grpc_byte_buffer_destroy(lb_client->response_payload);
grpc_grpclb_serverlist *serverlist =
grpc_grpclb_response_parse_serverlist(response_slice);
if (serverlist != NULL) {
- gpr_slice_unref(response_slice);
+ grpc_slice_unref(response_slice);
if (grpc_lb_glb_trace) {
gpr_log(GPR_INFO, "Serverlist with %lu servers received",
(unsigned long)serverlist->num_servers);
@@ -1136,7 +1136,7 @@ static void res_recv_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
GPR_ASSERT(serverlist == NULL);
gpr_log(GPR_ERROR, "Invalid LB response received: '%s'",
gpr_dump_slice(response_slice, GPR_DUMP_ASCII));
- gpr_slice_unref(response_slice);
+ grpc_slice_unref(response_slice);
/* Disconnect from server returning invalid response. */
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
diff --git a/src/core/ext/lb_policy/grpclb/load_balancer_api.c b/src/core/ext/lb_policy/grpclb/load_balancer_api.c
index a8881004a0..f3860d119d 100644
--- a/src/core/ext/lb_policy/grpclb/load_balancer_api.c
+++ b/src/core/ext/lb_policy/grpclb/load_balancer_api.c
@@ -90,16 +90,16 @@ grpc_grpclb_request *grpc_grpclb_request_create(const char *lb_service_name) {
return req;
}
-gpr_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request) {
+grpc_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request) {
size_t encoded_length;
pb_ostream_t sizestream;
pb_ostream_t outputstream;
- gpr_slice slice;
+ grpc_slice slice;
memset(&sizestream, 0, sizeof(pb_ostream_t));
pb_encode(&sizestream, grpc_lb_v1_LoadBalanceRequest_fields, request);
encoded_length = sizestream.bytes_written;
- slice = gpr_slice_malloc(encoded_length);
+ slice = grpc_slice_malloc(encoded_length);
outputstream =
pb_ostream_from_buffer(GPR_SLICE_START_PTR(slice), encoded_length);
GPR_ASSERT(pb_encode(&outputstream, grpc_lb_v1_LoadBalanceRequest_fields,
@@ -113,7 +113,7 @@ void grpc_grpclb_request_destroy(grpc_grpclb_request *request) {
typedef grpc_lb_v1_LoadBalanceResponse grpc_grpclb_response;
grpc_grpclb_initial_response *grpc_grpclb_initial_response_parse(
- gpr_slice encoded_grpc_grpclb_response) {
+ grpc_slice encoded_grpc_grpclb_response) {
pb_istream_t stream =
pb_istream_from_buffer(GPR_SLICE_START_PTR(encoded_grpc_grpclb_response),
GPR_SLICE_LENGTH(encoded_grpc_grpclb_response));
@@ -132,7 +132,7 @@ grpc_grpclb_initial_response *grpc_grpclb_initial_response_parse(
}
grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist(
- gpr_slice encoded_grpc_grpclb_response) {
+ grpc_slice encoded_grpc_grpclb_response) {
bool status;
decode_serverlist_arg arg;
pb_istream_t stream =
diff --git a/src/core/ext/lb_policy/grpclb/load_balancer_api.h b/src/core/ext/lb_policy/grpclb/load_balancer_api.h
index 079a64a3f3..235ccf6cb4 100644
--- a/src/core/ext/lb_policy/grpclb/load_balancer_api.h
+++ b/src/core/ext/lb_policy/grpclb/load_balancer_api.h
@@ -60,7 +60,7 @@ typedef struct grpc_grpclb_serverlist {
grpc_grpclb_request *grpc_grpclb_request_create(const char *lb_service_name);
/** Protocol Buffers v3-encode \a request */
-gpr_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request);
+grpc_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request);
/** Destroy \a request */
void grpc_grpclb_request_destroy(grpc_grpclb_request *request);
@@ -68,11 +68,11 @@ void grpc_grpclb_request_destroy(grpc_grpclb_request *request);
/** Parse (ie, decode) the bytes in \a encoded_grpc_grpclb_response as a \a
* grpc_grpclb_initial_response */
grpc_grpclb_initial_response *grpc_grpclb_initial_response_parse(
- gpr_slice encoded_grpc_grpclb_response);
+ grpc_slice encoded_grpc_grpclb_response);
/** Parse the list of servers from an encoded \a grpc_grpclb_response */
grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist(
- gpr_slice encoded_grpc_grpclb_response);
+ grpc_slice encoded_grpc_grpclb_response);
/** Return a copy of \a sl. The caller is responsible for calling \a
* grpc_grpclb_destroy_serverlist on the returned copy. */
diff --git a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c
index 9924fc6fec..cd0c45e407 100644
--- a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c
+++ b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c
@@ -169,11 +169,11 @@ static grpc_resolver *sockaddr_create(grpc_resolver_args *args,
return NULL;
}
/* Construct addresses. */
- gpr_slice path_slice =
- gpr_slice_new(args->uri->path, strlen(args->uri->path), do_nothing);
- gpr_slice_buffer path_parts;
- gpr_slice_buffer_init(&path_parts);
- gpr_slice_split(path_slice, ",", &path_parts);
+ grpc_slice path_slice =
+ grpc_slice_new(args->uri->path, strlen(args->uri->path), do_nothing);
+ grpc_slice_buffer path_parts;
+ grpc_slice_buffer_init(&path_parts);
+ grpc_slice_split(path_slice, ",", &path_parts);
grpc_lb_addresses *addresses = grpc_lb_addresses_create(path_parts.count);
bool errors_found = false;
for (size_t i = 0; i < addresses->num_addresses; i++) {
@@ -189,8 +189,8 @@ static grpc_resolver *sockaddr_create(grpc_resolver_args *args,
gpr_free(part_str);
if (errors_found) break;
}
- gpr_slice_buffer_destroy(&path_parts);
- gpr_slice_unref(path_slice);
+ grpc_slice_buffer_destroy(&path_parts);
+ grpc_slice_unref(path_slice);
if (errors_found) {
grpc_lb_addresses_destroy(addresses, NULL /* user_data_destroy */);
return NULL;
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.c
index 41432b54a9..eee38a0b90 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.c
@@ -60,7 +60,7 @@ typedef struct {
grpc_connect_in_args args;
grpc_connect_out_args *result;
grpc_closure initial_string_sent;
- gpr_slice_buffer initial_string_buffer;
+ grpc_slice_buffer initial_string_buffer;
grpc_endpoint *tcp;
@@ -90,7 +90,7 @@ static void on_initial_connect_string_sent(grpc_exec_ctx *exec_ctx, void *arg,
static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint,
grpc_channel_args *args,
- gpr_slice_buffer *read_buffer, void *user_data,
+ grpc_slice_buffer *read_buffer, void *user_data,
grpc_error *error) {
connector *c = user_data;
if (error != GRPC_ERROR_NONE) {
@@ -116,8 +116,8 @@ static void connected(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
if (!GPR_SLICE_IS_EMPTY(c->args.initial_connect_string)) {
grpc_closure_init(&c->initial_string_sent, on_initial_connect_string_sent,
c);
- gpr_slice_buffer_init(&c->initial_string_buffer);
- gpr_slice_buffer_add(&c->initial_string_buffer,
+ grpc_slice_buffer_init(&c->initial_string_buffer);
+ grpc_slice_buffer_add(&c->initial_string_buffer,
c->args.initial_connect_string);
connector_ref(arg);
grpc_endpoint_write(exec_ctx, tcp, &c->initial_string_buffer,
diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
index 2e6b3f2fc8..d396a1bc36 100644
--- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
+++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
@@ -64,7 +64,7 @@ typedef struct {
grpc_connect_in_args args;
grpc_connect_out_args *result;
grpc_closure initial_string_sent;
- gpr_slice_buffer initial_string_buffer;
+ grpc_slice_buffer initial_string_buffer;
gpr_mu mu;
grpc_endpoint *connecting_endpoint;
@@ -127,7 +127,7 @@ static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint,
grpc_channel_args *args,
- gpr_slice_buffer *read_buffer, void *user_data,
+ grpc_slice_buffer *read_buffer, void *user_data,
grpc_error *error) {
connector *c = user_data;
c->tmp_args = args;
@@ -165,8 +165,8 @@ static void connected(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
if (!GPR_SLICE_IS_EMPTY(c->args.initial_connect_string)) {
grpc_closure_init(&c->initial_string_sent, on_initial_connect_string_sent,
c);
- gpr_slice_buffer_init(&c->initial_string_buffer);
- gpr_slice_buffer_add(&c->initial_string_buffer,
+ grpc_slice_buffer_init(&c->initial_string_buffer);
+ grpc_slice_buffer_add(&c->initial_string_buffer,
c->args.initial_connect_string);
grpc_endpoint_write(exec_ctx, tcp, &c->initial_string_buffer,
&c->initial_string_sent);
diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c
index 2c64878c0c..e5b4025c5f 100644
--- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c
+++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c
@@ -56,7 +56,7 @@ typedef struct server_connect_state {
static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint,
grpc_channel_args *args,
- gpr_slice_buffer *read_buffer, void *user_data,
+ grpc_slice_buffer *read_buffer, void *user_data,
grpc_error *error) {
server_connect_state *state = user_data;
if (error != GRPC_ERROR_NONE) {
diff --git a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c
index 88afcb6dea..a998dddd37 100644
--- a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c
+++ b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c
@@ -117,7 +117,7 @@ static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *statep,
static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint,
grpc_channel_args *args,
- gpr_slice_buffer *read_buffer, void *user_data,
+ grpc_slice_buffer *read_buffer, void *user_data,
grpc_error *error) {
server_secure_connect *connection_state = user_data;
if (error != GRPC_ERROR_NONE) {
diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.c b/src/core/ext/transport/chttp2/transport/bin_decoder.c
index 2d90b01cd8..d8948bdfdb 100644
--- a/src/core/ext/transport/chttp2/transport/bin_decoder.c
+++ b/src/core/ext/transport/chttp2/transport/bin_decoder.c
@@ -142,11 +142,11 @@ bool grpc_base64_decode_partial(struct grpc_base64_decode_context *ctx) {
return true;
}
-gpr_slice grpc_chttp2_base64_decode(gpr_slice input) {
+grpc_slice grpc_chttp2_base64_decode(grpc_slice input) {
size_t input_length = GPR_SLICE_LENGTH(input);
size_t output_length = input_length / 4 * 3;
struct grpc_base64_decode_context ctx;
- gpr_slice output;
+ grpc_slice output;
if (input_length % 4 != 0) {
gpr_log(GPR_ERROR,
@@ -166,7 +166,7 @@ gpr_slice grpc_chttp2_base64_decode(gpr_slice input) {
}
}
}
- output = gpr_slice_malloc(output_length);
+ output = grpc_slice_malloc(output_length);
ctx.input_cur = GPR_SLICE_START_PTR(input);
ctx.input_end = GPR_SLICE_END_PTR(input);
@@ -178,7 +178,7 @@ gpr_slice grpc_chttp2_base64_decode(gpr_slice input) {
char *s = gpr_dump_slice(input, GPR_DUMP_ASCII);
gpr_log(GPR_ERROR, "Base64 decoding failed, input string:\n%s\n", s);
gpr_free(s);
- gpr_slice_unref(output);
+ grpc_slice_unref(output);
return gpr_empty_slice();
}
GPR_ASSERT(ctx.output_cur == GPR_SLICE_END_PTR(output));
@@ -186,10 +186,10 @@ gpr_slice grpc_chttp2_base64_decode(gpr_slice input) {
return output;
}
-gpr_slice grpc_chttp2_base64_decode_with_length(gpr_slice input,
+grpc_slice grpc_chttp2_base64_decode_with_length(grpc_slice input,
size_t output_length) {
size_t input_length = GPR_SLICE_LENGTH(input);
- gpr_slice output = gpr_slice_malloc(output_length);
+ grpc_slice output = grpc_slice_malloc(output_length);
struct grpc_base64_decode_context ctx;
// The length of a base64 string cannot be 4 * n + 1
@@ -199,7 +199,7 @@ gpr_slice grpc_chttp2_base64_decode_with_length(gpr_slice input,
"grpc_chttp2_base64_decode_with_length has a length of %d, which "
"has a tail of 1 byte.\n",
(int)input_length);
- gpr_slice_unref(output);
+ grpc_slice_unref(output);
return gpr_empty_slice();
}
@@ -209,7 +209,7 @@ gpr_slice grpc_chttp2_base64_decode_with_length(gpr_slice input,
"than the max possible output length %d.\n",
(int)output_length,
(int)(input_length / 4 * 3 + tail_xtra[input_length % 4]));
- gpr_slice_unref(output);
+ grpc_slice_unref(output);
return gpr_empty_slice();
}
@@ -223,7 +223,7 @@ gpr_slice grpc_chttp2_base64_decode_with_length(gpr_slice input,
char *s = gpr_dump_slice(input, GPR_DUMP_ASCII);
gpr_log(GPR_ERROR, "Base64 decoding failed, input string:\n%s\n", s);
gpr_free(s);
- gpr_slice_unref(output);
+ grpc_slice_unref(output);
return gpr_empty_slice();
}
GPR_ASSERT(ctx.output_cur == GPR_SLICE_END_PTR(output));
diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.h b/src/core/ext/transport/chttp2/transport/bin_decoder.h
index b9d40c9b74..c416608a0b 100644
--- a/src/core/ext/transport/chttp2/transport/bin_decoder.h
+++ b/src/core/ext/transport/chttp2/transport/bin_decoder.h
@@ -55,12 +55,12 @@ bool grpc_base64_decode_partial(struct grpc_base64_decode_context *ctx);
/* base64 decode a slice with pad chars. Returns a new slice, does not take
ownership of the input. Returns an empty slice if decoding is failed. */
-gpr_slice grpc_chttp2_base64_decode(gpr_slice input);
+grpc_slice grpc_chttp2_base64_decode(grpc_slice input);
/* base64 decode a slice without pad chars, data length is needed. Returns a new
slice, does not take ownership of the input. Returns an empty slice if
decoding is failed. */
-gpr_slice grpc_chttp2_base64_decode_with_length(gpr_slice input,
+grpc_slice grpc_chttp2_base64_decode_with_length(grpc_slice input,
size_t output_length);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */
diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.c b/src/core/ext/transport/chttp2/transport/bin_encoder.c
index 1b43c28be1..09b961533a 100644
--- a/src/core/ext/transport/chttp2/transport/bin_encoder.c
+++ b/src/core/ext/transport/chttp2/transport/bin_encoder.c
@@ -61,12 +61,12 @@ static const b64_huff_sym huff_alphabet[64] = {
static const uint8_t tail_xtra[3] = {0, 2, 3};
-gpr_slice grpc_chttp2_base64_encode(gpr_slice input) {
+grpc_slice grpc_chttp2_base64_encode(grpc_slice input) {
size_t input_length = GPR_SLICE_LENGTH(input);
size_t input_triplets = input_length / 3;
size_t tail_case = input_length % 3;
size_t output_length = input_triplets * 4 + tail_xtra[tail_case];
- gpr_slice output = gpr_slice_malloc(output_length);
+ grpc_slice output = grpc_slice_malloc(output_length);
uint8_t *in = GPR_SLICE_START_PTR(input);
char *out = (char *)GPR_SLICE_START_PTR(output);
size_t i;
@@ -105,11 +105,11 @@ gpr_slice grpc_chttp2_base64_encode(gpr_slice input) {
return output;
}
-gpr_slice grpc_chttp2_huffman_compress(gpr_slice input) {
+grpc_slice grpc_chttp2_huffman_compress(grpc_slice input) {
size_t nbits;
uint8_t *in;
uint8_t *out;
- gpr_slice output;
+ grpc_slice output;
uint32_t temp = 0;
uint32_t temp_length = 0;
@@ -118,7 +118,7 @@ gpr_slice grpc_chttp2_huffman_compress(gpr_slice input) {
nbits += grpc_chttp2_huffsyms[*in].length;
}
- output = gpr_slice_malloc(nbits / 8 + (nbits % 8 != 0));
+ output = grpc_slice_malloc(nbits / 8 + (nbits % 8 != 0));
out = GPR_SLICE_START_PTR(output);
for (in = GPR_SLICE_START_PTR(input); in != GPR_SLICE_END_PTR(input); ++in) {
int sym = *in;
@@ -175,14 +175,14 @@ static void enc_add1(huff_out *out, uint8_t a) {
enc_flush_some(out);
}
-gpr_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(gpr_slice input) {
+grpc_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(grpc_slice input) {
size_t input_length = GPR_SLICE_LENGTH(input);
size_t input_triplets = input_length / 3;
size_t tail_case = input_length % 3;
size_t output_syms = input_triplets * 4 + tail_xtra[tail_case];
size_t max_output_bits = 11 * output_syms;
size_t max_output_length = max_output_bits / 8 + (max_output_bits % 8 != 0);
- gpr_slice output = gpr_slice_malloc(max_output_length);
+ grpc_slice output = grpc_slice_malloc(max_output_length);
uint8_t *in = GPR_SLICE_START_PTR(input);
uint8_t *start_out = GPR_SLICE_START_PTR(output);
huff_out out;
diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.h b/src/core/ext/transport/chttp2/transport/bin_encoder.h
index 61ebbafa9a..878390cde6 100644
--- a/src/core/ext/transport/chttp2/transport/bin_encoder.h
+++ b/src/core/ext/transport/chttp2/transport/bin_encoder.h
@@ -38,17 +38,17 @@
/* base64 encode a slice. Returns a new slice, does not take ownership of the
input */
-gpr_slice grpc_chttp2_base64_encode(gpr_slice input);
+grpc_slice grpc_chttp2_base64_encode(grpc_slice input);
/* Compress a slice with the static huffman encoder detailed in the hpack
standard. Returns a new slice, does not take ownership of the input */
-gpr_slice grpc_chttp2_huffman_compress(gpr_slice input);
+grpc_slice grpc_chttp2_huffman_compress(grpc_slice input);
/* equivalent to:
- gpr_slice x = grpc_chttp2_base64_encode(input);
- gpr_slice y = grpc_chttp2_huffman_compress(x);
- gpr_slice_unref(x);
+ grpc_slice x = grpc_chttp2_base64_encode(input);
+ grpc_slice y = grpc_chttp2_huffman_compress(x);
+ grpc_slice_unref(x);
return y; */
-gpr_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(gpr_slice input);
+grpc_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(grpc_slice input);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
index 562f498d88..3a551d449b 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
@@ -143,12 +143,12 @@ static void destruct_transport(grpc_exec_ctx *exec_ctx,
grpc_endpoint_destroy(exec_ctx, t->ep);
- gpr_slice_buffer_destroy(&t->qbuf);
+ grpc_slice_buffer_destroy(&t->qbuf);
- gpr_slice_buffer_destroy(&t->outbuf);
+ grpc_slice_buffer_destroy(&t->outbuf);
grpc_chttp2_hpack_compressor_destroy(&t->hpack_compressor);
- gpr_slice_buffer_destroy(&t->read_buffer);
+ grpc_slice_buffer_destroy(&t->read_buffer);
grpc_chttp2_hpack_parser_destroy(&t->hpack_parser);
grpc_chttp2_goaway_parser_destroy(&t->goaway_parser);
@@ -243,9 +243,9 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
&t->channel_callback.state_tracker, GRPC_CHANNEL_READY,
is_client ? "client_transport" : "server_transport");
- gpr_slice_buffer_init(&t->qbuf);
+ grpc_slice_buffer_init(&t->qbuf);
- gpr_slice_buffer_init(&t->outbuf);
+ grpc_slice_buffer_init(&t->outbuf);
grpc_chttp2_hpack_compressor_init(&t->hpack_compressor);
grpc_closure_init(&t->write_action_begin_locked, write_action_begin_locked,
@@ -264,7 +264,7 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
grpc_chttp2_goaway_parser_init(&t->goaway_parser);
grpc_chttp2_hpack_parser_init(&t->hpack_parser);
- gpr_slice_buffer_init(&t->read_buffer);
+ grpc_slice_buffer_init(&t->read_buffer);
/* 8 is a random stab in the dark as to a good initial size: it's small enough
that it shouldn't waste memory for infrequently used connections, yet
@@ -286,7 +286,7 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
t->sent_local_settings = 0;
if (is_client) {
- gpr_slice_buffer_add(&t->outbuf, gpr_slice_from_copied_string(
+ grpc_slice_buffer_add(&t->outbuf, grpc_slice_from_copied_string(
GRPC_CHTTP2_CLIENT_CONNECT_STRING));
grpc_chttp2_initiate_write(exec_ctx, t, false, "initial_write");
}
@@ -471,7 +471,7 @@ static int init_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
grpc_chttp2_incoming_metadata_buffer_init(&s->metadata_buffer[0]);
grpc_chttp2_incoming_metadata_buffer_init(&s->metadata_buffer[1]);
grpc_chttp2_data_parser_init(&s->data_parser);
- gpr_slice_buffer_init(&s->flow_controlled_buffer);
+ grpc_slice_buffer_init(&s->flow_controlled_buffer);
s->deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
grpc_closure_init(&s->complete_fetch, complete_fetch, s);
grpc_closure_init(&s->complete_fetch_locked, complete_fetch_locked, s);
@@ -531,7 +531,7 @@ static void destroy_stream_locked(grpc_exec_ctx *exec_ctx, void *sp,
grpc_chttp2_data_parser_destroy(exec_ctx, &s->data_parser);
grpc_chttp2_incoming_metadata_buffer_destroy(&s->metadata_buffer[0]);
grpc_chttp2_incoming_metadata_buffer_destroy(&s->metadata_buffer[1]);
- gpr_slice_buffer_destroy(&s->flow_controlled_buffer);
+ grpc_slice_buffer_destroy(&s->flow_controlled_buffer);
GRPC_ERROR_UNREF(s->read_closed_error);
GRPC_ERROR_UNREF(s->write_closed_error);
@@ -756,11 +756,11 @@ static void push_setting(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
void grpc_chttp2_add_incoming_goaway(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t,
uint32_t goaway_error,
- gpr_slice goaway_text) {
+ grpc_slice goaway_text) {
char *msg = gpr_dump_slice(goaway_text, GPR_DUMP_HEX | GPR_DUMP_ASCII);
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_DEBUG, "got goaway [%d]: %s", goaway_error, msg));
- gpr_slice_unref(goaway_text);
+ grpc_slice_unref(goaway_text);
t->seen_goaway = 1;
/* lie: use transient failure from the transport to indicate goaway has been
* received */
@@ -924,7 +924,7 @@ static void add_fetched_slice_locked(grpc_exec_ctx *exec_ctx,
grpc_chttp2_stream *s) {
s->fetched_send_message_length +=
(uint32_t)GPR_SLICE_LENGTH(s->fetching_slice);
- gpr_slice_buffer_add(&s->flow_controlled_buffer, s->fetching_slice);
+ grpc_slice_buffer_add(&s->flow_controlled_buffer, s->fetching_slice);
if (s->id != 0) {
grpc_chttp2_become_writable(exec_ctx, t, s, true, "op.send_message");
}
@@ -1052,7 +1052,7 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, void *stream_op,
} else {
GPR_ASSERT(s->fetching_send_message == NULL);
uint8_t *frame_hdr =
- gpr_slice_buffer_tiny_add(&s->flow_controlled_buffer, 5);
+ grpc_slice_buffer_tiny_add(&s->flow_controlled_buffer, 5);
uint32_t flags = op->send_message->flags;
frame_hdr[0] = (flags & GRPC_WRITE_INTERNAL_COMPRESS) != 0;
size_t len = op->send_message->length;
@@ -1192,7 +1192,7 @@ static void send_ping_locked(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
p->id[7] = (uint8_t)(t->ping_counter & 0xff);
t->ping_counter++;
p->on_recv = on_recv;
- gpr_slice_buffer_add(&t->qbuf, grpc_chttp2_ping_create(0, p->id));
+ grpc_slice_buffer_add(&t->qbuf, grpc_chttp2_ping_create(0, p->id));
grpc_chttp2_initiate_write(exec_ctx, t, true, "send_ping");
}
@@ -1216,7 +1216,7 @@ void grpc_chttp2_ack_ping(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
}
static void send_goaway(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
- grpc_chttp2_error_code error, gpr_slice data) {
+ grpc_chttp2_error_code error, grpc_slice data) {
t->sent_goaway_state = GRPC_CHTTP2_GOAWAY_SEND_SCHEDULED;
grpc_chttp2_goaway_append(t->last_new_stream_id, (uint32_t)error, data,
&t->qbuf);
@@ -1239,7 +1239,7 @@ static void perform_transport_op_locked(grpc_exec_ctx *exec_ctx,
if (op->send_goaway) {
send_goaway(exec_ctx, t,
grpc_chttp2_grpc_status_to_http2_error(op->goaway_status),
- gpr_slice_ref(*op->goaway_message));
+ grpc_slice_ref(*op->goaway_message));
}
if (op->set_accept_stream) {
@@ -1428,7 +1428,7 @@ void grpc_chttp2_cancel_stream(grpc_exec_ctx *exec_ctx,
&grpc_status);
if (s->id != 0) {
- gpr_slice_buffer_add(
+ grpc_slice_buffer_add(
&t->qbuf, grpc_chttp2_rst_stream_create(s->id, (uint32_t)http_error,
&s->stats.outgoing));
grpc_chttp2_initiate_write(exec_ctx, t, false, "rst_stream");
@@ -1441,7 +1441,7 @@ void grpc_chttp2_cancel_stream(grpc_exec_ctx *exec_ctx,
free_msg = true;
msg = grpc_error_string(due_to_error);
}
- gpr_slice msg_slice = gpr_slice_from_copied_string(msg);
+ grpc_slice msg_slice = grpc_slice_from_copied_string(msg);
grpc_chttp2_fake_status(exec_ctx, t, s, grpc_status, &msg_slice);
if (free_msg) grpc_error_free_string(msg);
}
@@ -1454,7 +1454,7 @@ void grpc_chttp2_cancel_stream(grpc_exec_ctx *exec_ctx,
void grpc_chttp2_fake_status(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
grpc_chttp2_stream *s, grpc_status_code status,
- gpr_slice *slice) {
+ grpc_slice *slice) {
if (status != GRPC_STATUS_OK) {
s->seen_error = true;
}
@@ -1477,13 +1477,13 @@ void grpc_chttp2_fake_status(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
&s->metadata_buffer[1],
grpc_mdelem_from_metadata_strings(
GRPC_MDSTR_GRPC_MESSAGE,
- grpc_mdstr_from_slice(gpr_slice_ref(*slice))));
+ grpc_mdstr_from_slice(grpc_slice_ref(*slice))));
}
s->published_metadata[1] = GRPC_METADATA_SYNTHESIZED_FROM_FAKE;
grpc_chttp2_maybe_complete_recv_trailing_metadata(exec_ctx, t, s);
}
if (slice) {
- gpr_slice_unref(*slice);
+ grpc_slice_unref(*slice);
}
}
@@ -1580,9 +1580,9 @@ void grpc_chttp2_mark_stream_closed(grpc_exec_ctx *exec_ctx,
static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
grpc_chttp2_stream *s, grpc_error *error) {
- gpr_slice hdr;
- gpr_slice status_hdr;
- gpr_slice message_pfx;
+ grpc_slice hdr;
+ grpc_slice status_hdr;
+ grpc_slice message_pfx;
uint8_t *p;
uint32_t len = 0;
grpc_status_code grpc_status;
@@ -1601,7 +1601,7 @@ static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
time we got around to sending this, so instead we ignore HPACK
compression
and just write the uncompressed bytes onto the wire. */
- status_hdr = gpr_slice_malloc(15 + (grpc_status >= 10));
+ status_hdr = grpc_slice_malloc(15 + (grpc_status >= 10));
p = GPR_SLICE_START_PTR(status_hdr);
*p++ = 0x40; /* literal header */
*p++ = 11; /* len(grpc-status) */
@@ -1633,7 +1633,7 @@ static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
if (optional_message != NULL) {
size_t msg_len = strlen(optional_message);
GPR_ASSERT(msg_len < 127);
- message_pfx = gpr_slice_malloc(15);
+ message_pfx = grpc_slice_malloc(15);
p = GPR_SLICE_START_PTR(message_pfx);
*p++ = 0x40;
*p++ = 12; /* len(grpc-message) */
@@ -1655,7 +1655,7 @@ static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
len += (uint32_t)msg_len;
}
- hdr = gpr_slice_malloc(9);
+ hdr = grpc_slice_malloc(9);
p = GPR_SLICE_START_PTR(hdr);
*p++ = (uint8_t)(len >> 16);
*p++ = (uint8_t)(len >> 8);
@@ -1668,14 +1668,14 @@ static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
*p++ = (uint8_t)(s->id);
GPR_ASSERT(p == GPR_SLICE_END_PTR(hdr));
- gpr_slice_buffer_add(&t->qbuf, hdr);
- gpr_slice_buffer_add(&t->qbuf, status_hdr);
+ grpc_slice_buffer_add(&t->qbuf, hdr);
+ grpc_slice_buffer_add(&t->qbuf, status_hdr);
if (optional_message) {
- gpr_slice_buffer_add(&t->qbuf, message_pfx);
- gpr_slice_buffer_add(&t->qbuf,
- gpr_slice_from_copied_string(optional_message));
+ grpc_slice_buffer_add(&t->qbuf, message_pfx);
+ grpc_slice_buffer_add(&t->qbuf,
+ grpc_slice_from_copied_string(optional_message));
}
- gpr_slice_buffer_add(
+ grpc_slice_buffer_add(
&t->qbuf, grpc_chttp2_rst_stream_create(s->id, GRPC_CHTTP2_NO_ERROR,
&s->stats.outgoing));
}
@@ -1686,7 +1686,7 @@ static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
free_msg = true;
msg = grpc_error_string(error);
}
- gpr_slice msg_slice = gpr_slice_from_copied_string(msg);
+ grpc_slice msg_slice = grpc_slice_from_copied_string(msg);
grpc_chttp2_fake_status(exec_ctx, t, s, grpc_status, &msg_slice);
if (free_msg) grpc_error_free_string(msg);
@@ -1857,7 +1857,7 @@ static void read_action_locked(grpc_exec_ctx *exec_ctx, void *tp,
keep_reading = true;
GRPC_CHTTP2_REF_TRANSPORT(t, "keep_reading");
}
- gpr_slice_buffer_reset_and_unref(&t->read_buffer);
+ grpc_slice_buffer_reset_and_unref(&t->read_buffer);
if (keep_reading) {
grpc_endpoint_read(exec_ctx, t->ep, &t->read_buffer, &t->read_action_begin);
@@ -1911,7 +1911,7 @@ static void incoming_byte_stream_unref(grpc_exec_ctx *exec_ctx,
grpc_chttp2_incoming_byte_stream *bs) {
if (gpr_unref(&bs->refs)) {
GRPC_ERROR_UNREF(bs->error);
- gpr_slice_buffer_destroy(&bs->slices);
+ grpc_slice_buffer_destroy(&bs->slices);
gpr_mu_destroy(&bs->slice_mu);
gpr_free(bs);
}
@@ -1973,7 +1973,7 @@ static void incoming_byte_stream_next_locked(grpc_exec_ctx *exec_ctx,
}
gpr_mu_lock(&bs->slice_mu);
if (bs->slices.count > 0) {
- *bs->next_action.slice = gpr_slice_buffer_take_first(&bs->slices);
+ *bs->next_action.slice = grpc_slice_buffer_take_first(&bs->slices);
grpc_closure_run(exec_ctx, bs->next_action.on_complete, GRPC_ERROR_NONE);
} else if (bs->error != GRPC_ERROR_NONE) {
grpc_closure_run(exec_ctx, bs->next_action.on_complete,
@@ -1988,7 +1988,7 @@ static void incoming_byte_stream_next_locked(grpc_exec_ctx *exec_ctx,
static int incoming_byte_stream_next(grpc_exec_ctx *exec_ctx,
grpc_byte_stream *byte_stream,
- gpr_slice *slice, size_t max_size_hint,
+ grpc_slice *slice, size_t max_size_hint,
grpc_closure *on_complete) {
GPR_TIMER_BEGIN("incoming_byte_stream_next", 0);
grpc_chttp2_incoming_byte_stream *bs =
@@ -2041,7 +2041,7 @@ static void incoming_byte_stream_publish_error(
void grpc_chttp2_incoming_byte_stream_push(grpc_exec_ctx *exec_ctx,
grpc_chttp2_incoming_byte_stream *bs,
- gpr_slice slice) {
+ grpc_slice slice) {
gpr_mu_lock(&bs->slice_mu);
if (bs->remaining_bytes < GPR_SLICE_LENGTH(slice)) {
incoming_byte_stream_publish_error(
@@ -2053,7 +2053,7 @@ void grpc_chttp2_incoming_byte_stream_push(grpc_exec_ctx *exec_ctx,
grpc_exec_ctx_sched(exec_ctx, bs->on_next, GRPC_ERROR_NONE, NULL);
bs->on_next = NULL;
} else {
- gpr_slice_buffer_add(&bs->slices, slice);
+ grpc_slice_buffer_add(&bs->slices, slice);
}
}
gpr_mu_unlock(&bs->slice_mu);
@@ -2091,7 +2091,7 @@ grpc_chttp2_incoming_byte_stream *grpc_chttp2_incoming_byte_stream_create(
incoming_byte_stream->transport = t;
incoming_byte_stream->stream = s;
gpr_ref(&incoming_byte_stream->stream->active_streams);
- gpr_slice_buffer_init(&incoming_byte_stream->slices);
+ grpc_slice_buffer_init(&incoming_byte_stream->slices);
incoming_byte_stream->on_next = NULL;
incoming_byte_stream->is_tail = 1;
incoming_byte_stream->error = GRPC_ERROR_NONE;
@@ -2159,7 +2159,7 @@ static void benign_reclaimer_locked(grpc_exec_ctx *exec_ctx, void *arg,
t->peer_string);
}
send_goaway(exec_ctx, t, GRPC_CHTTP2_ENHANCE_YOUR_CALM,
- gpr_slice_from_static_string("Buffers full"));
+ grpc_slice_from_static_string("Buffers full"));
} else if (error == GRPC_ERROR_NONE && grpc_resource_quota_trace) {
gpr_log(GPR_DEBUG,
"HTTP2: %s - skip benign reclamation, there are still %" PRIdPTR
@@ -2310,12 +2310,12 @@ grpc_transport *grpc_create_chttp2_transport(
void grpc_chttp2_transport_start_reading(grpc_exec_ctx *exec_ctx,
grpc_transport *transport,
- gpr_slice_buffer *read_buffer) {
+ grpc_slice_buffer *read_buffer) {
grpc_chttp2_transport *t = (grpc_chttp2_transport *)transport;
GRPC_CHTTP2_REF_TRANSPORT(
t, "reading_action"); /* matches unref inside reading_action */
if (read_buffer != NULL) {
- gpr_slice_buffer_move_into(read_buffer, &t->read_buffer);
+ grpc_slice_buffer_move_into(read_buffer, &t->read_buffer);
gpr_free(read_buffer);
}
read_action_begin(exec_ctx, t, GRPC_ERROR_NONE);
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/src/core/ext/transport/chttp2/transport/chttp2_transport.h
index 4e2d0954bf..c372174f2d 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.h
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.h
@@ -48,6 +48,6 @@ grpc_transport *grpc_create_chttp2_transport(
/// leftover bytes previously read from the endpoint (e.g., by handshakers).
void grpc_chttp2_transport_start_reading(grpc_exec_ctx *exec_ctx,
grpc_transport *transport,
- gpr_slice_buffer *read_buffer);
+ grpc_slice_buffer *read_buffer);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H */
diff --git a/src/core/ext/transport/chttp2/transport/frame_data.c b/src/core/ext/transport/chttp2/transport/frame_data.c
index 8668816930..3081a03929 100644
--- a/src/core/ext/transport/chttp2/transport/frame_data.c
+++ b/src/core/ext/transport/chttp2/transport/frame_data.c
@@ -112,15 +112,15 @@ grpc_byte_stream *grpc_chttp2_incoming_frame_queue_pop(
return out;
}
-void grpc_chttp2_encode_data(uint32_t id, gpr_slice_buffer *inbuf,
+void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer *inbuf,
uint32_t write_bytes, int is_eof,
grpc_transport_one_way_stats *stats,
- gpr_slice_buffer *outbuf) {
- gpr_slice hdr;
+ grpc_slice_buffer *outbuf) {
+ grpc_slice hdr;
uint8_t *p;
static const size_t header_size = 9;
- hdr = gpr_slice_malloc(header_size);
+ hdr = grpc_slice_malloc(header_size);
p = GPR_SLICE_START_PTR(hdr);
GPR_ASSERT(write_bytes < (1 << 24));
*p++ = (uint8_t)(write_bytes >> 16);
@@ -132,9 +132,9 @@ void grpc_chttp2_encode_data(uint32_t id, gpr_slice_buffer *inbuf,
*p++ = (uint8_t)(id >> 16);
*p++ = (uint8_t)(id >> 8);
*p++ = (uint8_t)(id);
- gpr_slice_buffer_add(outbuf, hdr);
+ grpc_slice_buffer_add(outbuf, hdr);
- gpr_slice_buffer_move_first(inbuf, write_bytes, outbuf);
+ grpc_slice_buffer_move_first(inbuf, write_bytes, outbuf);
stats->framing_bytes += header_size;
stats->data_bytes += write_bytes;
@@ -143,7 +143,7 @@ void grpc_chttp2_encode_data(uint32_t id, gpr_slice_buffer *inbuf,
static grpc_error *parse_inner(grpc_exec_ctx *exec_ctx,
grpc_chttp2_data_parser *p,
grpc_chttp2_transport *t, grpc_chttp2_stream *s,
- gpr_slice slice) {
+ grpc_slice slice) {
uint8_t *const beg = GPR_SLICE_START_PTR(slice);
uint8_t *const end = GPR_SLICE_END_PTR(slice);
uint8_t *cur = beg;
@@ -236,7 +236,7 @@ static grpc_error *parse_inner(grpc_exec_ctx *exec_ctx,
s->stats.incoming.data_bytes += p->frame_size;
grpc_chttp2_incoming_byte_stream_push(
exec_ctx, p->parsing_frame,
- gpr_slice_sub(slice, (size_t)(cur - beg), (size_t)(end - beg)));
+ grpc_slice_sub(slice, (size_t)(cur - beg), (size_t)(end - beg)));
grpc_chttp2_incoming_byte_stream_finished(exec_ctx, p->parsing_frame,
GRPC_ERROR_NONE);
p->parsing_frame = NULL;
@@ -246,7 +246,7 @@ static grpc_error *parse_inner(grpc_exec_ctx *exec_ctx,
s->stats.incoming.data_bytes += p->frame_size;
grpc_chttp2_incoming_byte_stream_push(
exec_ctx, p->parsing_frame,
- gpr_slice_sub(slice, (size_t)(cur - beg),
+ grpc_slice_sub(slice, (size_t)(cur - beg),
(size_t)(cur + p->frame_size - beg)));
grpc_chttp2_incoming_byte_stream_finished(exec_ctx, p->parsing_frame,
GRPC_ERROR_NONE);
@@ -257,7 +257,7 @@ static grpc_error *parse_inner(grpc_exec_ctx *exec_ctx,
GPR_ASSERT(remaining <= p->frame_size);
grpc_chttp2_incoming_byte_stream_push(
exec_ctx, p->parsing_frame,
- gpr_slice_sub(slice, (size_t)(cur - beg), (size_t)(end - beg)));
+ grpc_slice_sub(slice, (size_t)(cur - beg), (size_t)(end - beg)));
p->frame_size -= remaining;
s->stats.incoming.data_bytes += remaining;
return GRPC_ERROR_NONE;
@@ -270,7 +270,7 @@ static grpc_error *parse_inner(grpc_exec_ctx *exec_ctx,
grpc_error *grpc_chttp2_data_parser_parse(grpc_exec_ctx *exec_ctx, void *parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last) {
+ grpc_slice slice, int is_last) {
grpc_chttp2_data_parser *p = parser;
grpc_error *error = parse_inner(exec_ctx, p, t, s, slice);
diff --git a/src/core/ext/transport/chttp2/transport/frame_data.h b/src/core/ext/transport/chttp2/transport/frame_data.h
index eb2d97d898..471f615c67 100644
--- a/src/core/ext/transport/chttp2/transport/frame_data.h
+++ b/src/core/ext/transport/chttp2/transport/frame_data.h
@@ -94,11 +94,11 @@ grpc_error *grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser *parser,
grpc_error *grpc_chttp2_data_parser_parse(grpc_exec_ctx *exec_ctx, void *parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last);
+ grpc_slice slice, int is_last);
-void grpc_chttp2_encode_data(uint32_t id, gpr_slice_buffer *inbuf,
+void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer *inbuf,
uint32_t write_bytes, int is_eof,
grpc_transport_one_way_stats *stats,
- gpr_slice_buffer *outbuf);
+ grpc_slice_buffer *outbuf);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */
diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.c b/src/core/ext/transport/chttp2/transport/frame_goaway.c
index 33d2269169..16c6819aca 100644
--- a/src/core/ext/transport/chttp2/transport/frame_goaway.c
+++ b/src/core/ext/transport/chttp2/transport/frame_goaway.c
@@ -71,7 +71,7 @@ grpc_error *grpc_chttp2_goaway_parser_parse(grpc_exec_ctx *exec_ctx,
void *parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last) {
+ grpc_slice slice, int is_last) {
uint8_t *const beg = GPR_SLICE_START_PTR(slice);
uint8_t *const end = GPR_SLICE_END_PTR(slice);
uint8_t *cur = beg;
@@ -151,7 +151,7 @@ grpc_error *grpc_chttp2_goaway_parser_parse(grpc_exec_ctx *exec_ctx,
if (is_last) {
grpc_chttp2_add_incoming_goaway(
exec_ctx, t, (uint32_t)p->error_code,
- gpr_slice_new(p->debug_data, p->debug_length, gpr_free));
+ grpc_slice_new(p->debug_data, p->debug_length, gpr_free));
p->debug_data = NULL;
}
return GRPC_ERROR_NONE;
@@ -160,9 +160,9 @@ grpc_error *grpc_chttp2_goaway_parser_parse(grpc_exec_ctx *exec_ctx,
}
void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code,
- gpr_slice debug_data,
- gpr_slice_buffer *slice_buffer) {
- gpr_slice header = gpr_slice_malloc(9 + 4 + 4);
+ grpc_slice debug_data,
+ grpc_slice_buffer *slice_buffer) {
+ grpc_slice header = grpc_slice_malloc(9 + 4 + 4);
uint8_t *p = GPR_SLICE_START_PTR(header);
uint32_t frame_length;
GPR_ASSERT(GPR_SLICE_LENGTH(debug_data) < UINT32_MAX - 4 - 4);
@@ -192,6 +192,6 @@ void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code,
*p++ = (uint8_t)(error_code >> 8);
*p++ = (uint8_t)(error_code);
GPR_ASSERT(p == GPR_SLICE_END_PTR(header));
- gpr_slice_buffer_add(slice_buffer, header);
- gpr_slice_buffer_add(slice_buffer, debug_data);
+ grpc_slice_buffer_add(slice_buffer, header);
+ grpc_slice_buffer_add(slice_buffer, debug_data);
}
diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.h b/src/core/ext/transport/chttp2/transport/frame_goaway.h
index 355104a5a7..c2b82d85b3 100644
--- a/src/core/ext/transport/chttp2/transport/frame_goaway.h
+++ b/src/core/ext/transport/chttp2/transport/frame_goaway.h
@@ -69,10 +69,10 @@ grpc_error *grpc_chttp2_goaway_parser_parse(grpc_exec_ctx *exec_ctx,
void *parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last);
+ grpc_slice slice, int is_last);
void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code,
- gpr_slice debug_data,
- gpr_slice_buffer *slice_buffer);
+ grpc_slice debug_data,
+ grpc_slice_buffer *slice_buffer);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H */
diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.c b/src/core/ext/transport/chttp2/transport/frame_ping.c
index 624f42649d..f8d73539ae 100644
--- a/src/core/ext/transport/chttp2/transport/frame_ping.c
+++ b/src/core/ext/transport/chttp2/transport/frame_ping.c
@@ -40,8 +40,8 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-gpr_slice grpc_chttp2_ping_create(uint8_t ack, uint8_t *opaque_8bytes) {
- gpr_slice slice = gpr_slice_malloc(9 + 8);
+grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint8_t *opaque_8bytes) {
+ grpc_slice slice = grpc_slice_malloc(9 + 8);
uint8_t *p = GPR_SLICE_START_PTR(slice);
*p++ = 0;
@@ -76,7 +76,7 @@ grpc_error *grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser *parser,
grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last) {
+ grpc_slice slice, int is_last) {
uint8_t *const beg = GPR_SLICE_START_PTR(slice);
uint8_t *const end = GPR_SLICE_END_PTR(slice);
uint8_t *cur = beg;
@@ -93,7 +93,7 @@ grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser,
if (p->is_ack) {
grpc_chttp2_ack_ping(exec_ctx, t, p->opaque_8bytes);
} else {
- gpr_slice_buffer_add(&t->qbuf,
+ grpc_slice_buffer_add(&t->qbuf,
grpc_chttp2_ping_create(1, p->opaque_8bytes));
grpc_chttp2_initiate_write(exec_ctx, t, false, "ping response");
}
diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.h b/src/core/ext/transport/chttp2/transport/frame_ping.h
index 2071f647fb..dcc95db4ca 100644
--- a/src/core/ext/transport/chttp2/transport/frame_ping.h
+++ b/src/core/ext/transport/chttp2/transport/frame_ping.h
@@ -44,13 +44,13 @@ typedef struct {
uint8_t opaque_8bytes[8];
} grpc_chttp2_ping_parser;
-gpr_slice grpc_chttp2_ping_create(uint8_t ack, uint8_t *opaque_8bytes);
+grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint8_t *opaque_8bytes);
grpc_error *grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser *parser,
uint32_t length, uint8_t flags);
grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last);
+ grpc_slice slice, int is_last);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H */
diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.c b/src/core/ext/transport/chttp2/transport/frame_rst_stream.c
index 9eac050797..7def454915 100644
--- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.c
+++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.c
@@ -42,10 +42,10 @@
#include "src/core/ext/transport/chttp2/transport/http2_errors.h"
#include "src/core/ext/transport/chttp2/transport/status_conversion.h"
-gpr_slice grpc_chttp2_rst_stream_create(uint32_t id, uint32_t code,
+grpc_slice grpc_chttp2_rst_stream_create(uint32_t id, uint32_t code,
grpc_transport_one_way_stats *stats) {
static const size_t frame_size = 13;
- gpr_slice slice = gpr_slice_malloc(frame_size);
+ grpc_slice slice = grpc_slice_malloc(frame_size);
stats->framing_bytes += frame_size;
uint8_t *p = GPR_SLICE_START_PTR(slice);
@@ -89,7 +89,7 @@ grpc_error *grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx *exec_ctx,
void *parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last) {
+ grpc_slice slice, int is_last) {
uint8_t *const beg = GPR_SLICE_START_PTR(slice);
uint8_t *const end = GPR_SLICE_END_PTR(slice);
uint8_t *cur = beg;
@@ -117,7 +117,7 @@ grpc_error *grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx *exec_ctx,
char *status_details;
gpr_asprintf(&status_details, "Received RST_STREAM with error code %d",
reason);
- gpr_slice slice_details = gpr_slice_from_copied_string(status_details);
+ grpc_slice slice_details = grpc_slice_from_copied_string(status_details);
gpr_free(status_details);
grpc_chttp2_fake_status(exec_ctx, t, s, status_code, &slice_details);
}
diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
index 5a1f578a29..d837e95da4 100644
--- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
+++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
@@ -44,7 +44,7 @@ typedef struct {
uint8_t reason_bytes[4];
} grpc_chttp2_rst_stream_parser;
-gpr_slice grpc_chttp2_rst_stream_create(uint32_t stream_id, uint32_t code,
+grpc_slice grpc_chttp2_rst_stream_create(uint32_t stream_id, uint32_t code,
grpc_transport_one_way_stats *stats);
grpc_error *grpc_chttp2_rst_stream_parser_begin_frame(
@@ -53,6 +53,6 @@ grpc_error *grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx *exec_ctx,
void *parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last);
+ grpc_slice slice, int is_last);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H */
diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.c b/src/core/ext/transport/chttp2/transport/frame_settings.c
index 92022f90c9..d9ea1f91a7 100644
--- a/src/core/ext/transport/chttp2/transport/frame_settings.c
+++ b/src/core/ext/transport/chttp2/transport/frame_settings.c
@@ -82,18 +82,18 @@ static uint8_t *fill_header(uint8_t *out, uint32_t length, uint8_t flags) {
return out;
}
-gpr_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *new,
+grpc_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *new,
uint32_t force_mask, size_t count) {
size_t i;
uint32_t n = 0;
- gpr_slice output;
+ grpc_slice output;
uint8_t *p;
for (i = 0; i < count; i++) {
n += (new[i] != old[i] || (force_mask & (1u << i)) != 0);
}
- output = gpr_slice_malloc(9 + 6 * n);
+ output = grpc_slice_malloc(9 + 6 * n);
p = fill_header(GPR_SLICE_START_PTR(output), 6 * n, 0);
for (i = 0; i < count; i++) {
@@ -114,8 +114,8 @@ gpr_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *new,
return output;
}
-gpr_slice grpc_chttp2_settings_ack_create(void) {
- gpr_slice output = gpr_slice_malloc(9);
+grpc_slice grpc_chttp2_settings_ack_create(void) {
+ grpc_slice output = grpc_slice_malloc(9);
fill_header(GPR_SLICE_START_PTR(output), 0, GRPC_CHTTP2_FLAG_ACK);
return output;
}
@@ -146,7 +146,7 @@ grpc_error *grpc_chttp2_settings_parser_begin_frame(
grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx, void *p,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last) {
+ grpc_slice slice, int is_last) {
grpc_chttp2_settings_parser *parser = p;
const uint8_t *cur = GPR_SLICE_START_PTR(slice);
const uint8_t *end = GPR_SLICE_END_PTR(slice);
@@ -164,7 +164,7 @@ grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx, void *p,
if (is_last) {
memcpy(parser->target_settings, parser->incoming_settings,
GRPC_CHTTP2_NUM_SETTINGS * sizeof(uint32_t));
- gpr_slice_buffer_add(&t->qbuf, grpc_chttp2_settings_ack_create());
+ grpc_slice_buffer_add(&t->qbuf, grpc_chttp2_settings_ack_create());
}
return GRPC_ERROR_NONE;
}
@@ -225,7 +225,7 @@ grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx, void *p,
case GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE:
grpc_chttp2_goaway_append(
t->last_new_stream_id, sp->error_value,
- gpr_slice_from_static_string("HTTP2 settings error"),
+ grpc_slice_from_static_string("HTTP2 settings error"),
&t->qbuf);
gpr_asprintf(&msg, "invalid value %u passed for %s",
parser->value, sp->name);
diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.h b/src/core/ext/transport/chttp2/transport/frame_settings.h
index 4bfa944cf1..cb2c8de0a0 100644
--- a/src/core/ext/transport/chttp2/transport/frame_settings.h
+++ b/src/core/ext/transport/chttp2/transport/frame_settings.h
@@ -87,10 +87,10 @@ extern const grpc_chttp2_setting_parameters
grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS];
/* Create a settings frame by diffing old & new, and updating old to be new */
-gpr_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *new,
+grpc_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *new,
uint32_t force_mask, size_t count);
/* Create an ack settings frame */
-gpr_slice grpc_chttp2_settings_ack_create(void);
+grpc_slice grpc_chttp2_settings_ack_create(void);
grpc_error *grpc_chttp2_settings_parser_begin_frame(
grpc_chttp2_settings_parser *parser, uint32_t length, uint8_t flags,
@@ -99,6 +99,6 @@ grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx,
void *parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last);
+ grpc_slice slice, int is_last);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H */
diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.c b/src/core/ext/transport/chttp2/transport/frame_window_update.c
index 418166a6df..b32f1403e1 100644
--- a/src/core/ext/transport/chttp2/transport/frame_window_update.c
+++ b/src/core/ext/transport/chttp2/transport/frame_window_update.c
@@ -38,10 +38,10 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-gpr_slice grpc_chttp2_window_update_create(
+grpc_slice grpc_chttp2_window_update_create(
uint32_t id, uint32_t window_update, grpc_transport_one_way_stats *stats) {
static const size_t frame_size = 13;
- gpr_slice slice = gpr_slice_malloc(frame_size);
+ grpc_slice slice = grpc_slice_malloc(frame_size);
stats->header_bytes += frame_size;
uint8_t *p = GPR_SLICE_START_PTR(slice);
@@ -81,7 +81,7 @@ grpc_error *grpc_chttp2_window_update_parser_begin_frame(
grpc_error *grpc_chttp2_window_update_parser_parse(
grpc_exec_ctx *exec_ctx, void *parser, grpc_chttp2_transport *t,
- grpc_chttp2_stream *s, gpr_slice slice, int is_last) {
+ grpc_chttp2_stream *s, grpc_slice slice, int is_last) {
uint8_t *const beg = GPR_SLICE_START_PTR(slice);
uint8_t *const end = GPR_SLICE_END_PTR(slice);
uint8_t *cur = beg;
diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.h b/src/core/ext/transport/chttp2/transport/frame_window_update.h
index 6e62f31872..b0f6a0a9d0 100644
--- a/src/core/ext/transport/chttp2/transport/frame_window_update.h
+++ b/src/core/ext/transport/chttp2/transport/frame_window_update.h
@@ -45,13 +45,13 @@ typedef struct {
uint32_t amount;
} grpc_chttp2_window_update_parser;
-gpr_slice grpc_chttp2_window_update_create(uint32_t id, uint32_t window_delta,
+grpc_slice grpc_chttp2_window_update_create(uint32_t id, uint32_t window_delta,
grpc_transport_one_way_stats *stats);
grpc_error *grpc_chttp2_window_update_parser_begin_frame(
grpc_chttp2_window_update_parser *parser, uint32_t length, uint8_t flags);
grpc_error *grpc_chttp2_window_update_parser_parse(
grpc_exec_ctx *exec_ctx, void *parser, grpc_chttp2_transport *t,
- grpc_chttp2_stream *s, gpr_slice slice, int is_last);
+ grpc_chttp2_stream *s, grpc_slice slice, int is_last);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H */
diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.c b/src/core/ext/transport/chttp2/transport/hpack_encoder.c
index 581471ba02..d8de7d0719 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_encoder.c
+++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.c
@@ -76,7 +76,7 @@ typedef struct {
uint8_t seen_regular_header;
/* output stream id */
uint32_t stream_id;
- gpr_slice_buffer *output;
+ grpc_slice_buffer *output;
grpc_transport_one_way_stats *stats;
/* maximum size of a frame */
size_t max_frame_size;
@@ -116,7 +116,7 @@ static void finish_frame(framer_state *st, int is_header_boundary,
output before beginning */
static void begin_frame(framer_state *st) {
st->header_idx =
- gpr_slice_buffer_add_indexed(st->output, gpr_slice_malloc(9));
+ grpc_slice_buffer_add_indexed(st->output, grpc_slice_malloc(9));
st->output_length_at_start_of_frame = st->output->length;
}
@@ -147,7 +147,7 @@ static void inc_filter(uint8_t idx, uint32_t *sum, uint8_t *elems) {
}
}
-static void add_header_data(framer_state *st, gpr_slice slice) {
+static void add_header_data(framer_state *st, grpc_slice slice) {
size_t len = GPR_SLICE_LENGTH(slice);
size_t remaining;
if (len == 0) return;
@@ -155,10 +155,10 @@ static void add_header_data(framer_state *st, gpr_slice slice) {
st->output->length;
if (len <= remaining) {
st->stats->header_bytes += len;
- gpr_slice_buffer_add(st->output, slice);
+ grpc_slice_buffer_add(st->output, slice);
} else {
st->stats->header_bytes += remaining;
- gpr_slice_buffer_add(st->output, gpr_slice_split_head(&slice, remaining));
+ grpc_slice_buffer_add(st->output, grpc_slice_split_head(&slice, remaining));
finish_frame(st, 0, 0);
begin_frame(st);
add_header_data(st, slice);
@@ -167,7 +167,7 @@ static void add_header_data(framer_state *st, gpr_slice slice) {
static uint8_t *add_tiny_header_data(framer_state *st, size_t len) {
ensure_space(st, len);
- return gpr_slice_buffer_tiny_add(st->output, len);
+ return grpc_slice_buffer_tiny_add(st->output, len);
}
static void evict_entry(grpc_chttp2_hpack_compressor *c) {
@@ -268,7 +268,7 @@ static void emit_indexed(grpc_chttp2_hpack_compressor *c, uint32_t elem_index,
len);
}
-static gpr_slice get_wire_value(grpc_mdelem *elem, uint8_t *huffman_prefix) {
+static grpc_slice get_wire_value(grpc_mdelem *elem, uint8_t *huffman_prefix) {
if (grpc_is_binary_header((const char *)GPR_SLICE_START_PTR(elem->key->slice),
GPR_SLICE_LENGTH(elem->key->slice))) {
*huffman_prefix = 0x80;
@@ -284,7 +284,7 @@ static void emit_lithdr_incidx(grpc_chttp2_hpack_compressor *c,
framer_state *st) {
uint32_t len_pfx = GRPC_CHTTP2_VARINT_LENGTH(key_index, 2);
uint8_t huffman_prefix;
- gpr_slice value_slice = get_wire_value(elem, &huffman_prefix);
+ grpc_slice value_slice = get_wire_value(elem, &huffman_prefix);
size_t len_val = GPR_SLICE_LENGTH(value_slice);
uint32_t len_val_len;
GPR_ASSERT(len_val <= UINT32_MAX);
@@ -293,7 +293,7 @@ static void emit_lithdr_incidx(grpc_chttp2_hpack_compressor *c,
add_tiny_header_data(st, len_pfx), len_pfx);
GRPC_CHTTP2_WRITE_VARINT((uint32_t)len_val, 1, huffman_prefix,
add_tiny_header_data(st, len_val_len), len_val_len);
- add_header_data(st, gpr_slice_ref(value_slice));
+ add_header_data(st, grpc_slice_ref(value_slice));
}
static void emit_lithdr_noidx(grpc_chttp2_hpack_compressor *c,
@@ -301,7 +301,7 @@ static void emit_lithdr_noidx(grpc_chttp2_hpack_compressor *c,
framer_state *st) {
uint32_t len_pfx = GRPC_CHTTP2_VARINT_LENGTH(key_index, 4);
uint8_t huffman_prefix;
- gpr_slice value_slice = get_wire_value(elem, &huffman_prefix);
+ grpc_slice value_slice = get_wire_value(elem, &huffman_prefix);
size_t len_val = GPR_SLICE_LENGTH(value_slice);
uint32_t len_val_len;
GPR_ASSERT(len_val <= UINT32_MAX);
@@ -310,14 +310,14 @@ static void emit_lithdr_noidx(grpc_chttp2_hpack_compressor *c,
add_tiny_header_data(st, len_pfx), len_pfx);
GRPC_CHTTP2_WRITE_VARINT((uint32_t)len_val, 1, huffman_prefix,
add_tiny_header_data(st, len_val_len), len_val_len);
- add_header_data(st, gpr_slice_ref(value_slice));
+ add_header_data(st, grpc_slice_ref(value_slice));
}
static void emit_lithdr_incidx_v(grpc_chttp2_hpack_compressor *c,
grpc_mdelem *elem, framer_state *st) {
uint32_t len_key = (uint32_t)GPR_SLICE_LENGTH(elem->key->slice);
uint8_t huffman_prefix;
- gpr_slice value_slice = get_wire_value(elem, &huffman_prefix);
+ grpc_slice value_slice = get_wire_value(elem, &huffman_prefix);
uint32_t len_val = (uint32_t)GPR_SLICE_LENGTH(value_slice);
uint32_t len_key_len = GRPC_CHTTP2_VARINT_LENGTH(len_key, 1);
uint32_t len_val_len = GRPC_CHTTP2_VARINT_LENGTH(len_val, 1);
@@ -326,17 +326,17 @@ static void emit_lithdr_incidx_v(grpc_chttp2_hpack_compressor *c,
*add_tiny_header_data(st, 1) = 0x40;
GRPC_CHTTP2_WRITE_VARINT(len_key, 1, 0x00,
add_tiny_header_data(st, len_key_len), len_key_len);
- add_header_data(st, gpr_slice_ref(elem->key->slice));
+ add_header_data(st, grpc_slice_ref(elem->key->slice));
GRPC_CHTTP2_WRITE_VARINT(len_val, 1, huffman_prefix,
add_tiny_header_data(st, len_val_len), len_val_len);
- add_header_data(st, gpr_slice_ref(value_slice));
+ add_header_data(st, grpc_slice_ref(value_slice));
}
static void emit_lithdr_noidx_v(grpc_chttp2_hpack_compressor *c,
grpc_mdelem *elem, framer_state *st) {
uint32_t len_key = (uint32_t)GPR_SLICE_LENGTH(elem->key->slice);
uint8_t huffman_prefix;
- gpr_slice value_slice = get_wire_value(elem, &huffman_prefix);
+ grpc_slice value_slice = get_wire_value(elem, &huffman_prefix);
uint32_t len_val = (uint32_t)GPR_SLICE_LENGTH(value_slice);
uint32_t len_key_len = GRPC_CHTTP2_VARINT_LENGTH(len_key, 1);
uint32_t len_val_len = GRPC_CHTTP2_VARINT_LENGTH(len_val, 1);
@@ -345,10 +345,10 @@ static void emit_lithdr_noidx_v(grpc_chttp2_hpack_compressor *c,
*add_tiny_header_data(st, 1) = 0x00;
GRPC_CHTTP2_WRITE_VARINT(len_key, 1, 0x00,
add_tiny_header_data(st, len_key_len), len_key_len);
- add_header_data(st, gpr_slice_ref(elem->key->slice));
+ add_header_data(st, grpc_slice_ref(elem->key->slice));
GRPC_CHTTP2_WRITE_VARINT(len_val, 1, huffman_prefix,
add_tiny_header_data(st, len_val_len), len_val_len);
- add_header_data(st, gpr_slice_ref(value_slice));
+ add_header_data(st, grpc_slice_ref(value_slice));
}
static void emit_advertise_table_size_change(grpc_chttp2_hpack_compressor *c,
@@ -546,7 +546,7 @@ void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor *c,
grpc_metadata_batch *metadata, int is_eof,
size_t max_frame_size,
grpc_transport_one_way_stats *stats,
- gpr_slice_buffer *outbuf) {
+ grpc_slice_buffer *outbuf) {
framer_state st;
grpc_linked_mdelem *l;
gpr_timespec deadline;
diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h
index 4c3a931549..abbd514fc2 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h
@@ -93,6 +93,6 @@ void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor *c, uint32_t id,
grpc_metadata_batch *metadata, int is_eof,
size_t max_frame_size,
grpc_transport_one_way_stats *stats,
- gpr_slice_buffer *outbuf);
+ grpc_slice_buffer *outbuf);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */
diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.c b/src/core/ext/transport/chttp2/transport/hpack_parser.c
index 8180f78fc0..0e721b181a 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_parser.c
+++ b/src/core/ext/transport/chttp2/transport/hpack_parser.c
@@ -1582,7 +1582,7 @@ grpc_error *grpc_chttp2_header_parser_parse(grpc_exec_ctx *exec_ctx,
void *hpack_parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last) {
+ grpc_slice slice, int is_last) {
grpc_chttp2_hpack_parser *parser = hpack_parser;
GPR_TIMER_BEGIN("grpc_chttp2_hpack_parser_parse", 0);
if (s != NULL) {
diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.h b/src/core/ext/transport/chttp2/transport/hpack_parser.h
index 0290c78d5a..a39bf466cd 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_parser.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_parser.h
@@ -116,6 +116,6 @@ grpc_error *grpc_chttp2_header_parser_parse(grpc_exec_ctx *exec_ctx,
void *hpack_parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
- gpr_slice slice, int is_last);
+ grpc_slice slice, int is_last);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H */
diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h
index e0c4a1e925..18fa2b4890 100644
--- a/src/core/ext/transport/chttp2/transport/internal.h
+++ b/src/core/ext/transport/chttp2/transport/internal.h
@@ -170,14 +170,14 @@ struct grpc_chttp2_incoming_byte_stream {
bool is_tail;
gpr_mu slice_mu; // protects slices, on_next
- gpr_slice_buffer slices;
+ grpc_slice_buffer slices;
grpc_closure *on_next;
- gpr_slice *next;
+ grpc_slice *next;
uint32_t remaining_bytes;
struct {
grpc_closure closure;
- gpr_slice *slice;
+ grpc_slice *slice;
size_t max_size_hint;
grpc_closure *on_complete;
} next_action;
@@ -219,7 +219,7 @@ struct grpc_chttp2_transport {
grpc_closure read_action_locked;
/** incoming read bytes */
- gpr_slice_buffer read_buffer;
+ grpc_slice_buffer read_buffer;
/** address to place a newly accepted stream - set and unset by
grpc_chttp2_parsing_accept_stream; used by init_stream to
@@ -237,7 +237,7 @@ struct grpc_chttp2_transport {
} channel_callback;
/** data to write now */
- gpr_slice_buffer outbuf;
+ grpc_slice_buffer outbuf;
/** hpack encoding */
grpc_chttp2_hpack_compressor hpack_compressor;
int64_t outgoing_window;
@@ -245,7 +245,7 @@ struct grpc_chttp2_transport {
uint8_t is_client;
/** data to write next write */
- gpr_slice_buffer qbuf;
+ grpc_slice_buffer qbuf;
/** window available to announce to peer */
int64_t announce_incoming_window;
@@ -314,12 +314,12 @@ struct grpc_chttp2_transport {
grpc_chttp2_stream *incoming_stream;
grpc_error *(*parser)(grpc_exec_ctx *exec_ctx, void *parser_user_data,
grpc_chttp2_transport *t, grpc_chttp2_stream *s,
- gpr_slice slice, int is_last);
+ grpc_slice slice, int is_last);
/* goaway data */
grpc_status_code goaway_error;
uint32_t goaway_last_stream_index;
- gpr_slice goaway_text;
+ grpc_slice goaway_text;
grpc_chttp2_write_cb *write_cb_pool;
@@ -374,7 +374,7 @@ struct grpc_chttp2_stream {
grpc_byte_stream *fetching_send_message;
uint32_t fetched_send_message_length;
- gpr_slice fetching_slice;
+ grpc_slice fetching_slice;
int64_t next_message_end_offset;
int64_t flow_controlled_bytes_written;
bool complete_fetch_covered_by_poller;
@@ -434,7 +434,7 @@ struct grpc_chttp2_stream {
bool sent_trailing_metadata;
/** how much window should we announce? */
uint32_t announce_window;
- gpr_slice_buffer flow_controlled_buffer;
+ grpc_slice_buffer flow_controlled_buffer;
grpc_chttp2_write_cb *on_write_finished_cbs;
grpc_chttp2_write_cb *finish_after_write;
@@ -466,7 +466,7 @@ void grpc_chttp2_end_write(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
/** Process one slice of incoming data; return 1 if the connection is still
viable after reading, or 0 if the connection should be torn down */
grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
- grpc_chttp2_transport *t, gpr_slice slice);
+ grpc_chttp2_transport *t, grpc_slice slice);
bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport *t,
grpc_chttp2_stream *s);
@@ -509,7 +509,7 @@ grpc_chttp2_stream *grpc_chttp2_parsing_accept_stream(grpc_exec_ctx *exec_ctx,
void grpc_chttp2_add_incoming_goaway(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t,
uint32_t goaway_error,
- gpr_slice goaway_text);
+ grpc_slice goaway_text);
void grpc_chttp2_parsing_become_skip_parser(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t);
@@ -611,7 +611,7 @@ void grpc_chttp2_flowctl_trace(const char *file, int line, const char *phase,
void grpc_chttp2_fake_status(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
grpc_chttp2_stream *stream,
- grpc_status_code status, gpr_slice *details);
+ grpc_status_code status, grpc_slice *details);
void grpc_chttp2_mark_stream_closed(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s, int close_reads,
@@ -659,7 +659,7 @@ grpc_chttp2_incoming_byte_stream *grpc_chttp2_incoming_byte_stream_create(
uint32_t frame_size, uint32_t flags);
void grpc_chttp2_incoming_byte_stream_push(grpc_exec_ctx *exec_ctx,
grpc_chttp2_incoming_byte_stream *bs,
- gpr_slice slice);
+ grpc_slice slice);
void grpc_chttp2_incoming_byte_stream_finished(
grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs,
grpc_error *error);
diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.c
index 8005350ae7..6941a1e397 100644
--- a/src/core/ext/transport/chttp2/transport/parsing.c
+++ b/src/core/ext/transport/chttp2/transport/parsing.c
@@ -67,12 +67,12 @@ static grpc_error *init_skip_frame_parser(grpc_exec_ctx *exec_ctx,
int is_header);
static grpc_error *parse_frame_slice(grpc_exec_ctx *exec_ctx,
- grpc_chttp2_transport *t, gpr_slice slice,
+ grpc_chttp2_transport *t, grpc_slice slice,
int is_last);
grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t,
- gpr_slice slice) {
+ grpc_slice slice) {
uint8_t *beg = GPR_SLICE_START_PTR(slice);
uint8_t *end = GPR_SLICE_END_PTR(slice);
uint8_t *cur = beg;
@@ -230,7 +230,7 @@ grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
GPR_ASSERT(cur < end);
if ((uint32_t)(end - cur) == t->incoming_frame_size) {
err = parse_frame_slice(exec_ctx, t,
- gpr_slice_sub_no_ref(slice, (size_t)(cur - beg),
+ grpc_slice_sub_no_ref(slice, (size_t)(cur - beg),
(size_t)(end - beg)),
1);
if (err != GRPC_ERROR_NONE) {
@@ -243,7 +243,7 @@ grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
size_t cur_offset = (size_t)(cur - beg);
err = parse_frame_slice(
exec_ctx, t,
- gpr_slice_sub_no_ref(slice, cur_offset,
+ grpc_slice_sub_no_ref(slice, cur_offset,
cur_offset + t->incoming_frame_size),
1);
if (err != GRPC_ERROR_NONE) {
@@ -254,7 +254,7 @@ grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
goto dts_fh_0; /* loop */
} else {
err = parse_frame_slice(exec_ctx, t,
- gpr_slice_sub_no_ref(slice, (size_t)(cur - beg),
+ grpc_slice_sub_no_ref(slice, (size_t)(cur - beg),
(size_t)(end - beg)),
0);
if (err != GRPC_ERROR_NONE) {
@@ -331,7 +331,7 @@ static grpc_error *init_frame_parser(grpc_exec_ctx *exec_ctx,
static grpc_error *skip_parser(grpc_exec_ctx *exec_ctx, void *parser,
grpc_chttp2_transport *t, grpc_chttp2_stream *s,
- gpr_slice slice, int is_last) {
+ grpc_slice slice, int is_last) {
return GRPC_ERROR_NONE;
}
@@ -430,7 +430,7 @@ error_handler:
if (s != NULL) {
grpc_chttp2_mark_stream_closed(exec_ctx, t, s, true, false, err);
}
- gpr_slice_buffer_add(
+ grpc_slice_buffer_add(
&t->qbuf, grpc_chttp2_rst_stream_create(t->incoming_stream_id,
GRPC_CHTTP2_PROTOCOL_ERROR,
&s->stats.outgoing));
@@ -722,7 +722,7 @@ static grpc_error *init_settings_frame_parser(grpc_exec_ctx *exec_ctx,
}
static grpc_error *parse_frame_slice(grpc_exec_ctx *exec_ctx,
- grpc_chttp2_transport *t, gpr_slice slice,
+ grpc_chttp2_transport *t, grpc_slice slice,
int is_last) {
grpc_chttp2_stream *s = t->incoming_stream;
grpc_error *err = t->parser(exec_ctx, t->parser_data, t, s, slice, is_last);
@@ -737,7 +737,7 @@ static grpc_error *parse_frame_slice(grpc_exec_ctx *exec_ctx,
grpc_chttp2_parsing_become_skip_parser(exec_ctx, t);
if (s) {
s->forced_close_error = err;
- gpr_slice_buffer_add(
+ grpc_slice_buffer_add(
&t->qbuf, grpc_chttp2_rst_stream_create(t->incoming_stream_id,
GRPC_CHTTP2_PROTOCOL_ERROR,
&s->stats.outgoing));
diff --git a/src/core/ext/transport/chttp2/transport/writing.c b/src/core/ext/transport/chttp2/transport/writing.c
index b39695a1a5..1486a7edb4 100644
--- a/src/core/ext/transport/chttp2/transport/writing.c
+++ b/src/core/ext/transport/chttp2/transport/writing.c
@@ -80,7 +80,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
GPR_TIMER_BEGIN("grpc_chttp2_begin_write", 0);
if (t->dirtied_local_settings && !t->sent_local_settings) {
- gpr_slice_buffer_add(
+ grpc_slice_buffer_add(
&t->outbuf,
grpc_chttp2_settings_create(
t->settings[GRPC_SENT_SETTINGS], t->settings[GRPC_LOCAL_SETTINGS],
@@ -91,7 +91,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
}
/* simple writes are queued to qbuf, and flushed here */
- gpr_slice_buffer_move_into(&t->qbuf, &t->outbuf);
+ grpc_slice_buffer_move_into(&t->qbuf, &t->outbuf);
GPR_ASSERT(t->qbuf.count == 0);
grpc_chttp2_hpack_compressor_set_max_table_size(
@@ -130,7 +130,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
/* send any window updates */
if (s->announce_window > 0) {
uint32_t announce = s->announce_window;
- gpr_slice_buffer_add(&t->outbuf,
+ grpc_slice_buffer_add(&t->outbuf,
grpc_chttp2_window_update_create(
s->id, s->announce_window, &s->stats.outgoing));
GRPC_CHTTP2_FLOW_DEBIT_STREAM("write", t, s, announce_window, announce);
@@ -162,7 +162,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
s->send_trailing_metadata = NULL;
s->sent_trailing_metadata = true;
if (!t->is_client && !s->read_closed) {
- gpr_slice_buffer_add(&t->outbuf, grpc_chttp2_rst_stream_create(
+ grpc_slice_buffer_add(&t->outbuf, grpc_chttp2_rst_stream_create(
s->id, GRPC_CHTTP2_NO_ERROR,
&s->stats.outgoing));
}
@@ -194,7 +194,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
s->send_trailing_metadata = NULL;
s->sent_trailing_metadata = true;
if (!t->is_client && !s->read_closed) {
- gpr_slice_buffer_add(
+ grpc_slice_buffer_add(
&t->outbuf, grpc_chttp2_rst_stream_create(
s->id, GRPC_CHTTP2_NO_ERROR, &s->stats.outgoing));
}
@@ -220,7 +220,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
GRPC_CHTTP2_FLOW_DEBIT_TRANSPORT("write", t, announce_incoming_window,
announced);
grpc_transport_one_way_stats throwaway_stats;
- gpr_slice_buffer_add(&t->outbuf, grpc_chttp2_window_update_create(
+ grpc_slice_buffer_add(&t->outbuf, grpc_chttp2_window_update_create(
0, announced, &throwaway_stats));
}
@@ -254,7 +254,7 @@ void grpc_chttp2_end_write(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
}
GRPC_CHTTP2_STREAM_UNREF(exec_ctx, s, "chttp2_writing:end");
}
- gpr_slice_buffer_reset_and_unref(&t->outbuf);
+ grpc_slice_buffer_reset_and_unref(&t->outbuf);
GRPC_ERROR_UNREF(error);
GPR_TIMER_END("grpc_chttp2_end_write", 0);
}
diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c
index 25ad40b935..87b2c0880f 100644
--- a/src/core/ext/transport/cronet/transport/cronet_transport.c
+++ b/src/core/ext/transport/cronet/transport/cronet_transport.c
@@ -130,7 +130,7 @@ struct read_state {
/* vars for holding data destined for the application */
struct grpc_slice_buffer_stream sbs;
- gpr_slice_buffer read_slice_buffer;
+ grpc_slice_buffer read_slice_buffer;
/* vars for trailing metadata */
grpc_chttp2_incoming_metadata_buffer trailing_metadata;
@@ -517,10 +517,10 @@ static void on_response_trailers_received(
Utility function that takes the data from s->write_slice_buffer and assembles
into a contiguous byte stream with 5 byte gRPC header prepended.
*/
-static void create_grpc_frame(gpr_slice_buffer *write_slice_buffer,
+static void create_grpc_frame(grpc_slice_buffer *write_slice_buffer,
char **pp_write_buffer,
size_t *p_write_buffer_size) {
- gpr_slice slice = gpr_slice_buffer_take_first(write_slice_buffer);
+ grpc_slice slice = grpc_slice_buffer_take_first(write_slice_buffer);
size_t length = GPR_SLICE_LENGTH(slice);
*p_write_buffer_size = length + GRPC_HEADER_SIZE_IN_BYTES;
/* This is freed in the on_write_completed callback */
@@ -817,9 +817,9 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
result = NO_ACTION_POSSIBLE;
CRONET_LOG(GPR_DEBUG, "Stream is either cancelled or failed.");
} else {
- gpr_slice_buffer write_slice_buffer;
- gpr_slice slice;
- gpr_slice_buffer_init(&write_slice_buffer);
+ grpc_slice_buffer write_slice_buffer;
+ grpc_slice slice;
+ grpc_slice_buffer_init(&write_slice_buffer);
grpc_byte_stream_next(NULL, stream_op->send_message, &slice,
stream_op->send_message->length, NULL);
/* Check that compression flag is OFF. We don't support compression yet.
@@ -828,7 +828,7 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
gpr_log(GPR_ERROR, "Compression is not supported");
GPR_ASSERT(stream_op->send_message->flags == 0);
}
- gpr_slice_buffer_add(&write_slice_buffer, slice);
+ grpc_slice_buffer_add(&write_slice_buffer, slice);
if (write_slice_buffer.count != 1) {
/* Empty request not handled yet */
gpr_log(GPR_ERROR, "Empty request is not supported");
@@ -891,7 +891,7 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
} else {
stream_state->rs.remaining_bytes = 0;
CRONET_LOG(GPR_DEBUG, "read operation complete. Empty response.");
- gpr_slice_buffer_init(&stream_state->rs.read_slice_buffer);
+ grpc_slice_buffer_init(&stream_state->rs.read_slice_buffer);
grpc_slice_buffer_stream_init(&stream_state->rs.sbs,
&stream_state->rs.read_slice_buffer, 0);
*((grpc_byte_buffer **)stream_op->recv_message) =
@@ -918,14 +918,14 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
}
} else if (stream_state->rs.remaining_bytes == 0) {
CRONET_LOG(GPR_DEBUG, "read operation complete");
- gpr_slice read_data_slice =
- gpr_slice_malloc((uint32_t)stream_state->rs.length_field);
+ grpc_slice read_data_slice =
+ grpc_slice_malloc((uint32_t)stream_state->rs.length_field);
uint8_t *dst_p = GPR_SLICE_START_PTR(read_data_slice);
memcpy(dst_p, stream_state->rs.read_buffer,
(size_t)stream_state->rs.length_field);
free_read_buffer(s);
- gpr_slice_buffer_init(&stream_state->rs.read_slice_buffer);
- gpr_slice_buffer_add(&stream_state->rs.read_slice_buffer,
+ grpc_slice_buffer_init(&stream_state->rs.read_slice_buffer);
+ grpc_slice_buffer_add(&stream_state->rs.read_slice_buffer,
read_data_slice);
grpc_slice_buffer_stream_init(&stream_state->rs.sbs,
&stream_state->rs.read_slice_buffer, 0);
diff --git a/src/core/lib/channel/channel_stack.c b/src/core/lib/channel/channel_stack.c
index 2c5367901d..9da81959e7 100644
--- a/src/core/lib/channel/channel_stack.c
+++ b/src/core/lib/channel/channel_stack.c
@@ -288,7 +288,7 @@ void grpc_call_element_send_cancel(grpc_exec_ctx *exec_ctx,
void grpc_call_element_send_cancel_with_message(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_status_code status,
- gpr_slice *optional_message) {
+ grpc_slice *optional_message) {
grpc_transport_stream_op *op = gpr_malloc(sizeof(*op));
memset(op, 0, sizeof(*op));
op->on_complete = grpc_closure_create(destroy_op, op);
@@ -300,7 +300,7 @@ void grpc_call_element_send_cancel_with_message(grpc_exec_ctx *exec_ctx,
void grpc_call_element_send_close_with_message(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_status_code status,
- gpr_slice *optional_message) {
+ grpc_slice *optional_message) {
grpc_transport_stream_op *op = gpr_malloc(sizeof(*op));
memset(op, 0, sizeof(*op));
op->on_complete = grpc_closure_create(destroy_op, op);
diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h
index 27f3be7b29..0d58994726 100644
--- a/src/core/lib/channel/channel_stack.h
+++ b/src/core/lib/channel/channel_stack.h
@@ -289,12 +289,12 @@ void grpc_call_element_send_cancel(grpc_exec_ctx *exec_ctx,
void grpc_call_element_send_cancel_with_message(grpc_exec_ctx *exec_ctx,
grpc_call_element *cur_elem,
grpc_status_code status,
- gpr_slice *optional_message);
+ grpc_slice *optional_message);
void grpc_call_element_send_close_with_message(grpc_exec_ctx *exec_ctx,
grpc_call_element *cur_elem,
grpc_status_code status,
- gpr_slice *optional_message);
+ grpc_slice *optional_message);
extern int grpc_trace_channel;
diff --git a/src/core/lib/channel/compress_filter.c b/src/core/lib/channel/compress_filter.c
index 0981d59f63..f797d82eb9 100644
--- a/src/core/lib/channel/compress_filter.c
+++ b/src/core/lib/channel/compress_filter.c
@@ -50,7 +50,7 @@
int grpc_compression_trace = 0;
typedef struct call_data {
- gpr_slice_buffer slices; /**< Buffers up input slices to be compressed */
+ grpc_slice_buffer slices; /**< Buffers up input slices to be compressed */
grpc_linked_mdelem compression_algorithm_storage;
grpc_linked_mdelem accept_encoding_storage;
uint32_t remaining_slice_bytes;
@@ -63,7 +63,7 @@ typedef struct call_data {
grpc_transport_stream_op *send_op;
uint32_t send_length;
uint32_t send_flags;
- gpr_slice incoming_slice;
+ grpc_slice incoming_slice;
grpc_slice_buffer_stream replacement_stream;
grpc_closure *post_send;
grpc_closure send_done;
@@ -157,7 +157,7 @@ static void continue_send_message(grpc_exec_ctx *exec_ctx,
static void send_done(grpc_exec_ctx *exec_ctx, void *elemp, grpc_error *error) {
grpc_call_element *elem = elemp;
call_data *calld = elem->call_data;
- gpr_slice_buffer_reset_and_unref(&calld->slices);
+ grpc_slice_buffer_reset_and_unref(&calld->slices);
calld->post_send->cb(exec_ctx, calld->post_send->cb_arg, error);
}
@@ -165,8 +165,8 @@ static void finish_send_message(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem) {
call_data *calld = elem->call_data;
int did_compress;
- gpr_slice_buffer tmp;
- gpr_slice_buffer_init(&tmp);
+ grpc_slice_buffer tmp;
+ grpc_slice_buffer_init(&tmp);
did_compress =
grpc_msg_compress(calld->compression_algorithm, &calld->slices, &tmp);
if (did_compress) {
@@ -181,7 +181,7 @@ static void finish_send_message(grpc_exec_ctx *exec_ctx,
" bytes (%.2f%% savings)",
algo_name, before_size, after_size, 100 * savings_ratio);
}
- gpr_slice_buffer_swap(&calld->slices, &tmp);
+ grpc_slice_buffer_swap(&calld->slices, &tmp);
calld->send_flags |= GRPC_WRITE_INTERNAL_COMPRESS;
} else {
if (grpc_compression_trace) {
@@ -195,7 +195,7 @@ static void finish_send_message(grpc_exec_ctx *exec_ctx,
}
}
- gpr_slice_buffer_destroy(&tmp);
+ grpc_slice_buffer_destroy(&tmp);
grpc_slice_buffer_stream_init(&calld->replacement_stream, &calld->slices,
calld->send_flags);
@@ -209,7 +209,7 @@ static void finish_send_message(grpc_exec_ctx *exec_ctx,
static void got_slice(grpc_exec_ctx *exec_ctx, void *elemp, grpc_error *error) {
grpc_call_element *elem = elemp;
call_data *calld = elem->call_data;
- gpr_slice_buffer_add(&calld->slices, calld->incoming_slice);
+ grpc_slice_buffer_add(&calld->slices, calld->incoming_slice);
if (calld->send_length == calld->slices.length) {
finish_send_message(exec_ctx, elem);
} else {
@@ -223,7 +223,7 @@ static void continue_send_message(grpc_exec_ctx *exec_ctx,
while (grpc_byte_stream_next(exec_ctx, calld->send_op->send_message,
&calld->incoming_slice, ~(size_t)0,
&calld->got_slice)) {
- gpr_slice_buffer_add(&calld->slices, calld->incoming_slice);
+ grpc_slice_buffer_add(&calld->slices, calld->incoming_slice);
if (calld->send_length == calld->slices.length) {
finish_send_message(exec_ctx, elem);
break;
@@ -263,7 +263,7 @@ static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
call_data *calld = elem->call_data;
/* initialize members */
- gpr_slice_buffer_init(&calld->slices);
+ grpc_slice_buffer_init(&calld->slices);
calld->has_compression_algorithm = 0;
grpc_closure_init(&calld->got_slice, got_slice, elem);
grpc_closure_init(&calld->send_done, send_done, elem);
@@ -277,7 +277,7 @@ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
void *ignored) {
/* grab pointers to our data from the call element */
call_data *calld = elem->call_data;
- gpr_slice_buffer_destroy(&calld->slices);
+ grpc_slice_buffer_destroy(&calld->slices);
}
/* Constructor for channel_data */
diff --git a/src/core/lib/channel/deadline_filter.c b/src/core/lib/channel/deadline_filter.c
index d2ea5250f6..449eb7b8d6 100644
--- a/src/core/lib/channel/deadline_filter.c
+++ b/src/core/lib/channel/deadline_filter.c
@@ -55,10 +55,10 @@ static void timer_callback(grpc_exec_ctx* exec_ctx, void* arg,
deadline_state->timer_pending = false;
gpr_mu_unlock(&deadline_state->timer_mu);
if (error != GRPC_ERROR_CANCELLED) {
- gpr_slice msg = gpr_slice_from_static_string("Deadline Exceeded");
+ grpc_slice msg = grpc_slice_from_static_string("Deadline Exceeded");
grpc_call_element_send_cancel_with_message(
exec_ctx, elem, GRPC_STATUS_DEADLINE_EXCEEDED, &msg);
- gpr_slice_unref(msg);
+ grpc_slice_unref(msg);
}
GRPC_CALL_STACK_UNREF(exec_ctx, deadline_state->call_stack, "deadline_timer");
}
diff --git a/src/core/lib/channel/handshaker.c b/src/core/lib/channel/handshaker.c
index 0d759887bc..00d39764d7 100644
--- a/src/core/lib/channel/handshaker.c
+++ b/src/core/lib/channel/handshaker.c
@@ -62,7 +62,7 @@ void grpc_handshaker_do_handshake(grpc_exec_ctx* exec_ctx,
grpc_handshaker* handshaker,
grpc_endpoint* endpoint,
grpc_channel_args* args,
- gpr_slice_buffer* read_buffer,
+ grpc_slice_buffer* read_buffer,
gpr_timespec deadline,
grpc_tcp_server_acceptor* acceptor,
grpc_handshaker_done_cb cb, void* user_data) {
@@ -146,7 +146,7 @@ void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx,
static void call_next_handshaker(grpc_exec_ctx* exec_ctx,
grpc_endpoint* endpoint,
grpc_channel_args* args,
- gpr_slice_buffer* read_buffer, void* user_data,
+ grpc_slice_buffer* read_buffer, void* user_data,
grpc_error* error) {
grpc_handshake_manager* mgr = user_data;
GPR_ASSERT(mgr->state != NULL);
@@ -183,8 +183,8 @@ void grpc_handshake_manager_do_handshake(
gpr_timespec deadline, grpc_tcp_server_acceptor* acceptor,
grpc_handshaker_done_cb cb, void* user_data) {
grpc_channel_args* args_copy = grpc_channel_args_copy(args);
- gpr_slice_buffer* read_buffer = gpr_malloc(sizeof(*read_buffer));
- gpr_slice_buffer_init(read_buffer);
+ grpc_slice_buffer* read_buffer = gpr_malloc(sizeof(*read_buffer));
+ grpc_slice_buffer_init(read_buffer);
if (mgr->count == 0) {
// No handshakers registered, so we just immediately call the done
// callback with the passed-in endpoint.
diff --git a/src/core/lib/channel/handshaker.h b/src/core/lib/channel/handshaker.h
index d574b46242..f8a36c6473 100644
--- a/src/core/lib/channel/handshaker.h
+++ b/src/core/lib/channel/handshaker.h
@@ -59,7 +59,7 @@ typedef struct grpc_handshaker grpc_handshaker;
typedef void (*grpc_handshaker_done_cb)(grpc_exec_ctx* exec_ctx,
grpc_endpoint* endpoint,
grpc_channel_args* args,
- gpr_slice_buffer* read_buffer,
+ grpc_slice_buffer* read_buffer,
void* user_data, grpc_error* error);
struct grpc_handshaker_vtable {
@@ -77,7 +77,7 @@ struct grpc_handshaker_vtable {
/// \a acceptor will be NULL for client-side handshakers.
void (*do_handshake)(grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker,
grpc_endpoint* endpoint, grpc_channel_args* args,
- gpr_slice_buffer* read_buffer, gpr_timespec deadline,
+ grpc_slice_buffer* read_buffer, gpr_timespec deadline,
grpc_tcp_server_acceptor* acceptor,
grpc_handshaker_done_cb cb, void* user_data);
};
@@ -103,7 +103,7 @@ void grpc_handshaker_do_handshake(grpc_exec_ctx* exec_ctx,
grpc_handshaker* handshaker,
grpc_endpoint* endpoint,
grpc_channel_args* args,
- gpr_slice_buffer* read_buffer,
+ grpc_slice_buffer* read_buffer,
gpr_timespec deadline,
grpc_tcp_server_acceptor* acceptor,
grpc_handshaker_done_cb cb, void* user_data);
diff --git a/src/core/lib/channel/http_client_filter.c b/src/core/lib/channel/http_client_filter.c
index 1dc05fb20d..110c1cb546 100644
--- a/src/core/lib/channel/http_client_filter.c
+++ b/src/core/lib/channel/http_client_filter.c
@@ -62,9 +62,9 @@ typedef struct call_data {
grpc_transport_stream_op send_op;
uint32_t send_length;
uint32_t send_flags;
- gpr_slice incoming_slice;
+ grpc_slice incoming_slice;
grpc_slice_buffer_stream replacement_stream;
- gpr_slice_buffer slices;
+ grpc_slice_buffer slices;
/* flag that indicates that all slices of send_messages aren't availble */
bool send_message_blocked;
@@ -101,7 +101,7 @@ static grpc_mdelem *client_recv_filter(void *user_data, grpc_mdelem *md) {
char *message_string;
gpr_asprintf(&message_string, "Received http2 header with status: %s",
grpc_mdstr_as_c_string(md->value));
- gpr_slice message = gpr_slice_from_copied_string(message_string);
+ grpc_slice message = grpc_slice_from_copied_string(message_string);
gpr_free(message_string);
grpc_call_element_send_close_with_message(a->exec_ctx, a->elem,
GRPC_STATUS_CANCELLED, &message);
@@ -155,7 +155,7 @@ static void hc_on_complete(grpc_exec_ctx *exec_ctx, void *user_data,
static void send_done(grpc_exec_ctx *exec_ctx, void *elemp, grpc_error *error) {
grpc_call_element *elem = elemp;
call_data *calld = elem->call_data;
- gpr_slice_buffer_reset_and_unref(&calld->slices);
+ grpc_slice_buffer_reset_and_unref(&calld->slices);
calld->post_send->cb(exec_ctx, calld->post_send->cb_arg, error);
}
@@ -179,7 +179,7 @@ static void continue_send_message(grpc_exec_ctx *exec_ctx,
memcpy(wrptr, GPR_SLICE_START_PTR(calld->incoming_slice),
GPR_SLICE_LENGTH(calld->incoming_slice));
wrptr += GPR_SLICE_LENGTH(calld->incoming_slice);
- gpr_slice_buffer_add(&calld->slices, calld->incoming_slice);
+ grpc_slice_buffer_add(&calld->slices, calld->incoming_slice);
if (calld->send_length == calld->slices.length) {
calld->send_message_blocked = false;
break;
@@ -191,7 +191,7 @@ static void got_slice(grpc_exec_ctx *exec_ctx, void *elemp, grpc_error *error) {
grpc_call_element *elem = elemp;
call_data *calld = elem->call_data;
calld->send_message_blocked = false;
- gpr_slice_buffer_add(&calld->slices, calld->incoming_slice);
+ grpc_slice_buffer_add(&calld->slices, calld->incoming_slice);
if (calld->send_length == calld->slices.length) {
/* Pass down the original send_message op that was blocked.*/
grpc_slice_buffer_stream_init(&calld->replacement_stream, &calld->slices,
@@ -311,7 +311,7 @@ static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
calld->on_done_recv = NULL;
calld->on_complete = NULL;
calld->payload_bytes = NULL;
- gpr_slice_buffer_init(&calld->slices);
+ grpc_slice_buffer_init(&calld->slices);
grpc_closure_init(&calld->hc_on_recv, hc_on_recv, elem);
grpc_closure_init(&calld->hc_on_complete, hc_on_complete, elem);
grpc_closure_init(&calld->got_slice, got_slice, elem);
@@ -324,7 +324,7 @@ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
const grpc_call_final_info *final_info,
void *ignored) {
call_data *calld = elem->call_data;
- gpr_slice_buffer_destroy(&calld->slices);
+ grpc_slice_buffer_destroy(&calld->slices);
}
static grpc_mdelem *scheme_from_args(const grpc_channel_args *args) {
diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c
index f2221fb0fb..1a73a07b81 100644
--- a/src/core/lib/channel/http_server_filter.c
+++ b/src/core/lib/channel/http_server_filter.c
@@ -68,7 +68,7 @@ typedef struct call_data {
grpc_closure *recv_message_ready;
grpc_closure *on_complete;
grpc_byte_stream **pp_recv_message;
- gpr_slice_buffer read_slice_buffer;
+ grpc_slice_buffer read_slice_buffer;
grpc_slice_buffer_stream read_stream;
/** Receive closures are chained: we inject this closure as the on_done_recv
@@ -162,9 +162,9 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) {
/* Retrieve the payload from the value of the 'grpc-internal-payload-bin'
header field */
calld->seen_payload_bin = 1;
- gpr_slice_buffer_init(&calld->read_slice_buffer);
- gpr_slice_buffer_add(&calld->read_slice_buffer,
- gpr_slice_ref(md->value->slice));
+ grpc_slice_buffer_init(&calld->read_slice_buffer);
+ grpc_slice_buffer_add(&calld->read_slice_buffer,
+ grpc_slice_ref(md->value->slice));
grpc_slice_buffer_stream_init(&calld->read_stream,
&calld->read_slice_buffer, 0);
return NULL;
diff --git a/src/core/lib/channel/message_size_filter.c b/src/core/lib/channel/message_size_filter.c
index b8b2546035..e25ca17646 100644
--- a/src/core/lib/channel/message_size_filter.c
+++ b/src/core/lib/channel/message_size_filter.c
@@ -141,7 +141,7 @@ static void start_transport_stream_op(grpc_exec_ctx* exec_ctx,
char* message_string;
gpr_asprintf(&message_string, "Sent message larger than max (%u vs. %d)",
op->send_message->length, calld->max_send_size);
- gpr_slice message = gpr_slice_from_copied_string(message_string);
+ grpc_slice message = grpc_slice_from_copied_string(message_string);
gpr_free(message_string);
grpc_call_element_send_close_with_message(
exec_ctx, elem, GRPC_STATUS_INVALID_ARGUMENT, &message);
diff --git a/src/core/lib/compression/message_compress.c b/src/core/lib/compression/message_compress.c
index cbe0b5a285..501cb8be69 100644
--- a/src/core/lib/compression/message_compress.c
+++ b/src/core/lib/compression/message_compress.c
@@ -42,13 +42,13 @@
#define OUTPUT_BLOCK_SIZE 1024
-static int zlib_body(z_stream* zs, gpr_slice_buffer* input,
- gpr_slice_buffer* output,
+static int zlib_body(z_stream* zs, grpc_slice_buffer* input,
+ grpc_slice_buffer* output,
int (*flate)(z_stream* zs, int flush)) {
int r;
int flush;
size_t i;
- gpr_slice outbuf = gpr_slice_malloc(OUTPUT_BLOCK_SIZE);
+ grpc_slice outbuf = grpc_slice_malloc(OUTPUT_BLOCK_SIZE);
const uInt uint_max = ~(uInt)0;
GPR_ASSERT(GPR_SLICE_LENGTH(outbuf) <= uint_max);
@@ -62,8 +62,8 @@ static int zlib_body(z_stream* zs, gpr_slice_buffer* input,
zs->next_in = GPR_SLICE_START_PTR(input->slices[i]);
do {
if (zs->avail_out == 0) {
- gpr_slice_buffer_add_indexed(output, outbuf);
- outbuf = gpr_slice_malloc(OUTPUT_BLOCK_SIZE);
+ grpc_slice_buffer_add_indexed(output, outbuf);
+ outbuf = grpc_slice_malloc(OUTPUT_BLOCK_SIZE);
GPR_ASSERT(GPR_SLICE_LENGTH(outbuf) <= uint_max);
zs->avail_out = (uInt)GPR_SLICE_LENGTH(outbuf);
zs->next_out = GPR_SLICE_START_PTR(outbuf);
@@ -82,12 +82,12 @@ static int zlib_body(z_stream* zs, gpr_slice_buffer* input,
GPR_ASSERT(outbuf.refcount);
outbuf.data.refcounted.length -= zs->avail_out;
- gpr_slice_buffer_add_indexed(output, outbuf);
+ grpc_slice_buffer_add_indexed(output, outbuf);
return 1;
error:
- gpr_slice_unref(outbuf);
+ grpc_slice_unref(outbuf);
return 0;
}
@@ -97,7 +97,7 @@ static void* zalloc_gpr(void* opaque, unsigned int items, unsigned int size) {
static void zfree_gpr(void* opaque, void* address) { gpr_free(address); }
-static int zlib_compress(gpr_slice_buffer* input, gpr_slice_buffer* output,
+static int zlib_compress(grpc_slice_buffer* input, grpc_slice_buffer* output,
int gzip) {
z_stream zs;
int r;
@@ -113,7 +113,7 @@ static int zlib_compress(gpr_slice_buffer* input, gpr_slice_buffer* output,
r = zlib_body(&zs, input, output, deflate) && output->length < input->length;
if (!r) {
for (i = count_before; i < output->count; i++) {
- gpr_slice_unref(output->slices[i]);
+ grpc_slice_unref(output->slices[i]);
}
output->count = count_before;
output->length = length_before;
@@ -122,7 +122,7 @@ static int zlib_compress(gpr_slice_buffer* input, gpr_slice_buffer* output,
return r;
}
-static int zlib_decompress(gpr_slice_buffer* input, gpr_slice_buffer* output,
+static int zlib_decompress(grpc_slice_buffer* input, grpc_slice_buffer* output,
int gzip) {
z_stream zs;
int r;
@@ -137,7 +137,7 @@ static int zlib_decompress(gpr_slice_buffer* input, gpr_slice_buffer* output,
r = zlib_body(&zs, input, output, inflate);
if (!r) {
for (i = count_before; i < output->count; i++) {
- gpr_slice_unref(output->slices[i]);
+ grpc_slice_unref(output->slices[i]);
}
output->count = count_before;
output->length = length_before;
@@ -146,16 +146,16 @@ static int zlib_decompress(gpr_slice_buffer* input, gpr_slice_buffer* output,
return r;
}
-static int copy(gpr_slice_buffer* input, gpr_slice_buffer* output) {
+static int copy(grpc_slice_buffer* input, grpc_slice_buffer* output) {
size_t i;
for (i = 0; i < input->count; i++) {
- gpr_slice_buffer_add(output, gpr_slice_ref(input->slices[i]));
+ grpc_slice_buffer_add(output, grpc_slice_ref(input->slices[i]));
}
return 1;
}
static int compress_inner(grpc_compression_algorithm algorithm,
- gpr_slice_buffer* input, gpr_slice_buffer* output) {
+ grpc_slice_buffer* input, grpc_slice_buffer* output) {
switch (algorithm) {
case GRPC_COMPRESS_NONE:
/* the fallback path always needs to be send uncompressed: we simply
@@ -173,7 +173,7 @@ static int compress_inner(grpc_compression_algorithm algorithm,
}
int grpc_msg_compress(grpc_compression_algorithm algorithm,
- gpr_slice_buffer* input, gpr_slice_buffer* output) {
+ grpc_slice_buffer* input, grpc_slice_buffer* output) {
if (!compress_inner(algorithm, input, output)) {
copy(input, output);
return 0;
@@ -182,7 +182,7 @@ int grpc_msg_compress(grpc_compression_algorithm algorithm,
}
int grpc_msg_decompress(grpc_compression_algorithm algorithm,
- gpr_slice_buffer* input, gpr_slice_buffer* output) {
+ grpc_slice_buffer* input, grpc_slice_buffer* output) {
switch (algorithm) {
case GRPC_COMPRESS_NONE:
return copy(input, output);
diff --git a/src/core/lib/compression/message_compress.h b/src/core/lib/compression/message_compress.h
index c69eaaf006..d28b5a36b3 100644
--- a/src/core/lib/compression/message_compress.h
+++ b/src/core/lib/compression/message_compress.h
@@ -41,12 +41,12 @@
On success, appends compressed slices to output and returns 1.
On failure, appends uncompressed slices to output and returns 0. */
int grpc_msg_compress(grpc_compression_algorithm algorithm,
- gpr_slice_buffer* input, gpr_slice_buffer* output);
+ grpc_slice_buffer* input, grpc_slice_buffer* output);
/* decompress 'input' to 'output' using 'algorithm'.
On success, appends slices to output and returns 1.
On failure, output is unchanged, and returns 0. */
int grpc_msg_decompress(grpc_compression_algorithm algorithm,
- gpr_slice_buffer* input, gpr_slice_buffer* output);
+ grpc_slice_buffer* input, grpc_slice_buffer* output);
#endif /* GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H */
diff --git a/src/core/lib/http/format_request.c b/src/core/lib/http/format_request.c
index e818b70113..03f705ee97 100644
--- a/src/core/lib/http/format_request.c
+++ b/src/core/lib/http/format_request.c
@@ -65,7 +65,7 @@ static void fill_common_header(const grpc_httpcli_request *request,
}
}
-gpr_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request) {
+grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request) {
gpr_strvec out;
char *flat;
size_t flat_len;
@@ -78,10 +78,10 @@ gpr_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request) {
flat = gpr_strvec_flatten(&out, &flat_len);
gpr_strvec_destroy(&out);
- return gpr_slice_new(flat, flat_len, gpr_free);
+ return grpc_slice_new(flat, flat_len, gpr_free);
}
-gpr_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
+grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
const char *body_bytes,
size_t body_size) {
gpr_strvec out;
@@ -117,10 +117,10 @@ gpr_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
out_len += body_size;
}
- return gpr_slice_new(tmp, out_len, gpr_free);
+ return grpc_slice_new(tmp, out_len, gpr_free);
}
-gpr_slice grpc_httpcli_format_connect_request(
+grpc_slice grpc_httpcli_format_connect_request(
const grpc_httpcli_request *request) {
gpr_strvec out;
gpr_strvec_init(&out);
@@ -130,5 +130,5 @@ gpr_slice grpc_httpcli_format_connect_request(
size_t flat_len;
char *flat = gpr_strvec_flatten(&out, &flat_len);
gpr_strvec_destroy(&out);
- return gpr_slice_new(flat, flat_len, gpr_free);
+ return grpc_slice_new(flat, flat_len, gpr_free);
}
diff --git a/src/core/lib/http/format_request.h b/src/core/lib/http/format_request.h
index 7abd55f2f7..939401be48 100644
--- a/src/core/lib/http/format_request.h
+++ b/src/core/lib/http/format_request.h
@@ -37,11 +37,11 @@
#include <grpc/support/slice.h>
#include "src/core/lib/http/httpcli.h"
-gpr_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request);
-gpr_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
+grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request);
+grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
const char *body_bytes,
size_t body_size);
-gpr_slice grpc_httpcli_format_connect_request(
+grpc_slice grpc_httpcli_format_connect_request(
const grpc_httpcli_request *request);
#endif /* GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H */
diff --git a/src/core/lib/http/httpcli.c b/src/core/lib/http/httpcli.c
index 26baae1eab..d52c140405 100644
--- a/src/core/lib/http/httpcli.c
+++ b/src/core/lib/http/httpcli.c
@@ -51,7 +51,7 @@
#include "src/core/lib/support/string.h"
typedef struct {
- gpr_slice request_text;
+ grpc_slice request_text;
grpc_http_parser parser;
grpc_resolved_addresses *addresses;
size_t next_address;
@@ -65,8 +65,8 @@ typedef struct {
grpc_httpcli_context *context;
grpc_polling_entity *pollent;
grpc_iomgr_object iomgr_obj;
- gpr_slice_buffer incoming;
- gpr_slice_buffer outgoing;
+ grpc_slice_buffer incoming;
+ grpc_slice_buffer outgoing;
grpc_closure on_read;
grpc_closure done_write;
grpc_closure connected;
@@ -112,12 +112,12 @@ static void finish(grpc_exec_ctx *exec_ctx, internal_request *req,
if (req->ep != NULL) {
grpc_endpoint_destroy(exec_ctx, req->ep);
}
- gpr_slice_unref(req->request_text);
+ grpc_slice_unref(req->request_text);
gpr_free(req->host);
gpr_free(req->ssl_host_override);
grpc_iomgr_unregister_object(&req->iomgr_obj);
- gpr_slice_buffer_destroy(&req->incoming);
- gpr_slice_buffer_destroy(&req->outgoing);
+ grpc_slice_buffer_destroy(&req->incoming);
+ grpc_slice_buffer_destroy(&req->outgoing);
GRPC_ERROR_UNREF(req->overall_error);
grpc_resource_quota_internal_unref(exec_ctx, req->resource_quota);
gpr_free(req);
@@ -179,8 +179,8 @@ static void done_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
}
static void start_write(grpc_exec_ctx *exec_ctx, internal_request *req) {
- gpr_slice_ref(req->request_text);
- gpr_slice_buffer_add(&req->outgoing, req->request_text);
+ grpc_slice_ref(req->request_text);
+ grpc_slice_buffer_add(&req->outgoing, req->request_text);
grpc_endpoint_write(exec_ctx, req->ep, &req->outgoing, &req->done_write);
}
@@ -254,7 +254,7 @@ static void internal_request_begin(grpc_exec_ctx *exec_ctx,
const grpc_httpcli_request *request,
gpr_timespec deadline, grpc_closure *on_done,
grpc_httpcli_response *response,
- const char *name, gpr_slice request_text) {
+ const char *name, grpc_slice request_text) {
internal_request *req = gpr_malloc(sizeof(internal_request));
memset(req, 0, sizeof(*req));
req->request_text = request_text;
@@ -269,8 +269,8 @@ static void internal_request_begin(grpc_exec_ctx *exec_ctx,
req->resource_quota = grpc_resource_quota_internal_ref(resource_quota);
grpc_closure_init(&req->on_read, on_read, req);
grpc_closure_init(&req->done_write, done_write, req);
- gpr_slice_buffer_init(&req->incoming);
- gpr_slice_buffer_init(&req->outgoing);
+ grpc_slice_buffer_init(&req->incoming);
+ grpc_slice_buffer_init(&req->outgoing);
grpc_iomgr_register_object(&req->iomgr_obj, name);
req->host = gpr_strdup(request->host);
req->ssl_host_override = gpr_strdup(request->ssl_host_override);
diff --git a/src/core/lib/http/httpcli_security_connector.c b/src/core/lib/http/httpcli_security_connector.c
index 0006e809a6..24d264c32a 100644
--- a/src/core/lib/http/httpcli_security_connector.c
+++ b/src/core/lib/http/httpcli_security_connector.c
@@ -61,7 +61,7 @@ static void httpcli_ssl_destroy(grpc_security_connector *sc) {
static void httpcli_ssl_do_handshake(grpc_exec_ctx *exec_ctx,
grpc_channel_security_connector *sc,
grpc_endpoint *nonsecure_endpoint,
- gpr_slice_buffer *read_buffer,
+ grpc_slice_buffer *read_buffer,
gpr_timespec deadline,
grpc_security_handshake_done_cb cb,
void *user_data) {
diff --git a/src/core/lib/http/parser.c b/src/core/lib/http/parser.c
index be9e9b6b63..14abb1da69 100644
--- a/src/core/lib/http/parser.c
+++ b/src/core/lib/http/parser.c
@@ -333,7 +333,7 @@ void grpc_http_response_destroy(grpc_http_response *response) {
gpr_free(response->hdrs);
}
-grpc_error *grpc_http_parser_parse(grpc_http_parser *parser, gpr_slice slice,
+grpc_error *grpc_http_parser_parse(grpc_http_parser *parser, grpc_slice slice,
size_t *start_of_body) {
for (size_t i = 0; i < GPR_SLICE_LENGTH(slice); i++) {
bool found_body_start = false;
diff --git a/src/core/lib/http/parser.h b/src/core/lib/http/parser.h
index fab42979cd..102ffba05d 100644
--- a/src/core/lib/http/parser.h
+++ b/src/core/lib/http/parser.h
@@ -114,7 +114,7 @@ void grpc_http_parser_init(grpc_http_parser *parser, grpc_http_type type,
void grpc_http_parser_destroy(grpc_http_parser *parser);
/* Sets \a start_of_body to the offset in \a slice of the start of the body. */
-grpc_error *grpc_http_parser_parse(grpc_http_parser *parser, gpr_slice slice,
+grpc_error *grpc_http_parser_parse(grpc_http_parser *parser, grpc_slice slice,
size_t *start_of_body);
grpc_error *grpc_http_parser_eof(grpc_http_parser *parser);
diff --git a/src/core/lib/iomgr/endpoint.c b/src/core/lib/iomgr/endpoint.c
index 74fa9c45df..a4b6668276 100644
--- a/src/core/lib/iomgr/endpoint.c
+++ b/src/core/lib/iomgr/endpoint.c
@@ -34,12 +34,12 @@
#include "src/core/lib/iomgr/endpoint.h"
void grpc_endpoint_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
- gpr_slice_buffer* slices, grpc_closure* cb) {
+ grpc_slice_buffer* slices, grpc_closure* cb) {
ep->vtable->read(exec_ctx, ep, slices, cb);
}
void grpc_endpoint_write(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
- gpr_slice_buffer* slices, grpc_closure* cb) {
+ grpc_slice_buffer* slices, grpc_closure* cb) {
ep->vtable->write(exec_ctx, ep, slices, cb);
}
diff --git a/src/core/lib/iomgr/endpoint.h b/src/core/lib/iomgr/endpoint.h
index 0ac5486ff5..d05998ec85 100644
--- a/src/core/lib/iomgr/endpoint.h
+++ b/src/core/lib/iomgr/endpoint.h
@@ -49,9 +49,9 @@ typedef struct grpc_endpoint_vtable grpc_endpoint_vtable;
struct grpc_endpoint_vtable {
void (*read)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *slices, grpc_closure *cb);
+ grpc_slice_buffer *slices, grpc_closure *cb);
void (*write)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *slices, grpc_closure *cb);
+ grpc_slice_buffer *slices, grpc_closure *cb);
grpc_workqueue *(*get_workqueue)(grpc_endpoint *ep);
void (*add_to_pollset)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
grpc_pollset *pollset);
@@ -69,7 +69,7 @@ struct grpc_endpoint_vtable {
Valid slices may be placed into \a slices even when the callback is
invoked with error != GRPC_ERROR_NONE. */
void grpc_endpoint_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *slices, grpc_closure *cb);
+ grpc_slice_buffer *slices, grpc_closure *cb);
char *grpc_endpoint_get_peer(grpc_endpoint *ep);
@@ -87,7 +87,7 @@ grpc_workqueue *grpc_endpoint_get_workqueue(grpc_endpoint *ep);
it is a valid slice buffer.
*/
void grpc_endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *slices, grpc_closure *cb);
+ grpc_slice_buffer *slices, grpc_closure *cb);
/* Causes any pending and future read/write callbacks to run immediately with
success==0 */
diff --git a/src/core/lib/iomgr/load_file.c b/src/core/lib/iomgr/load_file.c
index b62ecbc534..217bc5da59 100644
--- a/src/core/lib/iomgr/load_file.c
+++ b/src/core/lib/iomgr/load_file.c
@@ -44,10 +44,10 @@
#include "src/core/lib/support/string.h"
grpc_error *grpc_load_file(const char *filename, int add_null_terminator,
- gpr_slice *output) {
+ grpc_slice *output) {
unsigned char *contents = NULL;
size_t contents_size = 0;
- gpr_slice result = gpr_empty_slice();
+ grpc_slice result = gpr_empty_slice();
FILE *file;
size_t bytes_read = 0;
grpc_error *error = GRPC_ERROR_NONE;
@@ -72,7 +72,7 @@ grpc_error *grpc_load_file(const char *filename, int add_null_terminator,
if (add_null_terminator) {
contents[contents_size++] = 0;
}
- result = gpr_slice_new(contents, contents_size, gpr_free);
+ result = grpc_slice_new(contents, contents_size, gpr_free);
end:
*output = result;
diff --git a/src/core/lib/iomgr/load_file.h b/src/core/lib/iomgr/load_file.h
index 9aac2225d1..31cec92cb1 100644
--- a/src/core/lib/iomgr/load_file.h
+++ b/src/core/lib/iomgr/load_file.h
@@ -47,7 +47,7 @@ extern "C" {
/* Loads the content of a file into a slice. add_null_terminator will add
a NULL terminator if non-zero. */
grpc_error *grpc_load_file(const char *filename, int add_null_terminator,
- gpr_slice *slice);
+ grpc_slice *slice);
#ifdef __cplusplus
}
diff --git a/src/core/lib/iomgr/resource_quota.c b/src/core/lib/iomgr/resource_quota.c
index 4f0d16ca7e..f047f45b43 100644
--- a/src/core/lib/iomgr/resource_quota.c
+++ b/src/core/lib/iomgr/resource_quota.c
@@ -269,7 +269,7 @@ static bool rq_reclaim(grpc_exec_ctx *exec_ctx,
*/
typedef struct {
- gpr_slice_refcount base;
+ grpc_slice_refcount base;
gpr_refcount refs;
grpc_resource_user *resource_user;
size_t size;
@@ -286,7 +286,7 @@ static void ru_slice_unref(void *p) {
/* TODO(ctiller): this is dangerous, but I think safe for now:
we have no guarantee here that we're at a safe point for creating an
execution context, but we have no way of writing this code otherwise.
- In the future: consider lifting gpr_slice to grpc, and offering an
+ In the future: consider lifting grpc_slice to grpc, and offering an
internal_{ref,unref} pair that is execution context aware.
Alternatively,
make exec_ctx be thread local and 'do the right thing' (whatever that
@@ -299,7 +299,7 @@ static void ru_slice_unref(void *p) {
}
}
-static gpr_slice ru_slice_create(grpc_resource_user *resource_user,
+static grpc_slice ru_slice_create(grpc_resource_user *resource_user,
size_t size) {
ru_slice_refcount *rc = gpr_malloc(sizeof(ru_slice_refcount) + size);
rc->base.ref = ru_slice_ref;
@@ -307,7 +307,7 @@ static gpr_slice ru_slice_create(grpc_resource_user *resource_user,
gpr_ref_init(&rc->refs, 1);
rc->resource_user = resource_user;
rc->size = size;
- gpr_slice slice;
+ grpc_slice slice;
slice.refcount = &rc->base;
slice.data.refcounted.bytes = (uint8_t *)(rc + 1);
slice.data.refcounted.length = size;
@@ -394,7 +394,7 @@ static void ru_allocated_slices(grpc_exec_ctx *exec_ctx, void *arg,
grpc_resource_user_slice_allocator *slice_allocator = arg;
if (error == GRPC_ERROR_NONE) {
for (size_t i = 0; i < slice_allocator->count; i++) {
- gpr_slice_buffer_add_indexed(
+ grpc_slice_buffer_add_indexed(
slice_allocator->dest, ru_slice_create(slice_allocator->resource_user,
slice_allocator->length));
}
@@ -711,7 +711,7 @@ void grpc_resource_user_slice_allocator_init(
void grpc_resource_user_alloc_slices(
grpc_exec_ctx *exec_ctx,
grpc_resource_user_slice_allocator *slice_allocator, size_t length,
- size_t count, gpr_slice_buffer *dest) {
+ size_t count, grpc_slice_buffer *dest) {
slice_allocator->length = length;
slice_allocator->count = count;
slice_allocator->dest = dest;
diff --git a/src/core/lib/iomgr/resource_quota.h b/src/core/lib/iomgr/resource_quota.h
index c15cb68310..f644e5bf4d 100644
--- a/src/core/lib/iomgr/resource_quota.h
+++ b/src/core/lib/iomgr/resource_quota.h
@@ -202,7 +202,7 @@ typedef struct grpc_resource_user_slice_allocator {
/* Number of slices to allocate on the current request */
size_t count;
/* Destination for slices to allocate on the current request */
- gpr_slice_buffer *dest;
+ grpc_slice_buffer *dest;
/* Parent resource user */
grpc_resource_user *resource_user;
} grpc_resource_user_slice_allocator;
@@ -218,6 +218,6 @@ void grpc_resource_user_slice_allocator_init(
void grpc_resource_user_alloc_slices(
grpc_exec_ctx *exec_ctx,
grpc_resource_user_slice_allocator *slice_allocator, size_t length,
- size_t count, gpr_slice_buffer *dest);
+ size_t count, grpc_slice_buffer *dest);
#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */
diff --git a/src/core/lib/iomgr/tcp_posix.c b/src/core/lib/iomgr/tcp_posix.c
index 27b6677545..909237d84d 100644
--- a/src/core/lib/iomgr/tcp_posix.c
+++ b/src/core/lib/iomgr/tcp_posix.c
@@ -83,10 +83,10 @@ typedef struct {
gpr_atm shutdown_count;
/* garbage after the last read */
- gpr_slice_buffer last_read_buffer;
+ grpc_slice_buffer last_read_buffer;
- gpr_slice_buffer *incoming_buffer;
- gpr_slice_buffer *outgoing_buffer;
+ grpc_slice_buffer *incoming_buffer;
+ grpc_slice_buffer *outgoing_buffer;
/** slice within outgoing_buffer to write next */
size_t outgoing_slice_idx;
/** byte within outgoing_buffer->slices[outgoing_slice_idx] to write next */
@@ -130,7 +130,7 @@ static void tcp_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) {
static void tcp_free(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
grpc_fd_orphan(exec_ctx, tcp->em_fd, tcp->release_fd_cb, tcp->release_fd,
"tcp_unref_orphan");
- gpr_slice_buffer_destroy(&tcp->last_read_buffer);
+ grpc_slice_buffer_destroy(&tcp->last_read_buffer);
grpc_resource_user_destroy(exec_ctx, &tcp->resource_user);
gpr_free(tcp->peer_string);
gpr_free(tcp);
@@ -177,7 +177,7 @@ static void tcp_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) {
grpc_network_status_unregister_endpoint(ep);
grpc_tcp *tcp = (grpc_tcp *)ep;
tcp_maybe_shutdown_resource_user(exec_ctx, tcp);
- gpr_slice_buffer_reset_and_unref(&tcp->last_read_buffer);
+ grpc_slice_buffer_reset_and_unref(&tcp->last_read_buffer);
TCP_UNREF(exec_ctx, tcp, "destroy");
}
@@ -244,19 +244,19 @@ static void tcp_do_read(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
/* We've consumed the edge, request a new one */
grpc_fd_notify_on_read(exec_ctx, tcp->em_fd, &tcp->read_closure);
} else {
- gpr_slice_buffer_reset_and_unref(tcp->incoming_buffer);
+ grpc_slice_buffer_reset_and_unref(tcp->incoming_buffer);
call_read_cb(exec_ctx, tcp, GRPC_OS_ERROR(errno, "recvmsg"));
TCP_UNREF(exec_ctx, tcp, "read");
}
} else if (read_bytes == 0) {
/* 0 read size ==> end of stream */
- gpr_slice_buffer_reset_and_unref(tcp->incoming_buffer);
+ grpc_slice_buffer_reset_and_unref(tcp->incoming_buffer);
call_read_cb(exec_ctx, tcp, GRPC_ERROR_CREATE("Socket closed"));
TCP_UNREF(exec_ctx, tcp, "read");
} else {
GPR_ASSERT((size_t)read_bytes <= tcp->incoming_buffer->length);
if ((size_t)read_bytes < tcp->incoming_buffer->length) {
- gpr_slice_buffer_trim_end(
+ grpc_slice_buffer_trim_end(
tcp->incoming_buffer,
tcp->incoming_buffer->length - (size_t)read_bytes,
&tcp->last_read_buffer);
@@ -275,8 +275,8 @@ static void tcp_read_allocation_done(grpc_exec_ctx *exec_ctx, void *tcpp,
grpc_error *error) {
grpc_tcp *tcp = tcpp;
if (error != GRPC_ERROR_NONE) {
- gpr_slice_buffer_reset_and_unref(tcp->incoming_buffer);
- gpr_slice_buffer_reset_and_unref(&tcp->last_read_buffer);
+ grpc_slice_buffer_reset_and_unref(tcp->incoming_buffer);
+ grpc_slice_buffer_reset_and_unref(&tcp->last_read_buffer);
call_read_cb(exec_ctx, tcp, GRPC_ERROR_REF(error));
TCP_UNREF(exec_ctx, tcp, "read");
} else {
@@ -301,8 +301,8 @@ static void tcp_handle_read(grpc_exec_ctx *exec_ctx, void *arg /* grpc_tcp */,
GPR_ASSERT(!tcp->finished_edge);
if (error != GRPC_ERROR_NONE) {
- gpr_slice_buffer_reset_and_unref(tcp->incoming_buffer);
- gpr_slice_buffer_reset_and_unref(&tcp->last_read_buffer);
+ grpc_slice_buffer_reset_and_unref(tcp->incoming_buffer);
+ grpc_slice_buffer_reset_and_unref(&tcp->last_read_buffer);
call_read_cb(exec_ctx, tcp, GRPC_ERROR_REF(error));
TCP_UNREF(exec_ctx, tcp, "read");
} else {
@@ -311,13 +311,13 @@ static void tcp_handle_read(grpc_exec_ctx *exec_ctx, void *arg /* grpc_tcp */,
}
static void tcp_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *incoming_buffer, grpc_closure *cb) {
+ grpc_slice_buffer *incoming_buffer, grpc_closure *cb) {
grpc_tcp *tcp = (grpc_tcp *)ep;
GPR_ASSERT(tcp->read_cb == NULL);
tcp->read_cb = cb;
tcp->incoming_buffer = incoming_buffer;
- gpr_slice_buffer_reset_and_unref(incoming_buffer);
- gpr_slice_buffer_swap(incoming_buffer, &tcp->last_read_buffer);
+ grpc_slice_buffer_reset_and_unref(incoming_buffer);
+ grpc_slice_buffer_swap(incoming_buffer, &tcp->last_read_buffer);
TCP_REF(tcp, "read");
if (tcp->finished_edge) {
tcp->finished_edge = false;
@@ -442,7 +442,7 @@ static void tcp_handle_write(grpc_exec_ctx *exec_ctx, void *arg /* grpc_tcp */,
}
static void tcp_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *buf, grpc_closure *cb) {
+ grpc_slice_buffer *buf, grpc_closure *cb) {
grpc_tcp *tcp = (grpc_tcp *)ep;
grpc_error *error = GRPC_ERROR_NONE;
@@ -552,7 +552,7 @@ grpc_endpoint *grpc_tcp_create(grpc_fd *em_fd,
tcp->read_closure.cb_arg = tcp;
tcp->write_closure.cb = tcp_handle_write;
tcp->write_closure.cb_arg = tcp;
- gpr_slice_buffer_init(&tcp->last_read_buffer);
+ grpc_slice_buffer_init(&tcp->last_read_buffer);
grpc_resource_user_init(&tcp->resource_user, resource_quota, peer_string);
grpc_resource_user_slice_allocator_init(&tcp->slice_allocator,
&tcp->resource_user,
@@ -577,7 +577,7 @@ void grpc_tcp_destroy_and_release_fd(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
tcp->release_fd = fd;
tcp->release_fd_cb = done;
tcp_maybe_shutdown_resource_user(exec_ctx, tcp);
- gpr_slice_buffer_reset_and_unref(&tcp->last_read_buffer);
+ grpc_slice_buffer_reset_and_unref(&tcp->last_read_buffer);
TCP_UNREF(exec_ctx, tcp, "destroy");
}
diff --git a/src/core/lib/iomgr/tcp_windows.c b/src/core/lib/iomgr/tcp_windows.c
index 448a72671c..6f63f80021 100644
--- a/src/core/lib/iomgr/tcp_windows.c
+++ b/src/core/lib/iomgr/tcp_windows.c
@@ -105,9 +105,9 @@ typedef struct grpc_tcp {
grpc_closure *read_cb;
grpc_closure *write_cb;
- gpr_slice read_slice;
- gpr_slice_buffer *write_slices;
- gpr_slice_buffer *read_slices;
+ grpc_slice read_slice;
+ grpc_slice_buffer *write_slices;
+ grpc_slice_buffer *read_slices;
/* The IO Completion Port runs from another thread. We need some mechanism
to protect ourselves when requesting a shutdown. */
@@ -160,7 +160,7 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *tcpp, grpc_error *error) {
grpc_tcp *tcp = tcpp;
grpc_closure *cb = tcp->read_cb;
grpc_winsocket *socket = tcp->socket;
- gpr_slice sub;
+ grpc_slice sub;
grpc_winsocket_callback_info *info = &socket->read_info;
GRPC_ERROR_REF(error);
@@ -170,13 +170,13 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *tcpp, grpc_error *error) {
char *utf8_message = gpr_format_message(info->wsa_error);
error = GRPC_ERROR_CREATE(utf8_message);
gpr_free(utf8_message);
- gpr_slice_unref(tcp->read_slice);
+ grpc_slice_unref(tcp->read_slice);
} else {
if (info->bytes_transfered != 0 && !tcp->shutting_down) {
- sub = gpr_slice_sub_no_ref(tcp->read_slice, 0, info->bytes_transfered);
- gpr_slice_buffer_add(tcp->read_slices, sub);
+ sub = grpc_slice_sub_no_ref(tcp->read_slice, 0, info->bytes_transfered);
+ grpc_slice_buffer_add(tcp->read_slices, sub);
} else {
- gpr_slice_unref(tcp->read_slice);
+ grpc_slice_unref(tcp->read_slice);
error = GRPC_ERROR_CREATE("End of TCP stream");
}
}
@@ -188,7 +188,7 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *tcpp, grpc_error *error) {
}
static void win_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *read_slices, grpc_closure *cb) {
+ grpc_slice_buffer *read_slices, grpc_closure *cb) {
grpc_tcp *tcp = (grpc_tcp *)ep;
grpc_winsocket *handle = tcp->socket;
grpc_winsocket_callback_info *info = &handle->read_info;
@@ -205,9 +205,9 @@ static void win_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
tcp->read_cb = cb;
tcp->read_slices = read_slices;
- gpr_slice_buffer_reset_and_unref(read_slices);
+ grpc_slice_buffer_reset_and_unref(read_slices);
- tcp->read_slice = gpr_slice_malloc(8192);
+ tcp->read_slice = grpc_slice_malloc(8192);
buffer.len = (ULONG)GPR_SLICE_LENGTH(
tcp->read_slice); // we know slice size fits in 32bit.
@@ -273,7 +273,7 @@ static void on_write(grpc_exec_ctx *exec_ctx, void *tcpp, grpc_error *error) {
/* Initiates a write. */
static void win_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *slices, grpc_closure *cb) {
+ grpc_slice_buffer *slices, grpc_closure *cb) {
grpc_tcp *tcp = (grpc_tcp *)ep;
grpc_winsocket *socket = tcp->socket;
grpc_winsocket_callback_info *info = &socket->write_info;
diff --git a/src/core/lib/security/credentials/credentials.h b/src/core/lib/security/credentials/credentials.h
index 6fb5b5b15a..85b3bc5350 100644
--- a/src/core/lib/security/credentials/credentials.h
+++ b/src/core/lib/security/credentials/credentials.h
@@ -141,8 +141,8 @@ grpc_channel_credentials_duplicate_without_call_credentials(
/* --- grpc_credentials_md. --- */
typedef struct {
- gpr_slice key;
- gpr_slice value;
+ grpc_slice key;
+ grpc_slice value;
} grpc_credentials_md;
typedef struct {
@@ -157,7 +157,7 @@ grpc_credentials_md_store *grpc_credentials_md_store_create(
/* Will ref key and value. */
void grpc_credentials_md_store_add(grpc_credentials_md_store *store,
- gpr_slice key, gpr_slice value);
+ grpc_slice key, grpc_slice value);
void grpc_credentials_md_store_add_cstrings(grpc_credentials_md_store *store,
const char *key, const char *value);
grpc_credentials_md_store *grpc_credentials_md_store_ref(
diff --git a/src/core/lib/security/credentials/credentials_metadata.c b/src/core/lib/security/credentials/credentials_metadata.c
index 6a352aab3a..e6cb567734 100644
--- a/src/core/lib/security/credentials/credentials_metadata.c
+++ b/src/core/lib/security/credentials/credentials_metadata.c
@@ -59,11 +59,11 @@ grpc_credentials_md_store *grpc_credentials_md_store_create(
}
void grpc_credentials_md_store_add(grpc_credentials_md_store *store,
- gpr_slice key, gpr_slice value) {
+ grpc_slice key, grpc_slice value) {
if (store == NULL) return;
store_ensure_capacity(store);
- store->entries[store->num_entries].key = gpr_slice_ref(key);
- store->entries[store->num_entries].value = gpr_slice_ref(value);
+ store->entries[store->num_entries].key = grpc_slice_ref(key);
+ store->entries[store->num_entries].value = grpc_slice_ref(value);
store->num_entries++;
}
@@ -72,9 +72,9 @@ void grpc_credentials_md_store_add_cstrings(grpc_credentials_md_store *store,
const char *value) {
if (store == NULL) return;
store_ensure_capacity(store);
- store->entries[store->num_entries].key = gpr_slice_from_copied_string(key);
+ store->entries[store->num_entries].key = grpc_slice_from_copied_string(key);
store->entries[store->num_entries].value =
- gpr_slice_from_copied_string(value);
+ grpc_slice_from_copied_string(value);
store->num_entries++;
}
@@ -91,8 +91,8 @@ void grpc_credentials_md_store_unref(grpc_credentials_md_store *store) {
if (store->entries != NULL) {
size_t i;
for (i = 0; i < store->num_entries; i++) {
- gpr_slice_unref(store->entries[i].key);
- gpr_slice_unref(store->entries[i].value);
+ grpc_slice_unref(store->entries[i].key);
+ grpc_slice_unref(store->entries[i].value);
}
gpr_free(store->entries);
}
diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.c b/src/core/lib/security/credentials/google_default/google_default_credentials.c
index cb5ba554b0..b92f29a0d8 100644
--- a/src/core/lib/security/credentials/google_default/google_default_credentials.c
+++ b/src/core/lib/security/credentials/google_default/google_default_credentials.c
@@ -174,7 +174,7 @@ static grpc_error *create_default_creds_from_path(
grpc_auth_json_key key;
grpc_auth_refresh_token token;
grpc_call_credentials *result = NULL;
- gpr_slice creds_data = gpr_empty_slice();
+ grpc_slice creds_data = gpr_empty_slice();
grpc_error *error = GRPC_ERROR_NONE;
if (creds_path == NULL) {
error = GRPC_ERROR_CREATE("creds_path unset");
@@ -224,7 +224,7 @@ static grpc_error *create_default_creds_from_path(
end:
GPR_ASSERT((result == NULL) + (error == GRPC_ERROR_NONE) == 1);
if (creds_path != NULL) gpr_free(creds_path);
- gpr_slice_unref(creds_data);
+ grpc_slice_unref(creds_data);
if (json != NULL) grpc_json_destroy(json);
*creds = result;
return error;
diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.c b/src/core/lib/security/credentials/jwt/jwt_verifier.c
index 43eb642515..9cb8cd64f6 100644
--- a/src/core/lib/security/credentials/jwt/jwt_verifier.c
+++ b/src/core/lib/security/credentials/jwt/jwt_verifier.c
@@ -85,7 +85,7 @@ static const EVP_MD *evp_md_from_alg(const char *alg) {
}
static grpc_json *parse_json_part_from_jwt(const char *str, size_t len,
- gpr_slice *buffer) {
+ grpc_slice *buffer) {
grpc_json *json;
*buffer = grpc_base64_decode_with_len(str, len, 1);
@@ -96,7 +96,7 @@ static grpc_json *parse_json_part_from_jwt(const char *str, size_t len,
json = grpc_json_parse_string_with_len((char *)GPR_SLICE_START_PTR(*buffer),
GPR_SLICE_LENGTH(*buffer));
if (json == NULL) {
- gpr_slice_unref(*buffer);
+ grpc_slice_unref(*buffer);
gpr_log(GPR_ERROR, "JSON parsing error.");
}
return json;
@@ -129,16 +129,16 @@ typedef struct {
const char *kid;
const char *typ;
/* TODO(jboeuf): Add others as needed (jku, jwk, x5u, x5c and so on...). */
- gpr_slice buffer;
+ grpc_slice buffer;
} jose_header;
static void jose_header_destroy(jose_header *h) {
- gpr_slice_unref(h->buffer);
+ grpc_slice_unref(h->buffer);
gpr_free(h);
}
/* Takes ownership of json and buffer. */
-static jose_header *jose_header_from_json(grpc_json *json, gpr_slice buffer) {
+static jose_header *jose_header_from_json(grpc_json *json, grpc_slice buffer) {
grpc_json *cur;
jose_header *h = gpr_malloc(sizeof(jose_header));
memset(h, 0, sizeof(jose_header));
@@ -190,12 +190,12 @@ struct grpc_jwt_claims {
gpr_timespec nbf;
grpc_json *json;
- gpr_slice buffer;
+ grpc_slice buffer;
};
void grpc_jwt_claims_destroy(grpc_jwt_claims *claims) {
grpc_json_destroy(claims->json);
- gpr_slice_unref(claims->buffer);
+ grpc_slice_unref(claims->buffer);
gpr_free(claims);
}
@@ -240,7 +240,7 @@ gpr_timespec grpc_jwt_claims_not_before(const grpc_jwt_claims *claims) {
}
/* Takes ownership of json and buffer even in case of failure. */
-grpc_jwt_claims *grpc_jwt_claims_from_json(grpc_json *json, gpr_slice buffer) {
+grpc_jwt_claims *grpc_jwt_claims_from_json(grpc_json *json, grpc_slice buffer) {
grpc_json *cur;
grpc_jwt_claims *claims = gpr_malloc(sizeof(grpc_jwt_claims));
memset(claims, 0, sizeof(grpc_jwt_claims));
@@ -333,8 +333,8 @@ typedef struct {
jose_header *header;
grpc_jwt_claims *claims;
char *audience;
- gpr_slice signature;
- gpr_slice signed_data;
+ grpc_slice signature;
+ grpc_slice signed_data;
void *user_data;
grpc_jwt_verification_done_cb user_cb;
grpc_http_response responses[HTTP_RESPONSE_COUNT];
@@ -343,7 +343,7 @@ typedef struct {
/* Takes ownership of the header, claims and signature. */
static verifier_cb_ctx *verifier_cb_ctx_create(
grpc_jwt_verifier *verifier, grpc_pollset *pollset, jose_header *header,
- grpc_jwt_claims *claims, const char *audience, gpr_slice signature,
+ grpc_jwt_claims *claims, const char *audience, grpc_slice signature,
const char *signed_jwt, size_t signed_jwt_len, void *user_data,
grpc_jwt_verification_done_cb cb) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -355,7 +355,7 @@ static verifier_cb_ctx *verifier_cb_ctx_create(
ctx->audience = gpr_strdup(audience);
ctx->claims = claims;
ctx->signature = signature;
- ctx->signed_data = gpr_slice_from_copied_buffer(signed_jwt, signed_jwt_len);
+ ctx->signed_data = grpc_slice_from_copied_buffer(signed_jwt, signed_jwt_len);
ctx->user_data = user_data;
ctx->user_cb = cb;
grpc_exec_ctx_finish(&exec_ctx);
@@ -365,8 +365,8 @@ static verifier_cb_ctx *verifier_cb_ctx_create(
void verifier_cb_ctx_destroy(verifier_cb_ctx *ctx) {
if (ctx->audience != NULL) gpr_free(ctx->audience);
if (ctx->claims != NULL) grpc_jwt_claims_destroy(ctx->claims);
- gpr_slice_unref(ctx->signature);
- gpr_slice_unref(ctx->signed_data);
+ grpc_slice_unref(ctx->signature);
+ grpc_slice_unref(ctx->signed_data);
jose_header_destroy(ctx->header);
for (size_t i = 0; i < HTTP_RESPONSE_COUNT; i++) {
grpc_http_response_destroy(&ctx->responses[i]);
@@ -449,7 +449,7 @@ end:
static BIGNUM *bignum_from_base64(const char *b64) {
BIGNUM *result = NULL;
- gpr_slice bin;
+ grpc_slice bin;
if (b64 == NULL) return NULL;
bin = grpc_base64_decode(b64, 1);
@@ -459,7 +459,7 @@ static BIGNUM *bignum_from_base64(const char *b64) {
}
result = BN_bin2bn(GPR_SLICE_START_PTR(bin),
TSI_SIZE_AS_SIZE(GPR_SLICE_LENGTH(bin)), NULL);
- gpr_slice_unref(bin);
+ grpc_slice_unref(bin);
return result;
}
@@ -553,7 +553,7 @@ static EVP_PKEY *find_verification_key(const grpc_json *json,
}
static int verify_jwt_signature(EVP_PKEY *key, const char *alg,
- gpr_slice signature, gpr_slice signed_data) {
+ grpc_slice signature, grpc_slice signed_data) {
EVP_MD_CTX *md_ctx = EVP_MD_CTX_create();
const EVP_MD *md = evp_md_from_alg(alg);
int result = 0;
@@ -799,9 +799,9 @@ void grpc_jwt_verifier_verify(grpc_exec_ctx *exec_ctx,
grpc_json *json;
jose_header *header = NULL;
grpc_jwt_claims *claims = NULL;
- gpr_slice header_buffer;
- gpr_slice claims_buffer;
- gpr_slice signature;
+ grpc_slice header_buffer;
+ grpc_slice claims_buffer;
+ grpc_slice signature;
size_t signed_jwt_len;
const char *cur = jwt;
diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.h b/src/core/lib/security/credentials/jwt/jwt_verifier.h
index b0f6d1c240..e05a9f1824 100644
--- a/src/core/lib/security/credentials/jwt/jwt_verifier.h
+++ b/src/core/lib/security/credentials/jwt/jwt_verifier.h
@@ -129,7 +129,7 @@ void grpc_jwt_verifier_verify(grpc_exec_ctx *exec_ctx,
/* --- TESTING ONLY exposed functions. --- */
-grpc_jwt_claims *grpc_jwt_claims_from_json(grpc_json *json, gpr_slice buffer);
+grpc_jwt_claims *grpc_jwt_claims_from_json(grpc_json *json, grpc_slice buffer);
grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims *claims,
const char *audience);
diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.c b/src/core/lib/security/credentials/plugin/plugin_credentials.c
index 905de3723e..61c10862da 100644
--- a/src/core/lib/security/credentials/plugin/plugin_credentials.c
+++ b/src/core/lib/security/credentials/plugin/plugin_credentials.c
@@ -93,15 +93,15 @@ static void plugin_md_request_metadata_ready(void *request,
} else if (num_md > 0) {
md_array = gpr_malloc(num_md * sizeof(grpc_credentials_md));
for (i = 0; i < num_md; i++) {
- md_array[i].key = gpr_slice_from_copied_string(md[i].key);
+ md_array[i].key = grpc_slice_from_copied_string(md[i].key);
md_array[i].value =
- gpr_slice_from_copied_buffer(md[i].value, md[i].value_length);
+ grpc_slice_from_copied_buffer(md[i].value, md[i].value_length);
}
r->cb(&exec_ctx, r->user_data, md_array, num_md, GRPC_CREDENTIALS_OK,
NULL);
for (i = 0; i < num_md; i++) {
- gpr_slice_unref(md_array[i].key);
- gpr_slice_unref(md_array[i].value);
+ grpc_slice_unref(md_array[i].key);
+ grpc_slice_unref(md_array[i].value);
}
gpr_free(md_array);
}
diff --git a/src/core/lib/security/transport/client_auth_filter.c b/src/core/lib/security/transport/client_auth_filter.c
index b366d1410f..cd4769ea10 100644
--- a/src/core/lib/security/transport/client_auth_filter.c
+++ b/src/core/lib/security/transport/client_auth_filter.c
@@ -92,7 +92,7 @@ static void bubble_up_error(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_status_code status, const char *error_msg) {
call_data *calld = elem->call_data;
gpr_log(GPR_ERROR, "Client side authentication failure: %s", error_msg);
- gpr_slice error_slice = gpr_slice_from_copied_string(error_msg);
+ grpc_slice error_slice = grpc_slice_from_copied_string(error_msg);
grpc_transport_stream_op_add_close(&calld->op, status, &error_slice);
grpc_call_next_op(exec_ctx, elem, &calld->op);
}
@@ -121,8 +121,8 @@ static void on_credentials_metadata(grpc_exec_ctx *exec_ctx, void *user_data,
for (i = 0; i < num_md; i++) {
grpc_metadata_batch_add_tail(
mdb, &calld->md_links[i],
- grpc_mdelem_from_slices(gpr_slice_ref(md_elems[i].key),
- gpr_slice_ref(md_elems[i].value)));
+ grpc_mdelem_from_slices(grpc_slice_ref(md_elems[i].key),
+ grpc_slice_ref(md_elems[i].value)));
}
grpc_call_next_op(exec_ctx, elem, op);
}
diff --git a/src/core/lib/security/transport/handshake.c b/src/core/lib/security/transport/handshake.c
index fbeec312b6..2d33521d94 100644
--- a/src/core/lib/security/transport/handshake.c
+++ b/src/core/lib/security/transport/handshake.c
@@ -54,9 +54,9 @@ typedef struct {
size_t handshake_buffer_size;
grpc_endpoint *wrapped_endpoint;
grpc_endpoint *secure_endpoint;
- gpr_slice_buffer left_overs;
- gpr_slice_buffer incoming;
- gpr_slice_buffer outgoing;
+ grpc_slice_buffer left_overs;
+ grpc_slice_buffer incoming;
+ grpc_slice_buffer outgoing;
grpc_security_handshake_done_cb cb;
void *user_data;
grpc_closure on_handshake_data_sent_to_peer;
@@ -104,9 +104,9 @@ static void unref_handshake(grpc_security_handshake *h) {
if (gpr_unref(&h->refs)) {
if (h->handshaker != NULL) tsi_handshaker_destroy(h->handshaker);
if (h->handshake_buffer != NULL) gpr_free(h->handshake_buffer);
- gpr_slice_buffer_destroy(&h->left_overs);
- gpr_slice_buffer_destroy(&h->outgoing);
- gpr_slice_buffer_destroy(&h->incoming);
+ grpc_slice_buffer_destroy(&h->left_overs);
+ grpc_slice_buffer_destroy(&h->outgoing);
+ grpc_slice_buffer_destroy(&h->incoming);
GRPC_AUTH_CONTEXT_UNREF(h->auth_context, "handshake");
GRPC_SECURITY_CONNECTOR_UNREF(h->connector, "handshake");
gpr_free(h);
@@ -190,7 +190,7 @@ static void send_handshake_bytes_to_peer(grpc_exec_ctx *exec_ctx,
grpc_security_handshake *h) {
size_t offset = 0;
tsi_result result = TSI_OK;
- gpr_slice to_send;
+ grpc_slice to_send;
do {
size_t to_send_size = h->handshake_buffer_size - offset;
@@ -212,9 +212,9 @@ static void send_handshake_bytes_to_peer(grpc_exec_ctx *exec_ctx,
}
to_send =
- gpr_slice_from_copied_buffer((const char *)h->handshake_buffer, offset);
- gpr_slice_buffer_reset_and_unref(&h->outgoing);
- gpr_slice_buffer_add(&h->outgoing, to_send);
+ grpc_slice_from_copied_buffer((const char *)h->handshake_buffer, offset);
+ grpc_slice_buffer_reset_and_unref(&h->outgoing);
+ grpc_slice_buffer_add(&h->outgoing, to_send);
/* TODO(klempner,jboeuf): This should probably use the client setup
deadline */
grpc_endpoint_write(exec_ctx, h->wrapped_endpoint, &h->outgoing,
@@ -277,13 +277,13 @@ static void on_handshake_data_received_from_peer(grpc_exec_ctx *exec_ctx,
/* Put the leftovers in our buffer (ownership transfered). */
if (has_left_overs_in_current_slice) {
- gpr_slice_buffer_add(
+ grpc_slice_buffer_add(
&h->left_overs,
- gpr_slice_split_tail(&h->incoming.slices[i], consumed_slice_size));
- gpr_slice_unref(
+ grpc_slice_split_tail(&h->incoming.slices[i], consumed_slice_size));
+ grpc_slice_unref(
h->incoming.slices[i]); /* split_tail above increments refcount. */
}
- gpr_slice_buffer_addn(
+ grpc_slice_buffer_addn(
&h->left_overs, &h->incoming.slices[i + 1],
num_left_overs - (size_t)has_left_overs_in_current_slice);
check_peer(exec_ctx, h);
@@ -325,7 +325,7 @@ static void on_timeout(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
void grpc_do_security_handshake(
grpc_exec_ctx *exec_ctx, tsi_handshaker *handshaker,
grpc_security_connector *connector, bool is_client_side,
- grpc_endpoint *nonsecure_endpoint, gpr_slice_buffer *read_buffer,
+ grpc_endpoint *nonsecure_endpoint, grpc_slice_buffer *read_buffer,
gpr_timespec deadline, grpc_security_handshake_done_cb cb,
void *user_data) {
grpc_security_connector_handshake_list *handshake_node;
@@ -344,11 +344,11 @@ void grpc_do_security_handshake(
on_handshake_data_sent_to_peer, h);
grpc_closure_init(&h->on_handshake_data_received_from_peer,
on_handshake_data_received_from_peer, h);
- gpr_slice_buffer_init(&h->left_overs);
- gpr_slice_buffer_init(&h->outgoing);
- gpr_slice_buffer_init(&h->incoming);
+ grpc_slice_buffer_init(&h->left_overs);
+ grpc_slice_buffer_init(&h->outgoing);
+ grpc_slice_buffer_init(&h->incoming);
if (read_buffer != NULL) {
- gpr_slice_buffer_move_into(read_buffer, &h->incoming);
+ grpc_slice_buffer_move_into(read_buffer, &h->incoming);
gpr_free(read_buffer);
}
if (!is_client_side) {
diff --git a/src/core/lib/security/transport/handshake.h b/src/core/lib/security/transport/handshake.h
index 53092f5421..f894540515 100644
--- a/src/core/lib/security/transport/handshake.h
+++ b/src/core/lib/security/transport/handshake.h
@@ -42,7 +42,7 @@
void grpc_do_security_handshake(
grpc_exec_ctx *exec_ctx, tsi_handshaker *handshaker,
grpc_security_connector *connector, bool is_client_side,
- grpc_endpoint *nonsecure_endpoint, gpr_slice_buffer *read_buffer,
+ grpc_endpoint *nonsecure_endpoint, grpc_slice_buffer *read_buffer,
gpr_timespec deadline, grpc_security_handshake_done_cb cb, void *user_data);
void grpc_security_handshake_shutdown(grpc_exec_ctx *exec_ctx, void *handshake);
diff --git a/src/core/lib/security/transport/secure_endpoint.c b/src/core/lib/security/transport/secure_endpoint.c
index 3924997d31..865a0ec4cf 100644
--- a/src/core/lib/security/transport/secure_endpoint.c
+++ b/src/core/lib/security/transport/secure_endpoint.c
@@ -54,15 +54,15 @@ typedef struct {
grpc_closure *read_cb;
grpc_closure *write_cb;
grpc_closure on_read;
- gpr_slice_buffer *read_buffer;
- gpr_slice_buffer source_buffer;
+ grpc_slice_buffer *read_buffer;
+ grpc_slice_buffer source_buffer;
/* saved handshaker leftover data to unprotect. */
- gpr_slice_buffer leftover_bytes;
+ grpc_slice_buffer leftover_bytes;
/* buffers for read and write */
- gpr_slice read_staging_buffer;
+ grpc_slice read_staging_buffer;
- gpr_slice write_staging_buffer;
- gpr_slice_buffer output_buffer;
+ grpc_slice write_staging_buffer;
+ grpc_slice_buffer output_buffer;
gpr_refcount ref;
} secure_endpoint;
@@ -73,11 +73,11 @@ static void destroy(grpc_exec_ctx *exec_ctx, secure_endpoint *secure_ep) {
secure_endpoint *ep = secure_ep;
grpc_endpoint_destroy(exec_ctx, ep->wrapped_ep);
tsi_frame_protector_destroy(ep->protector);
- gpr_slice_buffer_destroy(&ep->leftover_bytes);
- gpr_slice_unref(ep->read_staging_buffer);
- gpr_slice_unref(ep->write_staging_buffer);
- gpr_slice_buffer_destroy(&ep->output_buffer);
- gpr_slice_buffer_destroy(&ep->source_buffer);
+ grpc_slice_buffer_destroy(&ep->leftover_bytes);
+ grpc_slice_unref(ep->read_staging_buffer);
+ grpc_slice_unref(ep->write_staging_buffer);
+ grpc_slice_buffer_destroy(&ep->output_buffer);
+ grpc_slice_buffer_destroy(&ep->source_buffer);
gpr_mu_destroy(&ep->protector_mu);
gpr_free(ep);
}
@@ -121,8 +121,8 @@ static void secure_endpoint_ref(secure_endpoint *ep) { gpr_ref(&ep->ref); }
static void flush_read_staging_buffer(secure_endpoint *ep, uint8_t **cur,
uint8_t **end) {
- gpr_slice_buffer_add(ep->read_buffer, ep->read_staging_buffer);
- ep->read_staging_buffer = gpr_slice_malloc(STAGING_BUFFER_SIZE);
+ grpc_slice_buffer_add(ep->read_buffer, ep->read_staging_buffer);
+ ep->read_staging_buffer = grpc_slice_malloc(STAGING_BUFFER_SIZE);
*cur = GPR_SLICE_START_PTR(ep->read_staging_buffer);
*end = GPR_SLICE_END_PTR(ep->read_staging_buffer);
}
@@ -153,7 +153,7 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *user_data,
uint8_t *end = GPR_SLICE_END_PTR(ep->read_staging_buffer);
if (error != GRPC_ERROR_NONE) {
- gpr_slice_buffer_reset_and_unref(ep->read_buffer);
+ grpc_slice_buffer_reset_and_unref(ep->read_buffer);
call_read_cb(exec_ctx, ep, GRPC_ERROR_CREATE_REFERENCING(
"Secure read failed", &error, 1));
return;
@@ -161,7 +161,7 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *user_data,
/* TODO(yangg) check error, maybe bail out early */
for (i = 0; i < ep->source_buffer.count; i++) {
- gpr_slice encrypted = ep->source_buffer.slices[i];
+ grpc_slice encrypted = ep->source_buffer.slices[i];
uint8_t *message_bytes = GPR_SLICE_START_PTR(encrypted);
size_t message_size = GPR_SLICE_LENGTH(encrypted);
@@ -199,19 +199,19 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *user_data,
}
if (cur != GPR_SLICE_START_PTR(ep->read_staging_buffer)) {
- gpr_slice_buffer_add(
+ grpc_slice_buffer_add(
ep->read_buffer,
- gpr_slice_split_head(
+ grpc_slice_split_head(
&ep->read_staging_buffer,
(size_t)(cur - GPR_SLICE_START_PTR(ep->read_staging_buffer))));
}
/* TODO(yangg) experiment with moving this block after read_cb to see if it
helps latency */
- gpr_slice_buffer_reset_and_unref(&ep->source_buffer);
+ grpc_slice_buffer_reset_and_unref(&ep->source_buffer);
if (result != TSI_OK) {
- gpr_slice_buffer_reset_and_unref(ep->read_buffer);
+ grpc_slice_buffer_reset_and_unref(ep->read_buffer);
call_read_cb(exec_ctx, ep, grpc_set_tsi_error_result(
GRPC_ERROR_CREATE("Unwrap failed"), result));
return;
@@ -221,15 +221,15 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *user_data,
}
static void endpoint_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *secure_ep,
- gpr_slice_buffer *slices, grpc_closure *cb) {
+ grpc_slice_buffer *slices, grpc_closure *cb) {
secure_endpoint *ep = (secure_endpoint *)secure_ep;
ep->read_cb = cb;
ep->read_buffer = slices;
- gpr_slice_buffer_reset_and_unref(ep->read_buffer);
+ grpc_slice_buffer_reset_and_unref(ep->read_buffer);
SECURE_ENDPOINT_REF(ep, "read");
if (ep->leftover_bytes.count) {
- gpr_slice_buffer_swap(&ep->leftover_bytes, &ep->source_buffer);
+ grpc_slice_buffer_swap(&ep->leftover_bytes, &ep->source_buffer);
GPR_ASSERT(ep->leftover_bytes.count == 0);
on_read(exec_ctx, ep, GRPC_ERROR_NONE);
return;
@@ -241,14 +241,14 @@ static void endpoint_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *secure_ep,
static void flush_write_staging_buffer(secure_endpoint *ep, uint8_t **cur,
uint8_t **end) {
- gpr_slice_buffer_add(&ep->output_buffer, ep->write_staging_buffer);
- ep->write_staging_buffer = gpr_slice_malloc(STAGING_BUFFER_SIZE);
+ grpc_slice_buffer_add(&ep->output_buffer, ep->write_staging_buffer);
+ ep->write_staging_buffer = grpc_slice_malloc(STAGING_BUFFER_SIZE);
*cur = GPR_SLICE_START_PTR(ep->write_staging_buffer);
*end = GPR_SLICE_END_PTR(ep->write_staging_buffer);
}
static void endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *secure_ep,
- gpr_slice_buffer *slices, grpc_closure *cb) {
+ grpc_slice_buffer *slices, grpc_closure *cb) {
GPR_TIMER_BEGIN("secure_endpoint.endpoint_write", 0);
unsigned i;
@@ -257,7 +257,7 @@ static void endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *secure_ep,
uint8_t *cur = GPR_SLICE_START_PTR(ep->write_staging_buffer);
uint8_t *end = GPR_SLICE_END_PTR(ep->write_staging_buffer);
- gpr_slice_buffer_reset_and_unref(&ep->output_buffer);
+ grpc_slice_buffer_reset_and_unref(&ep->output_buffer);
if (grpc_trace_secure_endpoint) {
for (i = 0; i < slices->count; i++) {
@@ -269,7 +269,7 @@ static void endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *secure_ep,
}
for (i = 0; i < slices->count; i++) {
- gpr_slice plain = slices->slices[i];
+ grpc_slice plain = slices->slices[i];
uint8_t *message_bytes = GPR_SLICE_START_PTR(plain);
size_t message_size = GPR_SLICE_LENGTH(plain);
while (message_size > 0) {
@@ -311,9 +311,9 @@ static void endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *secure_ep,
}
} while (still_pending_size > 0);
if (cur != GPR_SLICE_START_PTR(ep->write_staging_buffer)) {
- gpr_slice_buffer_add(
+ grpc_slice_buffer_add(
&ep->output_buffer,
- gpr_slice_split_head(
+ grpc_slice_split_head(
&ep->write_staging_buffer,
(size_t)(cur - GPR_SLICE_START_PTR(ep->write_staging_buffer))));
}
@@ -321,7 +321,7 @@ static void endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *secure_ep,
if (result != TSI_OK) {
/* TODO(yangg) do different things according to the error type? */
- gpr_slice_buffer_reset_and_unref(&ep->output_buffer);
+ grpc_slice_buffer_reset_and_unref(&ep->output_buffer);
grpc_exec_ctx_sched(
exec_ctx, cb,
grpc_set_tsi_error_result(GRPC_ERROR_CREATE("Wrap failed"), result),
@@ -388,21 +388,21 @@ static const grpc_endpoint_vtable vtable = {endpoint_read,
grpc_endpoint *grpc_secure_endpoint_create(
struct tsi_frame_protector *protector, grpc_endpoint *transport,
- gpr_slice *leftover_slices, size_t leftover_nslices) {
+ grpc_slice *leftover_slices, size_t leftover_nslices) {
size_t i;
secure_endpoint *ep = (secure_endpoint *)gpr_malloc(sizeof(secure_endpoint));
ep->base.vtable = &vtable;
ep->wrapped_ep = transport;
ep->protector = protector;
- gpr_slice_buffer_init(&ep->leftover_bytes);
+ grpc_slice_buffer_init(&ep->leftover_bytes);
for (i = 0; i < leftover_nslices; i++) {
- gpr_slice_buffer_add(&ep->leftover_bytes,
- gpr_slice_ref(leftover_slices[i]));
+ grpc_slice_buffer_add(&ep->leftover_bytes,
+ grpc_slice_ref(leftover_slices[i]));
}
- ep->write_staging_buffer = gpr_slice_malloc(STAGING_BUFFER_SIZE);
- ep->read_staging_buffer = gpr_slice_malloc(STAGING_BUFFER_SIZE);
- gpr_slice_buffer_init(&ep->output_buffer);
- gpr_slice_buffer_init(&ep->source_buffer);
+ ep->write_staging_buffer = grpc_slice_malloc(STAGING_BUFFER_SIZE);
+ ep->read_staging_buffer = grpc_slice_malloc(STAGING_BUFFER_SIZE);
+ grpc_slice_buffer_init(&ep->output_buffer);
+ grpc_slice_buffer_init(&ep->source_buffer);
ep->read_buffer = NULL;
grpc_closure_init(&ep->on_read, on_read, ep);
gpr_mu_init(&ep->protector_mu);
diff --git a/src/core/lib/security/transport/secure_endpoint.h b/src/core/lib/security/transport/secure_endpoint.h
index d00075b769..986e5e9f2e 100644
--- a/src/core/lib/security/transport/secure_endpoint.h
+++ b/src/core/lib/security/transport/secure_endpoint.h
@@ -44,6 +44,6 @@ extern int grpc_trace_secure_endpoint;
/* Takes ownership of protector and to_wrap, and refs leftover_slices. */
grpc_endpoint *grpc_secure_endpoint_create(
struct tsi_frame_protector *protector, grpc_endpoint *to_wrap,
- gpr_slice *leftover_slices, size_t leftover_nslices);
+ grpc_slice *leftover_slices, size_t leftover_nslices);
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */
diff --git a/src/core/lib/security/transport/security_connector.c b/src/core/lib/security/transport/security_connector.c
index 0eca46eb52..9de69f2288 100644
--- a/src/core/lib/security/transport/security_connector.c
+++ b/src/core/lib/security/transport/security_connector.c
@@ -127,7 +127,7 @@ void grpc_server_security_connector_shutdown(
void grpc_channel_security_connector_do_handshake(
grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
- grpc_endpoint *nonsecure_endpoint, gpr_slice_buffer *read_buffer,
+ grpc_endpoint *nonsecure_endpoint, grpc_slice_buffer *read_buffer,
gpr_timespec deadline, grpc_security_handshake_done_cb cb,
void *user_data) {
if (sc == NULL || nonsecure_endpoint == NULL) {
@@ -142,7 +142,7 @@ void grpc_channel_security_connector_do_handshake(
void grpc_server_security_connector_do_handshake(
grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc,
grpc_tcp_server_acceptor *acceptor, grpc_endpoint *nonsecure_endpoint,
- gpr_slice_buffer *read_buffer, gpr_timespec deadline,
+ grpc_slice_buffer *read_buffer, gpr_timespec deadline,
grpc_security_handshake_done_cb cb, void *user_data) {
if (sc == NULL || nonsecure_endpoint == NULL) {
gpr_free(read_buffer);
@@ -316,7 +316,7 @@ static void fake_channel_check_call_host(grpc_exec_ctx *exec_ctx,
static void fake_channel_do_handshake(grpc_exec_ctx *exec_ctx,
grpc_channel_security_connector *sc,
grpc_endpoint *nonsecure_endpoint,
- gpr_slice_buffer *read_buffer,
+ grpc_slice_buffer *read_buffer,
gpr_timespec deadline,
grpc_security_handshake_done_cb cb,
void *user_data) {
@@ -328,7 +328,7 @@ static void fake_channel_do_handshake(grpc_exec_ctx *exec_ctx,
static void fake_server_do_handshake(
grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc,
grpc_tcp_server_acceptor *acceptor, grpc_endpoint *nonsecure_endpoint,
- gpr_slice_buffer *read_buffer, gpr_timespec deadline,
+ grpc_slice_buffer *read_buffer, gpr_timespec deadline,
grpc_security_handshake_done_cb cb, void *user_data) {
grpc_do_security_handshake(exec_ctx, tsi_create_fake_handshaker(0), &sc->base,
false, nonsecure_endpoint, read_buffer, deadline,
@@ -422,7 +422,7 @@ static grpc_security_status ssl_create_handshaker(
static void ssl_channel_do_handshake(grpc_exec_ctx *exec_ctx,
grpc_channel_security_connector *sc,
grpc_endpoint *nonsecure_endpoint,
- gpr_slice_buffer *read_buffer,
+ grpc_slice_buffer *read_buffer,
gpr_timespec deadline,
grpc_security_handshake_done_cb cb,
void *user_data) {
@@ -447,7 +447,7 @@ static void ssl_channel_do_handshake(grpc_exec_ctx *exec_ctx,
static void ssl_server_do_handshake(
grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc,
grpc_tcp_server_acceptor *acceptor, grpc_endpoint *nonsecure_endpoint,
- gpr_slice_buffer *read_buffer, gpr_timespec deadline,
+ grpc_slice_buffer *read_buffer, gpr_timespec deadline,
grpc_security_handshake_done_cb cb, void *user_data) {
grpc_ssl_server_security_connector *c =
(grpc_ssl_server_security_connector *)sc;
@@ -642,8 +642,8 @@ static grpc_security_connector_vtable ssl_channel_vtable = {
static grpc_security_connector_vtable ssl_server_vtable = {
ssl_server_destroy, ssl_server_check_peer};
-static gpr_slice compute_default_pem_root_certs_once(void) {
- gpr_slice result = gpr_empty_slice();
+static grpc_slice compute_default_pem_root_certs_once(void) {
+ grpc_slice result = gpr_empty_slice();
/* First try to load the roots from the environment. */
char *default_root_certs_path =
@@ -661,7 +661,7 @@ static gpr_slice compute_default_pem_root_certs_once(void) {
ovrd_res = ssl_roots_override_cb(&pem_root_certs);
if (ovrd_res == GRPC_SSL_ROOTS_OVERRIDE_OK) {
GPR_ASSERT(pem_root_certs != NULL);
- result = gpr_slice_new(pem_root_certs, strlen(pem_root_certs), gpr_free);
+ result = grpc_slice_new(pem_root_certs, strlen(pem_root_certs), gpr_free);
}
}
@@ -674,13 +674,13 @@ static gpr_slice compute_default_pem_root_certs_once(void) {
return result;
}
-static gpr_slice default_pem_root_certs;
+static grpc_slice default_pem_root_certs;
static void init_default_pem_root_certs(void) {
default_pem_root_certs = compute_default_pem_root_certs_once();
}
-gpr_slice grpc_get_default_ssl_roots_for_testing(void) {
+grpc_slice grpc_get_default_ssl_roots_for_testing(void) {
return compute_default_pem_root_certs_once();
}
diff --git a/src/core/lib/security/transport/security_connector.h b/src/core/lib/security/transport/security_connector.h
index 0b5b44bf1a..dc02692b01 100644
--- a/src/core/lib/security/transport/security_connector.h
+++ b/src/core/lib/security/transport/security_connector.h
@@ -144,7 +144,7 @@ struct grpc_channel_security_connector {
void (*do_handshake)(grpc_exec_ctx *exec_ctx,
grpc_channel_security_connector *sc,
grpc_endpoint *nonsecure_endpoint,
- gpr_slice_buffer *read_buffer, gpr_timespec deadline,
+ grpc_slice_buffer *read_buffer, gpr_timespec deadline,
grpc_security_handshake_done_cb cb, void *user_data);
};
@@ -157,7 +157,7 @@ void grpc_channel_security_connector_check_call_host(
/* Handshake. */
void grpc_channel_security_connector_do_handshake(
grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *connector,
- grpc_endpoint *nonsecure_endpoint, gpr_slice_buffer *read_buffer,
+ grpc_endpoint *nonsecure_endpoint, grpc_slice_buffer *read_buffer,
gpr_timespec deadline, grpc_security_handshake_done_cb cb, void *user_data);
/* --- server_security_connector object. ---
@@ -176,14 +176,14 @@ struct grpc_server_security_connector {
grpc_server_security_connector *sc,
grpc_tcp_server_acceptor *acceptor,
grpc_endpoint *nonsecure_endpoint,
- gpr_slice_buffer *read_buffer, gpr_timespec deadline,
+ grpc_slice_buffer *read_buffer, gpr_timespec deadline,
grpc_security_handshake_done_cb cb, void *user_data);
};
void grpc_server_security_connector_do_handshake(
grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc,
grpc_tcp_server_acceptor *acceptor, grpc_endpoint *nonsecure_endpoint,
- gpr_slice_buffer *read_buffer, gpr_timespec deadline,
+ grpc_slice_buffer *read_buffer, gpr_timespec deadline,
grpc_security_handshake_done_cb cb, void *user_data);
void grpc_server_security_connector_shutdown(
@@ -233,7 +233,7 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
size_t grpc_get_default_ssl_roots(const unsigned char **pem_root_certs);
/* Exposed for TESTING ONLY!. */
-gpr_slice grpc_get_default_ssl_roots_for_testing(void);
+grpc_slice grpc_get_default_ssl_roots_for_testing(void);
/* Config for ssl servers. */
typedef struct {
diff --git a/src/core/lib/security/transport/server_auth_filter.c b/src/core/lib/security/transport/server_auth_filter.c
index b2c6815af8..39973ab036 100644
--- a/src/core/lib/security/transport/server_auth_filter.c
+++ b/src/core/lib/security/transport/server_auth_filter.c
@@ -134,14 +134,14 @@ static void on_md_processing_done(
grpc_metadata_array_destroy(&calld->md);
grpc_exec_ctx_sched(&exec_ctx, calld->on_done_recv, GRPC_ERROR_NONE, NULL);
} else {
- gpr_slice message;
+ grpc_slice message;
grpc_transport_stream_op *close_op = gpr_malloc(sizeof(*close_op));
memset(close_op, 0, sizeof(*close_op));
grpc_metadata_array_destroy(&calld->md);
error_details = error_details != NULL
? error_details
: "Authentication metadata processing failed.";
- message = gpr_slice_from_copied_string(error_details);
+ message = grpc_slice_from_copied_string(error_details);
calld->transport_op->send_initial_metadata = NULL;
if (calld->transport_op->send_message != NULL) {
grpc_byte_stream_destroy(&exec_ctx, calld->transport_op->send_message);
diff --git a/src/core/lib/security/util/b64.c b/src/core/lib/security/util/b64.c
index 9da42e4e73..f4f0092c3d 100644
--- a/src/core/lib/security/util/b64.c
+++ b/src/core/lib/security/util/b64.c
@@ -120,7 +120,7 @@ char *grpc_base64_encode(const void *vdata, size_t data_size, int url_safe,
return result;
}
-gpr_slice grpc_base64_decode(const char *b64, int url_safe) {
+grpc_slice grpc_base64_decode(const char *b64, int url_safe) {
return grpc_base64_decode_with_len(b64, strlen(b64), url_safe);
}
@@ -182,9 +182,9 @@ static int decode_group(const unsigned char *codes, size_t num_codes,
return 1;
}
-gpr_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len,
+grpc_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len,
int url_safe) {
- gpr_slice result = gpr_slice_malloc(b64_len);
+ grpc_slice result = grpc_slice_malloc(b64_len);
unsigned char *current = GPR_SLICE_START_PTR(result);
size_t result_size = 0;
unsigned char codes[4];
@@ -228,6 +228,6 @@ gpr_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len,
return result;
fail:
- gpr_slice_unref(result);
+ grpc_slice_unref(result);
return gpr_empty_slice();
}
diff --git a/src/core/lib/security/util/b64.h b/src/core/lib/security/util/b64.h
index 6908095287..f1b9bb2f2e 100644
--- a/src/core/lib/security/util/b64.h
+++ b/src/core/lib/security/util/b64.h
@@ -43,10 +43,10 @@ char *grpc_base64_encode(const void *data, size_t data_size, int url_safe,
/* Decodes data according to the base64 specification. Returns an empty
slice in case of failure. */
-gpr_slice grpc_base64_decode(const char *b64, int url_safe);
+grpc_slice grpc_base64_decode(const char *b64, int url_safe);
/* Same as above except that the length is provided by the caller. */
-gpr_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len,
+grpc_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len,
int url_safe);
#endif /* GRPC_CORE_LIB_SECURITY_UTIL_B64_H */
diff --git a/src/core/lib/support/percent_encoding.c b/src/core/lib/slice/percent_encoding.c
index 3c19f264f9..ae11e225e7 100644
--- a/src/core/lib/support/percent_encoding.c
+++ b/src/core/lib/slice/percent_encoding.c
@@ -49,7 +49,7 @@ static bool is_unreserved_character(uint8_t c,
return ((unreserved_bytes[c / 8] >> (c % 8)) & 1) != 0;
}
-gpr_slice gpr_percent_encode_slice(gpr_slice slice,
+grpc_slice gpr_percent_encode_slice(grpc_slice slice,
const uint8_t *unreserved_bytes) {
static const uint8_t hex[] = "0123456789ABCDEF";
@@ -66,10 +66,10 @@ gpr_slice gpr_percent_encode_slice(gpr_slice slice,
}
// no unreserved bytes: return the string unmodified
if (!any_reserved_bytes) {
- return gpr_slice_ref(slice);
+ return grpc_slice_ref(slice);
}
// second pass: actually encode
- gpr_slice out = gpr_slice_malloc(output_length);
+ grpc_slice out = grpc_slice_malloc(output_length);
uint8_t *q = GPR_SLICE_START_PTR(out);
for (p = slice_start; p < slice_end; p++) {
if (is_unreserved_character(*p, unreserved_bytes)) {
@@ -97,9 +97,9 @@ static uint8_t dehex(uint8_t c) {
GPR_UNREACHABLE_CODE(return 255);
}
-bool gpr_strict_percent_decode_slice(gpr_slice slice_in,
+bool gpr_strict_percent_decode_slice(grpc_slice slice_in,
const uint8_t *unreserved_bytes,
- gpr_slice *slice_out) {
+ grpc_slice *slice_out) {
const uint8_t *p = GPR_SLICE_START_PTR(slice_in);
const uint8_t *in_end = GPR_SLICE_END_PTR(slice_in);
size_t out_length = 0;
@@ -119,11 +119,11 @@ bool gpr_strict_percent_decode_slice(gpr_slice slice_in,
}
}
if (!any_percent_encoded_stuff) {
- *slice_out = gpr_slice_ref(slice_in);
+ *slice_out = grpc_slice_ref(slice_in);
return true;
}
p = GPR_SLICE_START_PTR(slice_in);
- *slice_out = gpr_slice_malloc(out_length);
+ *slice_out = grpc_slice_malloc(out_length);
uint8_t *q = GPR_SLICE_START_PTR(*slice_out);
while (p != in_end) {
if (*p == '%') {
@@ -137,7 +137,7 @@ bool gpr_strict_percent_decode_slice(gpr_slice slice_in,
return true;
}
-gpr_slice gpr_permissive_percent_decode_slice(gpr_slice slice_in) {
+grpc_slice gpr_permissive_percent_decode_slice(grpc_slice slice_in) {
const uint8_t *p = GPR_SLICE_START_PTR(slice_in);
const uint8_t *in_end = GPR_SLICE_END_PTR(slice_in);
size_t out_length = 0;
@@ -158,10 +158,10 @@ gpr_slice gpr_permissive_percent_decode_slice(gpr_slice slice_in) {
}
}
if (!any_percent_encoded_stuff) {
- return gpr_slice_ref(slice_in);
+ return grpc_slice_ref(slice_in);
}
p = GPR_SLICE_START_PTR(slice_in);
- gpr_slice out = gpr_slice_malloc(out_length);
+ grpc_slice out = grpc_slice_malloc(out_length);
uint8_t *q = GPR_SLICE_START_PTR(out);
while (p != in_end) {
if (*p == '%') {
diff --git a/src/core/lib/support/percent_encoding.h b/src/core/lib/slice/percent_encoding.h
index 000bf14ede..a560d74a79 100644
--- a/src/core/lib/support/percent_encoding.h
+++ b/src/core/lib/slice/percent_encoding.h
@@ -59,7 +59,7 @@ extern const uint8_t gpr_compatible_percent_encoding_unreserved_bytes[256 / 8];
/* Percent-encode a slice, returning the new slice (this cannot fail):
unreserved_bytes is a bitfield indicating which bytes are considered
unreserved and thus do not need percent encoding */
-gpr_slice gpr_percent_encode_slice(gpr_slice slice,
+grpc_slice gpr_percent_encode_slice(grpc_slice slice,
const uint8_t *unreserved_bytes);
/* Percent-decode a slice, strictly.
If the input is legal (contains no unreserved bytes, and legal % encodings),
@@ -67,12 +67,12 @@ gpr_slice gpr_percent_encode_slice(gpr_slice slice,
If the input is not legal, returns false and leaves *slice_out untouched.
unreserved_bytes is a bitfield indicating which bytes are considered
unreserved and thus do not need percent encoding */
-bool gpr_strict_percent_decode_slice(gpr_slice slice_in,
+bool gpr_strict_percent_decode_slice(grpc_slice slice_in,
const uint8_t *unreserved_bytes,
- gpr_slice *slice_out);
+ grpc_slice *slice_out);
/* Percent-decode a slice, permissively.
If a % triplet can not be decoded, pass it through verbatim.
This cannot fail. */
-gpr_slice gpr_permissive_percent_decode_slice(gpr_slice slice_in);
+grpc_slice gpr_permissive_percent_decode_slice(grpc_slice slice_in);
#endif /* GRPC_CORE_LIB_SUPPORT_PERCENT_ENCODING_H */
diff --git a/src/core/lib/support/slice.c b/src/core/lib/slice/slice.c
index 8a2c0a9086..602dd86eca 100644
--- a/src/core/lib/support/slice.c
+++ b/src/core/lib/slice/slice.c
@@ -37,45 +37,45 @@
#include <string.h>
-gpr_slice gpr_empty_slice(void) {
- gpr_slice out;
+grpc_slice gpr_empty_slice(void) {
+ grpc_slice out;
out.refcount = 0;
out.data.inlined.length = 0;
return out;
}
-gpr_slice gpr_slice_ref(gpr_slice slice) {
+grpc_slice grpc_slice_ref(grpc_slice slice) {
if (slice.refcount) {
slice.refcount->ref(slice.refcount);
}
return slice;
}
-void gpr_slice_unref(gpr_slice slice) {
+void grpc_slice_unref(grpc_slice slice) {
if (slice.refcount) {
slice.refcount->unref(slice.refcount);
}
}
-/* gpr_slice_from_static_string support structure - a refcount that does
+/* grpc_slice_from_static_string support structure - a refcount that does
nothing */
static void noop_ref_or_unref(void *unused) {}
-static gpr_slice_refcount noop_refcount = {noop_ref_or_unref,
+static grpc_slice_refcount noop_refcount = {noop_ref_or_unref,
noop_ref_or_unref};
-gpr_slice gpr_slice_from_static_string(const char *s) {
- gpr_slice slice;
+grpc_slice grpc_slice_from_static_string(const char *s) {
+ grpc_slice slice;
slice.refcount = &noop_refcount;
slice.data.refcounted.bytes = (uint8_t *)s;
slice.data.refcounted.length = strlen(s);
return slice;
}
-/* gpr_slice_new support structures - we create a refcount object extended
+/* grpc_slice_new support structures - we create a refcount object extended
with the user provided data pointer & destroy function */
typedef struct new_slice_refcount {
- gpr_slice_refcount rc;
+ grpc_slice_refcount rc;
gpr_refcount refs;
void (*user_destroy)(void *);
void *user_data;
@@ -94,10 +94,10 @@ static void new_slice_unref(void *p) {
}
}
-gpr_slice gpr_slice_new_with_user_data(void *p, size_t len,
+grpc_slice grpc_slice_new_with_user_data(void *p, size_t len,
void (*destroy)(void *),
void *user_data) {
- gpr_slice slice;
+ grpc_slice slice;
new_slice_refcount *rc = gpr_malloc(sizeof(new_slice_refcount));
gpr_ref_init(&rc->refs, 1);
rc->rc.ref = new_slice_ref;
@@ -111,15 +111,15 @@ gpr_slice gpr_slice_new_with_user_data(void *p, size_t len,
return slice;
}
-gpr_slice gpr_slice_new(void *p, size_t len, void (*destroy)(void *)) {
+grpc_slice grpc_slice_new(void *p, size_t len, void (*destroy)(void *)) {
/* Pass "p" to *destroy when the slice is no longer needed. */
- return gpr_slice_new_with_user_data(p, len, destroy, p);
+ return grpc_slice_new_with_user_data(p, len, destroy, p);
}
-/* gpr_slice_new_with_len support structures - we create a refcount object
+/* grpc_slice_new_with_len support structures - we create a refcount object
extended with the user provided data pointer & destroy function */
typedef struct new_with_len_slice_refcount {
- gpr_slice_refcount rc;
+ grpc_slice_refcount rc;
gpr_refcount refs;
void *user_data;
size_t user_length;
@@ -139,9 +139,9 @@ static void new_with_len_unref(void *p) {
}
}
-gpr_slice gpr_slice_new_with_len(void *p, size_t len,
+grpc_slice grpc_slice_new_with_len(void *p, size_t len,
void (*destroy)(void *, size_t)) {
- gpr_slice slice;
+ grpc_slice slice;
new_with_len_slice_refcount *rc =
gpr_malloc(sizeof(new_with_len_slice_refcount));
gpr_ref_init(&rc->refs, 1);
@@ -157,18 +157,18 @@ gpr_slice gpr_slice_new_with_len(void *p, size_t len,
return slice;
}
-gpr_slice gpr_slice_from_copied_buffer(const char *source, size_t length) {
- gpr_slice slice = gpr_slice_malloc(length);
+grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t length) {
+ grpc_slice slice = grpc_slice_malloc(length);
memcpy(GPR_SLICE_START_PTR(slice), source, length);
return slice;
}
-gpr_slice gpr_slice_from_copied_string(const char *source) {
- return gpr_slice_from_copied_buffer(source, strlen(source));
+grpc_slice grpc_slice_from_copied_string(const char *source) {
+ return grpc_slice_from_copied_buffer(source, strlen(source));
}
typedef struct {
- gpr_slice_refcount base;
+ grpc_slice_refcount base;
gpr_refcount refs;
} malloc_refcount;
@@ -184,8 +184,8 @@ static void malloc_unref(void *p) {
}
}
-gpr_slice gpr_slice_malloc(size_t length) {
- gpr_slice slice;
+grpc_slice grpc_slice_malloc(size_t length) {
+ grpc_slice slice;
if (length > sizeof(slice.data.inlined.bytes)) {
/* Memory layout used by the slice created here:
@@ -221,8 +221,8 @@ gpr_slice gpr_slice_malloc(size_t length) {
return slice;
}
-gpr_slice gpr_slice_sub_no_ref(gpr_slice source, size_t begin, size_t end) {
- gpr_slice subset;
+grpc_slice grpc_slice_sub_no_ref(grpc_slice source, size_t begin, size_t end) {
+ grpc_slice subset;
GPR_ASSERT(end >= begin);
@@ -246,8 +246,8 @@ gpr_slice gpr_slice_sub_no_ref(gpr_slice source, size_t begin, size_t end) {
return subset;
}
-gpr_slice gpr_slice_sub(gpr_slice source, size_t begin, size_t end) {
- gpr_slice subset;
+grpc_slice grpc_slice_sub(grpc_slice source, size_t begin, size_t end) {
+ grpc_slice subset;
if (end - begin <= sizeof(subset.data.inlined.bytes)) {
subset.refcount = NULL;
@@ -255,15 +255,15 @@ gpr_slice gpr_slice_sub(gpr_slice source, size_t begin, size_t end) {
memcpy(subset.data.inlined.bytes, GPR_SLICE_START_PTR(source) + begin,
end - begin);
} else {
- subset = gpr_slice_sub_no_ref(source, begin, end);
+ subset = grpc_slice_sub_no_ref(source, begin, end);
/* Bump the refcount */
subset.refcount->ref(subset.refcount);
}
return subset;
}
-gpr_slice gpr_slice_split_tail(gpr_slice *source, size_t split) {
- gpr_slice tail;
+grpc_slice grpc_slice_split_tail(grpc_slice *source, size_t split) {
+ grpc_slice tail;
if (source->refcount == NULL) {
/* inlined data, copy it out */
@@ -297,8 +297,8 @@ gpr_slice gpr_slice_split_tail(gpr_slice *source, size_t split) {
return tail;
}
-gpr_slice gpr_slice_split_head(gpr_slice *source, size_t split) {
- gpr_slice head;
+grpc_slice grpc_slice_split_head(grpc_slice *source, size_t split) {
+ grpc_slice head;
if (source->refcount == NULL) {
GPR_ASSERT(source->data.inlined.length >= split);
@@ -335,14 +335,14 @@ gpr_slice gpr_slice_split_head(gpr_slice *source, size_t split) {
return head;
}
-int gpr_slice_cmp(gpr_slice a, gpr_slice b) {
+int grpc_slice_cmp(grpc_slice a, grpc_slice b) {
int d = (int)(GPR_SLICE_LENGTH(a) - GPR_SLICE_LENGTH(b));
if (d != 0) return d;
return memcmp(GPR_SLICE_START_PTR(a), GPR_SLICE_START_PTR(b),
GPR_SLICE_LENGTH(a));
}
-int gpr_slice_str_cmp(gpr_slice a, const char *b) {
+int grpc_slice_str_cmp(grpc_slice a, const char *b) {
size_t b_length = strlen(b);
int d = (int)(GPR_SLICE_LENGTH(a) - b_length);
if (d != 0) return d;
diff --git a/src/core/lib/support/slice_buffer.c b/src/core/lib/slice/slice_buffer.c
index 66f111d767..c92797233d 100644
--- a/src/core/lib/support/slice_buffer.c
+++ b/src/core/lib/slice/slice_buffer.c
@@ -43,35 +43,35 @@
/* grow a buffer; requires GRPC_SLICE_BUFFER_INLINE_ELEMENTS > 1 */
#define GROW(x) (3 * (x) / 2)
-static void maybe_embiggen(gpr_slice_buffer *sb) {
+static void maybe_embiggen(grpc_slice_buffer *sb) {
if (sb->count == sb->capacity) {
sb->capacity = GROW(sb->capacity);
GPR_ASSERT(sb->capacity > sb->count);
if (sb->slices == sb->inlined) {
- sb->slices = gpr_malloc(sb->capacity * sizeof(gpr_slice));
- memcpy(sb->slices, sb->inlined, sb->count * sizeof(gpr_slice));
+ sb->slices = gpr_malloc(sb->capacity * sizeof(grpc_slice));
+ memcpy(sb->slices, sb->inlined, sb->count * sizeof(grpc_slice));
} else {
- sb->slices = gpr_realloc(sb->slices, sb->capacity * sizeof(gpr_slice));
+ sb->slices = gpr_realloc(sb->slices, sb->capacity * sizeof(grpc_slice));
}
}
}
-void gpr_slice_buffer_init(gpr_slice_buffer *sb) {
+void grpc_slice_buffer_init(grpc_slice_buffer *sb) {
sb->count = 0;
sb->length = 0;
sb->capacity = GRPC_SLICE_BUFFER_INLINE_ELEMENTS;
sb->slices = sb->inlined;
}
-void gpr_slice_buffer_destroy(gpr_slice_buffer *sb) {
- gpr_slice_buffer_reset_and_unref(sb);
+void grpc_slice_buffer_destroy(grpc_slice_buffer *sb) {
+ grpc_slice_buffer_reset_and_unref(sb);
if (sb->slices != sb->inlined) {
gpr_free(sb->slices);
}
}
-uint8_t *gpr_slice_buffer_tiny_add(gpr_slice_buffer *sb, size_t n) {
- gpr_slice *back;
+uint8_t *grpc_slice_buffer_tiny_add(grpc_slice_buffer *sb, size_t n) {
+ grpc_slice *back;
uint8_t *out;
sb->length += n;
@@ -94,7 +94,7 @@ add_new:
return back->data.inlined.bytes;
}
-size_t gpr_slice_buffer_add_indexed(gpr_slice_buffer *sb, gpr_slice s) {
+size_t grpc_slice_buffer_add_indexed(grpc_slice_buffer *sb, grpc_slice s) {
size_t out = sb->count;
maybe_embiggen(sb);
sb->slices[out] = s;
@@ -103,7 +103,7 @@ size_t gpr_slice_buffer_add_indexed(gpr_slice_buffer *sb, gpr_slice s) {
return out;
}
-void gpr_slice_buffer_add(gpr_slice_buffer *sb, gpr_slice s) {
+void grpc_slice_buffer_add(grpc_slice_buffer *sb, grpc_slice s) {
size_t n = sb->count;
/* if both the last slice in the slice buffer and the slice being added
are inlined (that is, that they carry their data inside the slice data
@@ -111,7 +111,7 @@ void gpr_slice_buffer_add(gpr_slice_buffer *sb, gpr_slice s) {
into the back slice, preventing many small slices being passed into
writes */
if (!s.refcount && n) {
- gpr_slice *back = &sb->slices[n - 1];
+ grpc_slice *back = &sb->slices[n - 1];
if (!back->refcount && back->data.inlined.length < GPR_SLICE_INLINED_SIZE) {
if (s.data.inlined.length + back->data.inlined.length <=
GPR_SLICE_INLINED_SIZE) {
@@ -136,35 +136,35 @@ void gpr_slice_buffer_add(gpr_slice_buffer *sb, gpr_slice s) {
return; /* early out */
}
}
- gpr_slice_buffer_add_indexed(sb, s);
+ grpc_slice_buffer_add_indexed(sb, s);
}
-void gpr_slice_buffer_addn(gpr_slice_buffer *sb, gpr_slice *s, size_t n) {
+void grpc_slice_buffer_addn(grpc_slice_buffer *sb, grpc_slice *s, size_t n) {
size_t i;
for (i = 0; i < n; i++) {
- gpr_slice_buffer_add(sb, s[i]);
+ grpc_slice_buffer_add(sb, s[i]);
}
}
-void gpr_slice_buffer_pop(gpr_slice_buffer *sb) {
+void grpc_slice_buffer_pop(grpc_slice_buffer *sb) {
if (sb->count != 0) {
size_t count = --sb->count;
sb->length -= GPR_SLICE_LENGTH(sb->slices[count]);
}
}
-void gpr_slice_buffer_reset_and_unref(gpr_slice_buffer *sb) {
+void grpc_slice_buffer_reset_and_unref(grpc_slice_buffer *sb) {
size_t i;
for (i = 0; i < sb->count; i++) {
- gpr_slice_unref(sb->slices[i]);
+ grpc_slice_unref(sb->slices[i]);
}
sb->count = 0;
sb->length = 0;
}
-void gpr_slice_buffer_swap(gpr_slice_buffer *a, gpr_slice_buffer *b) {
+void grpc_slice_buffer_swap(grpc_slice_buffer *a, grpc_slice_buffer *b) {
GPR_SWAP(size_t, a->count, b->count);
GPR_SWAP(size_t, a->capacity, b->capacity);
GPR_SWAP(size_t, a->length, b->length);
@@ -172,110 +172,110 @@ void gpr_slice_buffer_swap(gpr_slice_buffer *a, gpr_slice_buffer *b) {
if (a->slices == a->inlined) {
if (b->slices == b->inlined) {
/* swap contents of inlined buffer */
- gpr_slice temp[GRPC_SLICE_BUFFER_INLINE_ELEMENTS];
- memcpy(temp, a->slices, b->count * sizeof(gpr_slice));
- memcpy(a->slices, b->slices, a->count * sizeof(gpr_slice));
- memcpy(b->slices, temp, b->count * sizeof(gpr_slice));
+ grpc_slice temp[GRPC_SLICE_BUFFER_INLINE_ELEMENTS];
+ memcpy(temp, a->slices, b->count * sizeof(grpc_slice));
+ memcpy(a->slices, b->slices, a->count * sizeof(grpc_slice));
+ memcpy(b->slices, temp, b->count * sizeof(grpc_slice));
} else {
/* a is inlined, b is not - copy a inlined into b, fix pointers */
a->slices = b->slices;
b->slices = b->inlined;
- memcpy(b->slices, a->inlined, b->count * sizeof(gpr_slice));
+ memcpy(b->slices, a->inlined, b->count * sizeof(grpc_slice));
}
} else if (b->slices == b->inlined) {
/* b is inlined, a is not - copy b inlined int a, fix pointers */
b->slices = a->slices;
a->slices = a->inlined;
- memcpy(a->slices, b->inlined, a->count * sizeof(gpr_slice));
+ memcpy(a->slices, b->inlined, a->count * sizeof(grpc_slice));
} else {
/* no inlining: easy swap */
- GPR_SWAP(gpr_slice *, a->slices, b->slices);
+ GPR_SWAP(grpc_slice *, a->slices, b->slices);
}
}
-void gpr_slice_buffer_move_into(gpr_slice_buffer *src, gpr_slice_buffer *dst) {
+void grpc_slice_buffer_move_into(grpc_slice_buffer *src, grpc_slice_buffer *dst) {
/* anything to move? */
if (src->count == 0) {
return;
}
/* anything in dst? */
if (dst->count == 0) {
- gpr_slice_buffer_swap(src, dst);
+ grpc_slice_buffer_swap(src, dst);
return;
}
/* both buffers have data - copy, and reset src */
- gpr_slice_buffer_addn(dst, src->slices, src->count);
+ grpc_slice_buffer_addn(dst, src->slices, src->count);
src->count = 0;
src->length = 0;
}
-void gpr_slice_buffer_move_first(gpr_slice_buffer *src, size_t n,
- gpr_slice_buffer *dst) {
+void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n,
+ grpc_slice_buffer *dst) {
size_t src_idx;
size_t output_len = dst->length + n;
size_t new_input_len = src->length - n;
GPR_ASSERT(src->length >= n);
if (src->length == n) {
- gpr_slice_buffer_move_into(src, dst);
+ grpc_slice_buffer_move_into(src, dst);
return;
}
src_idx = 0;
while (src_idx < src->capacity) {
- gpr_slice slice = src->slices[src_idx];
+ grpc_slice slice = src->slices[src_idx];
size_t slice_len = GPR_SLICE_LENGTH(slice);
if (n > slice_len) {
- gpr_slice_buffer_add(dst, slice);
+ grpc_slice_buffer_add(dst, slice);
n -= slice_len;
src_idx++;
} else if (n == slice_len) {
- gpr_slice_buffer_add(dst, slice);
+ grpc_slice_buffer_add(dst, slice);
src_idx++;
break;
} else { /* n < slice_len */
- src->slices[src_idx] = gpr_slice_split_tail(&slice, n);
+ src->slices[src_idx] = grpc_slice_split_tail(&slice, n);
GPR_ASSERT(GPR_SLICE_LENGTH(slice) == n);
GPR_ASSERT(GPR_SLICE_LENGTH(src->slices[src_idx]) == slice_len - n);
- gpr_slice_buffer_add(dst, slice);
+ grpc_slice_buffer_add(dst, slice);
break;
}
}
GPR_ASSERT(dst->length == output_len);
memmove(src->slices, src->slices + src_idx,
- sizeof(gpr_slice) * (src->count - src_idx));
+ sizeof(grpc_slice) * (src->count - src_idx));
src->count -= src_idx;
src->length = new_input_len;
GPR_ASSERT(src->count > 0);
}
-void gpr_slice_buffer_trim_end(gpr_slice_buffer *sb, size_t n,
- gpr_slice_buffer *garbage) {
+void grpc_slice_buffer_trim_end(grpc_slice_buffer *sb, size_t n,
+ grpc_slice_buffer *garbage) {
GPR_ASSERT(n <= sb->length);
sb->length -= n;
for (;;) {
size_t idx = sb->count - 1;
- gpr_slice slice = sb->slices[idx];
+ grpc_slice slice = sb->slices[idx];
size_t slice_len = GPR_SLICE_LENGTH(slice);
if (slice_len > n) {
- sb->slices[idx] = gpr_slice_split_head(&slice, slice_len - n);
- gpr_slice_buffer_add_indexed(garbage, slice);
+ sb->slices[idx] = grpc_slice_split_head(&slice, slice_len - n);
+ grpc_slice_buffer_add_indexed(garbage, slice);
return;
} else if (slice_len == n) {
- gpr_slice_buffer_add_indexed(garbage, slice);
+ grpc_slice_buffer_add_indexed(garbage, slice);
sb->count = idx;
return;
} else {
- gpr_slice_buffer_add_indexed(garbage, slice);
+ grpc_slice_buffer_add_indexed(garbage, slice);
n -= slice_len;
sb->count = idx;
}
}
}
-gpr_slice gpr_slice_buffer_take_first(gpr_slice_buffer *sb) {
- gpr_slice slice;
+grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer *sb) {
+ grpc_slice slice;
GPR_ASSERT(sb->count > 0);
slice = sb->slices[0];
- memmove(&sb->slices[0], &sb->slices[1], (sb->count - 1) * sizeof(gpr_slice));
+ memmove(&sb->slices[0], &sb->slices[1], (sb->count - 1) * sizeof(grpc_slice));
sb->count--;
sb->length -= GPR_SLICE_LENGTH(slice);
return slice;
diff --git a/src/core/lib/slice/slice_string_helpers.c b/src/core/lib/slice/slice_string_helpers.c
new file mode 100644
index 0000000000..cc8b80d3b8
--- /dev/null
+++ b/src/core/lib/slice/slice_string_helpers.c
@@ -0,0 +1,81 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+char *gpr_dump_slice(grpc_slice s, uint32_t flags) {
+ return gpr_dump((const char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s),
+ flags);
+}
+
+/** Finds the initial (\a begin) and final (\a end) offsets of the next
+ * substring from \a str + \a read_offset until the next \a sep or the end of \a
+ * str.
+ *
+ * Returns 1 and updates \a begin and \a end. Returns 0 otherwise. */
+static int slice_find_separator_offset(const grpc_slice str, const char *sep,
+ const size_t read_offset, size_t *begin,
+ size_t *end) {
+ size_t i;
+ const uint8_t *str_ptr = GPR_SLICE_START_PTR(str) + read_offset;
+ const size_t str_len = GPR_SLICE_LENGTH(str) - read_offset;
+ const size_t sep_len = strlen(sep);
+ if (str_len < sep_len) {
+ return 0;
+ }
+
+ for (i = 0; i <= str_len - sep_len; i++) {
+ if (memcmp(str_ptr + i, sep, sep_len) == 0) {
+ *begin = read_offset;
+ *end = read_offset + i;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+void grpc_slice_split(grpc_slice str, const char *sep, grpc_slice_buffer *dst) {
+ const size_t sep_len = strlen(sep);
+ size_t begin, end;
+
+ GPR_ASSERT(sep_len > 0);
+
+ if (slice_find_separator_offset(str, sep, 0, &begin, &end) != 0) {
+ do {
+ grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
+ } while (slice_find_separator_offset(str, sep, end + sep_len, &begin,
+ &end) != 0);
+ grpc_slice_buffer_add_indexed(
+ dst, grpc_slice_sub(str, end + sep_len, GPR_SLICE_LENGTH(str)));
+ } else { /* no sep found, add whole input */
+ grpc_slice_buffer_add_indexed(dst, grpc_slice_ref(str));
+ }
+}
diff --git a/src/core/lib/slice/slice_string_helpers.h b/src/core/lib/slice/slice_string_helpers.h
new file mode 100644
index 0000000000..d144a70889
--- /dev/null
+++ b/src/core/lib/slice/slice_string_helpers.h
@@ -0,0 +1,58 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_SUPPORT_SLICE_STRING_H
+#define GRPC_CORE_LIB_SUPPORT_SLICE_STRING_H
+
+#include <stddef.h>
+
+#include <grpc/support/port_platform.h>
+#include <grpc/support/slice.h>
+#include <grpc/support/slice_buffer.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Calls gpr_dump on a slice. */
+char *gpr_dump_slice(grpc_slice slice, uint32_t flags);
+
+/** Split \a str by the separator \a sep. Results are stored in \a dst, which
+ * should be a properly initialized instance. */
+void grpc_slice_split(grpc_slice str, const char *sep, grpc_slice_buffer *dst);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SUPPORT_STRING_H */
diff --git a/src/core/lib/support/string.c b/src/core/lib/support/string.c
index d17fb9da4b..dc243bf0bf 100644
--- a/src/core/lib/support/string.c
+++ b/src/core/lib/support/string.c
@@ -120,11 +120,6 @@ char *gpr_dump(const char *buf, size_t len, uint32_t flags) {
return out.data;
}
-char *gpr_dump_slice(gpr_slice s, uint32_t flags) {
- return gpr_dump((const char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s),
- flags);
-}
-
int gpr_parse_bytes_to_uint32(const char *buf, size_t len, uint32_t *result) {
uint32_t out = 0;
uint32_t new;
@@ -239,50 +234,6 @@ char *gpr_strjoin_sep(const char **strs, size_t nstrs, const char *sep,
return out;
}
-/** Finds the initial (\a begin) and final (\a end) offsets of the next
- * substring from \a str + \a read_offset until the next \a sep or the end of \a
- * str.
- *
- * Returns 1 and updates \a begin and \a end. Returns 0 otherwise. */
-static int slice_find_separator_offset(const gpr_slice str, const char *sep,
- const size_t read_offset, size_t *begin,
- size_t *end) {
- size_t i;
- const uint8_t *str_ptr = GPR_SLICE_START_PTR(str) + read_offset;
- const size_t str_len = GPR_SLICE_LENGTH(str) - read_offset;
- const size_t sep_len = strlen(sep);
- if (str_len < sep_len) {
- return 0;
- }
-
- for (i = 0; i <= str_len - sep_len; i++) {
- if (memcmp(str_ptr + i, sep, sep_len) == 0) {
- *begin = read_offset;
- *end = read_offset + i;
- return 1;
- }
- }
- return 0;
-}
-
-void gpr_slice_split(gpr_slice str, const char *sep, gpr_slice_buffer *dst) {
- const size_t sep_len = strlen(sep);
- size_t begin, end;
-
- GPR_ASSERT(sep_len > 0);
-
- if (slice_find_separator_offset(str, sep, 0, &begin, &end) != 0) {
- do {
- gpr_slice_buffer_add_indexed(dst, gpr_slice_sub(str, begin, end));
- } while (slice_find_separator_offset(str, sep, end + sep_len, &begin,
- &end) != 0);
- gpr_slice_buffer_add_indexed(
- dst, gpr_slice_sub(str, end + sep_len, GPR_SLICE_LENGTH(str)));
- } else { /* no sep found, add whole input */
- gpr_slice_buffer_add_indexed(dst, gpr_slice_ref(str));
- }
-}
-
void gpr_strvec_init(gpr_strvec *sv) { memset(sv, 0, sizeof(*sv)); }
void gpr_strvec_destroy(gpr_strvec *sv) {
diff --git a/src/core/lib/support/string.h b/src/core/lib/support/string.h
index 9a94e9471c..2cd908aad6 100644
--- a/src/core/lib/support/string.h
+++ b/src/core/lib/support/string.h
@@ -54,9 +54,6 @@ extern "C" {
Result should be freed with gpr_free() */
char *gpr_dump(const char *buf, size_t len, uint32_t flags);
-/* Calls gpr_dump on a slice. */
-char *gpr_dump_slice(gpr_slice slice, uint32_t flags);
-
/* Parses an array of bytes into an integer (base 10). Returns 1 on success,
0 on failure. */
int gpr_parse_bytes_to_uint32(const char *data, size_t length,
@@ -98,10 +95,6 @@ char *gpr_strjoin(const char **strs, size_t nstrs, size_t *total_length);
char *gpr_strjoin_sep(const char **strs, size_t nstrs, const char *sep,
size_t *total_length);
-/** Split \a str by the separator \a sep. Results are stored in \a dst, which
- * should be a properly initialized instance. */
-void gpr_slice_split(gpr_slice str, const char *sep, gpr_slice_buffer *dst);
-
/* A vector of strings... for building up a final string one piece at a time */
typedef struct {
char **strs;
diff --git a/src/core/lib/surface/byte_buffer.c b/src/core/lib/surface/byte_buffer.c
index 054a6e6c58..5ae7e3264b 100644
--- a/src/core/lib/surface/byte_buffer.c
+++ b/src/core/lib/surface/byte_buffer.c
@@ -35,22 +35,22 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-grpc_byte_buffer *grpc_raw_byte_buffer_create(gpr_slice *slices,
+grpc_byte_buffer *grpc_raw_byte_buffer_create(grpc_slice *slices,
size_t nslices) {
return grpc_raw_compressed_byte_buffer_create(slices, nslices,
GRPC_COMPRESS_NONE);
}
grpc_byte_buffer *grpc_raw_compressed_byte_buffer_create(
- gpr_slice *slices, size_t nslices, grpc_compression_algorithm compression) {
+ grpc_slice *slices, size_t nslices, grpc_compression_algorithm compression) {
size_t i;
grpc_byte_buffer *bb = gpr_malloc(sizeof(grpc_byte_buffer));
bb->type = GRPC_BB_RAW;
bb->data.raw.compression = compression;
- gpr_slice_buffer_init(&bb->data.raw.slice_buffer);
+ grpc_slice_buffer_init(&bb->data.raw.slice_buffer);
for (i = 0; i < nslices; i++) {
- gpr_slice_ref(slices[i]);
- gpr_slice_buffer_add(&bb->data.raw.slice_buffer, slices[i]);
+ grpc_slice_ref(slices[i]);
+ grpc_slice_buffer_add(&bb->data.raw.slice_buffer, slices[i]);
}
return bb;
}
@@ -58,13 +58,13 @@ grpc_byte_buffer *grpc_raw_compressed_byte_buffer_create(
grpc_byte_buffer *grpc_raw_byte_buffer_from_reader(
grpc_byte_buffer_reader *reader) {
grpc_byte_buffer *bb = gpr_malloc(sizeof(grpc_byte_buffer));
- gpr_slice slice;
+ grpc_slice slice;
bb->type = GRPC_BB_RAW;
bb->data.raw.compression = GRPC_COMPRESS_NONE;
- gpr_slice_buffer_init(&bb->data.raw.slice_buffer);
+ grpc_slice_buffer_init(&bb->data.raw.slice_buffer);
while (grpc_byte_buffer_reader_next(reader, &slice)) {
- gpr_slice_buffer_add(&bb->data.raw.slice_buffer, slice);
+ grpc_slice_buffer_add(&bb->data.raw.slice_buffer, slice);
}
return bb;
}
@@ -83,7 +83,7 @@ void grpc_byte_buffer_destroy(grpc_byte_buffer *bb) {
if (!bb) return;
switch (bb->type) {
case GRPC_BB_RAW:
- gpr_slice_buffer_destroy(&bb->data.raw.slice_buffer);
+ grpc_slice_buffer_destroy(&bb->data.raw.slice_buffer);
break;
}
gpr_free(bb);
diff --git a/src/core/lib/surface/byte_buffer_reader.c b/src/core/lib/surface/byte_buffer_reader.c
index 310bacb2c9..9455709b4b 100644
--- a/src/core/lib/surface/byte_buffer_reader.c
+++ b/src/core/lib/surface/byte_buffer_reader.c
@@ -56,11 +56,11 @@ static int is_compressed(grpc_byte_buffer *buffer) {
int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
grpc_byte_buffer *buffer) {
- gpr_slice_buffer decompressed_slices_buffer;
+ grpc_slice_buffer decompressed_slices_buffer;
reader->buffer_in = buffer;
switch (reader->buffer_in->type) {
case GRPC_BB_RAW:
- gpr_slice_buffer_init(&decompressed_slices_buffer);
+ grpc_slice_buffer_init(&decompressed_slices_buffer);
if (is_compressed(reader->buffer_in)) {
if (grpc_msg_decompress(reader->buffer_in->data.raw.compression,
&reader->buffer_in->data.raw.slice_buffer,
@@ -76,7 +76,7 @@ int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
grpc_raw_byte_buffer_create(decompressed_slices_buffer.slices,
decompressed_slices_buffer.count);
}
- gpr_slice_buffer_destroy(&decompressed_slices_buffer);
+ grpc_slice_buffer_destroy(&decompressed_slices_buffer);
} else { /* not compressed, use the input buffer as output */
reader->buffer_out = reader->buffer_in;
}
@@ -98,13 +98,13 @@ void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader) {
}
int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
- gpr_slice *slice) {
+ grpc_slice *slice) {
switch (reader->buffer_in->type) {
case GRPC_BB_RAW: {
- gpr_slice_buffer *slice_buffer;
+ grpc_slice_buffer *slice_buffer;
slice_buffer = &reader->buffer_out->data.raw.slice_buffer;
if (reader->current.index < slice_buffer->count) {
- *slice = gpr_slice_ref(slice_buffer->slices[reader->current.index]);
+ *slice = grpc_slice_ref(slice_buffer->slices[reader->current.index]);
reader->current.index += 1;
return 1;
}
@@ -114,18 +114,18 @@ int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
return 0;
}
-gpr_slice grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader *reader) {
- gpr_slice in_slice;
+grpc_slice grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader *reader) {
+ grpc_slice in_slice;
size_t bytes_read = 0;
const size_t input_size = grpc_byte_buffer_length(reader->buffer_out);
- gpr_slice out_slice = gpr_slice_malloc(input_size);
+ grpc_slice out_slice = grpc_slice_malloc(input_size);
uint8_t *const outbuf = GPR_SLICE_START_PTR(out_slice); /* just an alias */
while (grpc_byte_buffer_reader_next(reader, &in_slice) != 0) {
const size_t slice_length = GPR_SLICE_LENGTH(in_slice);
memcpy(&(outbuf[bytes_read]), GPR_SLICE_START_PTR(in_slice), slice_length);
bytes_read += slice_length;
- gpr_slice_unref(in_slice);
+ grpc_slice_unref(in_slice);
GPR_ASSERT(bytes_read <= input_size);
}
return out_slice;
diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c
index ee94f274f8..06dc5f5942 100644
--- a/src/core/lib/surface/call.c
+++ b/src/core/lib/surface/call.c
@@ -183,7 +183,7 @@ struct grpc_call {
grpc_slice_buffer_stream sending_stream;
grpc_byte_stream *receiving_stream;
grpc_byte_buffer **receiving_buffer;
- gpr_slice receiving_slice;
+ grpc_slice receiving_slice;
grpc_closure receiving_slice_ready;
grpc_closure receiving_stream_ready;
grpc_closure receiving_initial_metadata_ready;
@@ -492,8 +492,8 @@ static void destroy_encodings_accepted_by_peer(void *p) { return; }
static void set_encodings_accepted_by_peer(grpc_call *call, grpc_mdelem *mdel) {
size_t i;
grpc_compression_algorithm algorithm;
- gpr_slice_buffer accept_encoding_parts;
- gpr_slice accept_encoding_slice;
+ grpc_slice_buffer accept_encoding_parts;
+ grpc_slice accept_encoding_slice;
void *accepted_user_data;
accepted_user_data =
@@ -505,15 +505,15 @@ static void set_encodings_accepted_by_peer(grpc_call *call, grpc_mdelem *mdel) {
}
accept_encoding_slice = mdel->value->slice;
- gpr_slice_buffer_init(&accept_encoding_parts);
- gpr_slice_split(accept_encoding_slice, ",", &accept_encoding_parts);
+ grpc_slice_buffer_init(&accept_encoding_parts);
+ grpc_slice_split(accept_encoding_slice, ",", &accept_encoding_parts);
/* No need to zero call->encodings_accepted_by_peer: grpc_call_create already
* zeroes the whole grpc_call */
/* Always support no compression */
GPR_BITSET(&call->encodings_accepted_by_peer, GRPC_COMPRESS_NONE);
for (i = 0; i < accept_encoding_parts.count; i++) {
- const gpr_slice *accept_encoding_entry_slice =
+ const grpc_slice *accept_encoding_entry_slice =
&accept_encoding_parts.slices[i];
if (grpc_compression_algorithm_parse(
(const char *)GPR_SLICE_START_PTR(*accept_encoding_entry_slice),
@@ -529,7 +529,7 @@ static void set_encodings_accepted_by_peer(grpc_call *call, grpc_mdelem *mdel) {
}
}
- gpr_slice_buffer_destroy(&accept_encoding_parts);
+ grpc_slice_buffer_destroy(&accept_encoding_parts);
grpc_mdelem_set_user_data(
mdel, destroy_encodings_accepted_by_peer,
@@ -550,7 +550,7 @@ static void get_final_details(grpc_call *call, char **out_details,
for (i = 0; i < STATUS_SOURCE_COUNT; i++) {
if (call->status[i].is_set) {
if (call->status[i].details) {
- gpr_slice details = call->status[i].details->slice;
+ grpc_slice details = call->status[i].details->slice;
size_t len = GPR_SLICE_LENGTH(details);
if (len + 1 > *out_details_capacity) {
*out_details_capacity =
@@ -1084,7 +1084,7 @@ static void continue_receiving_slices(grpc_exec_ctx *exec_ctx,
if (grpc_byte_stream_next(exec_ctx, call->receiving_stream,
&call->receiving_slice, remaining,
&call->receiving_slice_ready)) {
- gpr_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
+ grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
call->receiving_slice);
} else {
return;
@@ -1098,7 +1098,7 @@ static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
grpc_call *call = bctl->call;
if (error == GRPC_ERROR_NONE) {
- gpr_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
+ grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
call->receiving_slice);
continue_receiving_slices(exec_ctx, bctl);
} else {
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c
index be16162e7f..2045e59e53 100644
--- a/src/core/lib/surface/server.c
+++ b/src/core/lib/surface/server.c
@@ -264,13 +264,13 @@ static void channel_broadcaster_init(grpc_server *s, channel_broadcaster *cb) {
struct shutdown_cleanup_args {
grpc_closure closure;
- gpr_slice slice;
+ grpc_slice slice;
};
static void shutdown_cleanup(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
struct shutdown_cleanup_args *a = arg;
- gpr_slice_unref(a->slice);
+ grpc_slice_unref(a->slice);
gpr_free(a);
}
@@ -283,7 +283,7 @@ static void send_shutdown(grpc_exec_ctx *exec_ctx, grpc_channel *channel,
op->send_goaway = send_goaway;
op->set_accept_stream = true;
- sc->slice = gpr_slice_from_copied_string("Server shutdown");
+ sc->slice = grpc_slice_from_copied_string("Server shutdown");
op->goaway_message = &sc->slice;
op->goaway_status = GRPC_STATUS_OK;
op->disconnect_with_error = send_disconnect;
@@ -459,7 +459,7 @@ static void destroy_channel(grpc_exec_ctx *exec_ctx, channel_data *chand,
}
static void cpstr(char **dest, size_t *capacity, grpc_mdstr *value) {
- gpr_slice slice = value->slice;
+ grpc_slice slice = value->slice;
size_t len = GPR_SLICE_LENGTH(slice);
if (len + 1 > *capacity) {
diff --git a/src/core/lib/transport/byte_stream.c b/src/core/lib/transport/byte_stream.c
index 2f6c75cb6a..2f1d7b7c60 100644
--- a/src/core/lib/transport/byte_stream.c
+++ b/src/core/lib/transport/byte_stream.c
@@ -38,7 +38,7 @@
#include <grpc/support/log.h>
int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx,
- grpc_byte_stream *byte_stream, gpr_slice *slice,
+ grpc_byte_stream *byte_stream, grpc_slice *slice,
size_t max_size_hint, grpc_closure *on_complete) {
return byte_stream->next(exec_ctx, byte_stream, slice, max_size_hint,
on_complete);
@@ -53,11 +53,11 @@ void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx,
static int slice_buffer_stream_next(grpc_exec_ctx *exec_ctx,
grpc_byte_stream *byte_stream,
- gpr_slice *slice, size_t max_size_hint,
+ grpc_slice *slice, size_t max_size_hint,
grpc_closure *on_complete) {
grpc_slice_buffer_stream *stream = (grpc_slice_buffer_stream *)byte_stream;
GPR_ASSERT(stream->cursor < stream->backing_buffer->count);
- *slice = gpr_slice_ref(stream->backing_buffer->slices[stream->cursor]);
+ *slice = grpc_slice_ref(stream->backing_buffer->slices[stream->cursor]);
stream->cursor++;
return 1;
}
@@ -66,7 +66,7 @@ static void slice_buffer_stream_destroy(grpc_exec_ctx *exec_ctx,
grpc_byte_stream *byte_stream) {}
void grpc_slice_buffer_stream_init(grpc_slice_buffer_stream *stream,
- gpr_slice_buffer *slice_buffer,
+ grpc_slice_buffer *slice_buffer,
uint32_t flags) {
GPR_ASSERT(slice_buffer->length <= UINT32_MAX);
stream->base.length = (uint32_t)slice_buffer->length;
diff --git a/src/core/lib/transport/byte_stream.h b/src/core/lib/transport/byte_stream.h
index e64dce6283..8139782701 100644
--- a/src/core/lib/transport/byte_stream.h
+++ b/src/core/lib/transport/byte_stream.h
@@ -50,7 +50,7 @@ struct grpc_byte_stream {
uint32_t length;
uint32_t flags;
int (*next)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream,
- gpr_slice *slice, size_t max_size_hint,
+ grpc_slice *slice, size_t max_size_hint,
grpc_closure *on_complete);
void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream);
};
@@ -65,7 +65,7 @@ struct grpc_byte_stream {
* once a slice is returned into *slice, it is owned by the caller.
*/
int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx,
- grpc_byte_stream *byte_stream, gpr_slice *slice,
+ grpc_byte_stream *byte_stream, grpc_slice *slice,
size_t max_size_hint, grpc_closure *on_complete);
void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx,
@@ -74,12 +74,12 @@ void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx,
/* grpc_byte_stream that wraps a slice buffer */
typedef struct grpc_slice_buffer_stream {
grpc_byte_stream base;
- gpr_slice_buffer *backing_buffer;
+ grpc_slice_buffer *backing_buffer;
size_t cursor;
} grpc_slice_buffer_stream;
void grpc_slice_buffer_stream_init(grpc_slice_buffer_stream *stream,
- gpr_slice_buffer *slice_buffer,
+ grpc_slice_buffer *slice_buffer,
uint32_t flags);
#endif /* GRPC_CORE_LIB_TRANSPORT_BYTE_STREAM_H */
diff --git a/src/core/lib/transport/metadata.c b/src/core/lib/transport/metadata.c
index 4b40c275ad..b8364c4cb7 100644
--- a/src/core/lib/transport/metadata.c
+++ b/src/core/lib/transport/metadata.c
@@ -51,7 +51,7 @@
#include "src/core/lib/support/string.h"
#include "src/core/lib/transport/static_metadata.h"
-gpr_slice (*grpc_chttp2_base64_encode_and_huffman_compress)(gpr_slice input);
+grpc_slice (*grpc_chttp2_base64_encode_and_huffman_compress)(grpc_slice input);
/* There are two kinds of mdelem and mdstr instances.
* Static instances are declared in static_metadata.{h,c} and
@@ -85,16 +85,16 @@ typedef void (*destroy_user_data_func)(void *user_data);
/* Shadow structure for grpc_mdstr for non-static values */
typedef struct internal_string {
/* must be byte compatible with grpc_mdstr */
- gpr_slice slice;
+ grpc_slice slice;
uint32_t hash;
/* private only data */
gpr_atm refcnt;
uint8_t has_base64_and_huffman_encoded;
- gpr_slice_refcount refcount;
+ grpc_slice_refcount refcount;
- gpr_slice base64_and_huffman;
+ grpc_slice base64_and_huffman;
gpr_atm size_in_decoder_table;
@@ -174,7 +174,7 @@ void grpc_mdctx_global_init(void) {
grpc_mdstr *elem = &grpc_static_mdstr_table[i];
const char *str = grpc_static_metadata_strings[i];
uint32_t hash = gpr_murmur_hash3(str, strlen(str), g_hash_seed);
- *(gpr_slice *)&elem->slice = gpr_slice_from_static_string(str);
+ *(grpc_slice *)&elem->slice = grpc_slice_from_static_string(str);
*(uint32_t *)&elem->hash = hash;
for (j = 0;; j++) {
size_t idx = (hash + j) % GPR_ARRAY_SIZE(g_static_strtab);
@@ -321,7 +321,7 @@ static void internal_destroy_string(strtab_shard *shard, internal_string *is) {
internal_string *cur;
GPR_TIMER_BEGIN("internal_destroy_string", 0);
if (is->has_base64_and_huffman_encoded) {
- gpr_slice_unref(is->base64_and_huffman);
+ grpc_slice_unref(is->base64_and_huffman);
}
for (prev_next = &shard->strs[TABLE_IDX(is->hash, LOG2_STRTAB_SHARD_COUNT,
shard->capacity)],
@@ -350,10 +350,10 @@ grpc_mdstr *grpc_mdstr_from_string(const char *str) {
return grpc_mdstr_from_buffer((const uint8_t *)str, strlen(str));
}
-grpc_mdstr *grpc_mdstr_from_slice(gpr_slice slice) {
+grpc_mdstr *grpc_mdstr_from_slice(grpc_slice slice) {
grpc_mdstr *result = grpc_mdstr_from_buffer(GPR_SLICE_START_PTR(slice),
GPR_SLICE_LENGTH(slice));
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return result;
}
@@ -589,7 +589,7 @@ grpc_mdelem *grpc_mdelem_from_strings(const char *key, const char *value) {
grpc_mdstr_from_string(value));
}
-grpc_mdelem *grpc_mdelem_from_slices(gpr_slice key, gpr_slice value) {
+grpc_mdelem *grpc_mdelem_from_slices(grpc_slice key, grpc_slice value) {
return grpc_mdelem_from_metadata_strings(grpc_mdstr_from_slice(key),
grpc_mdstr_from_slice(value));
}
@@ -737,9 +737,9 @@ void grpc_mdelem_set_user_data(grpc_mdelem *md, void (*destroy_func)(void *),
gpr_mu_unlock(&im->mu_user_data);
}
-gpr_slice grpc_mdstr_as_base64_encoded_and_huffman_compressed(grpc_mdstr *gs) {
+grpc_slice grpc_mdstr_as_base64_encoded_and_huffman_compressed(grpc_mdstr *gs) {
internal_string *s = (internal_string *)gs;
- gpr_slice slice;
+ grpc_slice slice;
strtab_shard *shard =
&g_strtab_shard[SHARD_IDX(s->hash, LOG2_STRTAB_SHARD_COUNT)];
gpr_mu_lock(&shard->mu);
diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h
index 71eff0acf2..5875ffb323 100644
--- a/src/core/lib/transport/metadata.h
+++ b/src/core/lib/transport/metadata.h
@@ -77,7 +77,7 @@ typedef struct grpc_mdelem grpc_mdelem;
/* if changing this, make identical changes in internal_string in metadata.c */
struct grpc_mdstr {
- const gpr_slice slice;
+ const grpc_slice slice;
const uint32_t hash;
/* there is a private part to this in metadata.c */
};
@@ -96,12 +96,12 @@ void grpc_test_only_set_metadata_hash_seed(uint32_t seed);
clients may have handy */
grpc_mdstr *grpc_mdstr_from_string(const char *str);
/* Unrefs the slice. */
-grpc_mdstr *grpc_mdstr_from_slice(gpr_slice slice);
+grpc_mdstr *grpc_mdstr_from_slice(grpc_slice slice);
grpc_mdstr *grpc_mdstr_from_buffer(const uint8_t *str, size_t length);
/* Returns a borrowed slice from the mdstr with its contents base64 encoded
and huffman compressed */
-gpr_slice grpc_mdstr_as_base64_encoded_and_huffman_compressed(grpc_mdstr *str);
+grpc_slice grpc_mdstr_as_base64_encoded_and_huffman_compressed(grpc_mdstr *str);
/* Constructors for grpc_mdelem instances; take a variety of data types that
clients may have handy */
@@ -109,7 +109,7 @@ grpc_mdelem *grpc_mdelem_from_metadata_strings(grpc_mdstr *key,
grpc_mdstr *value);
grpc_mdelem *grpc_mdelem_from_strings(const char *key, const char *value);
/* Unrefs the slices. */
-grpc_mdelem *grpc_mdelem_from_slices(gpr_slice key, gpr_slice value);
+grpc_mdelem *grpc_mdelem_from_slices(grpc_slice key, grpc_slice value);
grpc_mdelem *grpc_mdelem_from_string_and_buffer(const char *key,
const uint8_t *value,
size_t value_length);
@@ -165,8 +165,8 @@ void grpc_mdctx_global_init(void);
void grpc_mdctx_global_shutdown(void);
/* Implementation provided by chttp2_transport */
-extern gpr_slice (*grpc_chttp2_base64_encode_and_huffman_compress)(
- gpr_slice input);
+extern grpc_slice (*grpc_chttp2_base64_encode_and_huffman_compress)(
+ grpc_slice input);
#ifdef __cplusplus
}
diff --git a/src/core/lib/transport/transport.c b/src/core/lib/transport/transport.c
index 75aec7a5b4..3ca85b12e9 100644
--- a/src/core/lib/transport/transport.c
+++ b/src/core/lib/transport/transport.c
@@ -207,11 +207,11 @@ void grpc_transport_stream_op_add_cancellation(grpc_transport_stream_op *op,
void grpc_transport_stream_op_add_cancellation_with_message(
grpc_transport_stream_op *op, grpc_status_code status,
- gpr_slice *optional_message) {
+ grpc_slice *optional_message) {
GPR_ASSERT(status != GRPC_STATUS_OK);
if (op->cancel_error != GRPC_ERROR_NONE) {
if (optional_message) {
- gpr_slice_unref(*optional_message);
+ grpc_slice_unref(*optional_message);
}
return;
}
@@ -221,7 +221,7 @@ void grpc_transport_stream_op_add_cancellation_with_message(
error = grpc_error_set_str(GRPC_ERROR_CREATE(msg),
GRPC_ERROR_STR_GRPC_MESSAGE, msg);
gpr_free(msg);
- gpr_slice_unref(*optional_message);
+ grpc_slice_unref(*optional_message);
} else {
error = GRPC_ERROR_CREATE("Call cancelled");
}
@@ -231,12 +231,12 @@ void grpc_transport_stream_op_add_cancellation_with_message(
void grpc_transport_stream_op_add_close(grpc_transport_stream_op *op,
grpc_status_code status,
- gpr_slice *optional_message) {
+ grpc_slice *optional_message) {
GPR_ASSERT(status != GRPC_STATUS_OK);
if (op->cancel_error != GRPC_ERROR_NONE ||
op->close_error != GRPC_ERROR_NONE) {
if (optional_message) {
- gpr_slice_unref(*optional_message);
+ grpc_slice_unref(*optional_message);
}
return;
}
@@ -246,7 +246,7 @@ void grpc_transport_stream_op_add_close(grpc_transport_stream_op *op,
error = grpc_error_set_str(GRPC_ERROR_CREATE(msg),
GRPC_ERROR_STR_GRPC_MESSAGE, msg);
gpr_free(msg);
- gpr_slice_unref(*optional_message);
+ grpc_slice_unref(*optional_message);
} else {
error = GRPC_ERROR_CREATE("Call force closed");
}
diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h
index 50253ebad1..8916b28b72 100644
--- a/src/core/lib/transport/transport.h
+++ b/src/core/lib/transport/transport.h
@@ -181,7 +181,7 @@ typedef struct grpc_transport_op {
bool send_goaway;
/** what should the goaway contain? */
grpc_status_code goaway_status;
- gpr_slice *goaway_message;
+ grpc_slice *goaway_message;
/** set the callback for accepting new streams;
this is a permanent callback, unlike the other one-shot closures.
If true, the callback is set to set_accept_stream_fn, with its
@@ -249,11 +249,11 @@ void grpc_transport_stream_op_add_cancellation(grpc_transport_stream_op *op,
void grpc_transport_stream_op_add_cancellation_with_message(
grpc_transport_stream_op *op, grpc_status_code status,
- gpr_slice *optional_message);
+ grpc_slice *optional_message);
void grpc_transport_stream_op_add_close(grpc_transport_stream_op *op,
grpc_status_code status,
- gpr_slice *optional_message);
+ grpc_slice *optional_message);
char *grpc_transport_stream_op_string(grpc_transport_stream_op *op);
char *grpc_transport_op_string(grpc_transport_op *op);
@@ -283,7 +283,7 @@ void grpc_transport_ping(grpc_transport *transport, grpc_closure *cb);
/* Advise peer of pending connection termination. */
void grpc_transport_goaway(grpc_transport *transport, grpc_status_code status,
- gpr_slice debug_data);
+ grpc_slice debug_data);
/* Close a transport. Aborts all open streams. */
void grpc_transport_close(grpc_transport *transport);
diff --git a/src/cpp/common/core_codegen.cc b/src/cpp/common/core_codegen.cc
index ce02202976..ad874bb369 100644
--- a/src/cpp/common/core_codegen.cc
+++ b/src/cpp/common/core_codegen.cc
@@ -102,31 +102,31 @@ void CoreCodegen::grpc_byte_buffer_reader_destroy(
}
int CoreCodegen::grpc_byte_buffer_reader_next(grpc_byte_buffer_reader* reader,
- gpr_slice* slice) {
+ grpc_slice* slice) {
return ::grpc_byte_buffer_reader_next(reader, slice);
}
-grpc_byte_buffer* CoreCodegen::grpc_raw_byte_buffer_create(gpr_slice* slice,
+grpc_byte_buffer* CoreCodegen::grpc_raw_byte_buffer_create(grpc_slice* slice,
size_t nslices) {
return ::grpc_raw_byte_buffer_create(slice, nslices);
}
-gpr_slice CoreCodegen::gpr_slice_malloc(size_t length) {
- return ::gpr_slice_malloc(length);
+grpc_slice CoreCodegen::grpc_slice_malloc(size_t length) {
+ return ::grpc_slice_malloc(length);
}
-void CoreCodegen::gpr_slice_unref(gpr_slice slice) { ::gpr_slice_unref(slice); }
+void CoreCodegen::grpc_slice_unref(grpc_slice slice) { ::grpc_slice_unref(slice); }
-gpr_slice CoreCodegen::gpr_slice_split_tail(gpr_slice* s, size_t split) {
- return ::gpr_slice_split_tail(s, split);
+grpc_slice CoreCodegen::grpc_slice_split_tail(grpc_slice* s, size_t split) {
+ return ::grpc_slice_split_tail(s, split);
}
-void CoreCodegen::gpr_slice_buffer_add(gpr_slice_buffer* sb, gpr_slice slice) {
- ::gpr_slice_buffer_add(sb, slice);
+void CoreCodegen::grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice slice) {
+ ::grpc_slice_buffer_add(sb, slice);
}
-void CoreCodegen::gpr_slice_buffer_pop(gpr_slice_buffer* sb) {
- ::gpr_slice_buffer_pop(sb);
+void CoreCodegen::grpc_slice_buffer_pop(grpc_slice_buffer* sb) {
+ ::grpc_slice_buffer_pop(sb);
}
void CoreCodegen::grpc_metadata_array_init(grpc_metadata_array* array) {
diff --git a/src/cpp/util/byte_buffer_cc.cc b/src/cpp/util/byte_buffer_cc.cc
index 91ed66b766..cbe0aad26c 100644
--- a/src/cpp/util/byte_buffer_cc.cc
+++ b/src/cpp/util/byte_buffer_cc.cc
@@ -38,18 +38,18 @@ namespace grpc {
ByteBuffer::ByteBuffer(const Slice* slices, size_t nslices) {
// The following assertions check that the representation of a grpc::Slice is
- // identical to that of a gpr_slice: it has a gpr_slice field, and nothing
+ // identical to that of a grpc_slice: it has a grpc_slice field, and nothing
// else.
- static_assert(std::is_same<decltype(slices[0].slice_), gpr_slice>::value,
- "Slice must have same representation as gpr_slice");
- static_assert(sizeof(Slice) == sizeof(gpr_slice),
- "Slice must have same representation as gpr_slice");
+ static_assert(std::is_same<decltype(slices[0].slice_), grpc_slice>::value,
+ "Slice must have same representation as grpc_slice");
+ static_assert(sizeof(Slice) == sizeof(grpc_slice),
+ "Slice must have same representation as grpc_slice");
// The const_cast is legal if grpc_raw_byte_buffer_create() does no more
// than its advertised side effect of increasing the reference count of the
// slices it processes, and such an increase does not affect the semantics
// seen by the caller of this constructor.
buffer_ = grpc_raw_byte_buffer_create(
- reinterpret_cast<gpr_slice*>(const_cast<Slice*>(slices)), nslices);
+ reinterpret_cast<grpc_slice*>(const_cast<Slice*>(slices)), nslices);
}
ByteBuffer::~ByteBuffer() {
@@ -75,7 +75,7 @@ Status ByteBuffer::Dump(std::vector<Slice>* slices) const {
return Status(StatusCode::INTERNAL,
"Couldn't initialize byte buffer reader");
}
- gpr_slice s;
+ grpc_slice s;
while (grpc_byte_buffer_reader_next(&reader, &s)) {
slices->push_back(Slice(s, Slice::STEAL_REF));
}
diff --git a/src/cpp/util/slice_cc.cc b/src/cpp/util/slice_cc.cc
index 7e88423b6c..c05f1cf124 100644
--- a/src/cpp/util/slice_cc.cc
+++ b/src/cpp/util/slice_cc.cc
@@ -37,12 +37,12 @@ namespace grpc {
Slice::Slice() : slice_(gpr_empty_slice()) {}
-Slice::~Slice() { gpr_slice_unref(slice_); }
+Slice::~Slice() { grpc_slice_unref(slice_); }
-Slice::Slice(gpr_slice slice, AddRef) : slice_(gpr_slice_ref(slice)) {}
+Slice::Slice(grpc_slice slice, AddRef) : slice_(grpc_slice_ref(slice)) {}
-Slice::Slice(gpr_slice slice, StealRef) : slice_(slice) {}
+Slice::Slice(grpc_slice slice, StealRef) : slice_(slice) {}
-Slice::Slice(const Slice& other) : slice_(gpr_slice_ref(other.slice_)) {}
+Slice::Slice(const Slice& other) : slice_(grpc_slice_ref(other.slice_)) {}
} // namespace grpc
diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c
index 9a5d7869d3..0f725f5e23 100644
--- a/src/csharp/ext/grpc_csharp_ext.c
+++ b/src/csharp/ext/grpc_csharp_ext.c
@@ -59,9 +59,9 @@
#endif
grpc_byte_buffer *string_to_byte_buffer(const char *buffer, size_t len) {
- gpr_slice slice = gpr_slice_from_copied_buffer(buffer, len);
+ grpc_slice slice = grpc_slice_from_copied_buffer(buffer, len);
grpc_byte_buffer *bb = grpc_raw_byte_buffer_create(&slice, 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return bb;
}
@@ -282,7 +282,7 @@ GPR_EXPORT intptr_t GPR_CALLTYPE grpcsharp_batch_context_recv_message_length(
GPR_EXPORT void GPR_CALLTYPE grpcsharp_batch_context_recv_message_to_buffer(
const grpcsharp_batch_context *ctx, char *buffer, size_t buffer_len) {
grpc_byte_buffer_reader reader;
- gpr_slice slice;
+ grpc_slice slice;
size_t offset = 0;
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, ctx->recv_message));
@@ -293,7 +293,7 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_batch_context_recv_message_to_buffer(
memcpy(buffer + offset, GPR_SLICE_START_PTR(slice),
GPR_SLICE_LENGTH(slice));
offset += len;
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
grpc_byte_buffer_reader_destroy(&reader);
diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc
index a3f678f32c..76aa611a5d 100644
--- a/src/node/ext/byte_buffer.cc
+++ b/src/node/ext/byte_buffer.cc
@@ -56,10 +56,10 @@ grpc_byte_buffer *BufferToByteBuffer(Local<Value> buffer) {
Nan::HandleScope scope;
int length = ::node::Buffer::Length(buffer);
char *data = ::node::Buffer::Data(buffer);
- gpr_slice slice = gpr_slice_malloc(length);
+ grpc_slice slice = grpc_slice_malloc(length);
memcpy(GPR_SLICE_START_PTR(slice), data, length);
grpc_byte_buffer *byte_buffer(grpc_raw_byte_buffer_create(&slice, 1));
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return byte_buffer;
}
@@ -77,11 +77,11 @@ Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
Nan::ThrowError("Error initializing byte buffer reader.");
return scope.Escape(Nan::Undefined());
}
- gpr_slice slice = grpc_byte_buffer_reader_readall(&reader);
+ grpc_slice slice = grpc_byte_buffer_reader_readall(&reader);
size_t length = GPR_SLICE_LENGTH(slice);
char *result = new char[length];
memcpy(result, GPR_SLICE_START_PTR(slice), length);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return scope.Escape(MakeFastBuffer(
Nan::NewBuffer(result, length, delete_buffer, NULL).ToLocalChecked()));
}
diff --git a/src/objective-c/GRPCClient/private/NSData+GRPC.m b/src/objective-c/GRPCClient/private/NSData+GRPC.m
index 98337799e9..45d23d8651 100644
--- a/src/objective-c/GRPCClient/private/NSData+GRPC.m
+++ b/src/objective-c/GRPCClient/private/NSData+GRPC.m
@@ -53,22 +53,22 @@ static void MallocAndCopyByteBufferToCharArray(grpc_byte_buffer *buffer,
}
// The slice contains uncompressed data even if compressed data was received
// because the reader takes care of automatically decompressing it
- gpr_slice slice = grpc_byte_buffer_reader_readall(&reader);
+ grpc_slice slice = grpc_byte_buffer_reader_readall(&reader);
size_t uncompressed_length = GPR_SLICE_LENGTH(slice);
char *result = malloc(uncompressed_length);
if (result) {
memcpy(result, GPR_SLICE_START_PTR(slice), uncompressed_length);
}
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
*array = result;
*length = uncompressed_length;
}
static grpc_byte_buffer *CopyCharArrayToNewByteBuffer(const char *array,
size_t length) {
- gpr_slice slice = gpr_slice_from_copied_buffer(array, length);
+ grpc_slice slice = grpc_slice_from_copied_buffer(array, length);
grpc_byte_buffer *buffer = grpc_raw_byte_buffer_create(&slice, 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return buffer;
}
@@ -97,9 +97,9 @@ static grpc_byte_buffer *CopyCharArrayToNewByteBuffer(const char *array,
// appending of byte arrays by not using internally a single contiguous memory
// block for representation.
// The following implementation is thus not optimal, sometimes requiring two
- // copies (one by self.bytes and another by gpr_slice_from_copied_buffer).
+ // copies (one by self.bytes and another by grpc_slice_from_copied_buffer).
// If it turns out to be an issue, we can use enumerateByteRangesUsingblock:
- // to create an array of gpr_slice objects to pass to
+ // to create an array of grpc_slice objects to pass to
// grpc_raw_byte_buffer_create.
// That would make it do exactly one copy, always.
return CopyCharArrayToNewByteBuffer((const char *)self.bytes,
diff --git a/src/php/ext/grpc/byte_buffer.c b/src/php/ext/grpc/byte_buffer.c
index 3be1429f13..56fd11d09b 100644
--- a/src/php/ext/grpc/byte_buffer.c
+++ b/src/php/ext/grpc/byte_buffer.c
@@ -50,9 +50,9 @@
#include <grpc/support/slice.h>
grpc_byte_buffer *string_to_byte_buffer(char *string, size_t length) {
- gpr_slice slice = gpr_slice_from_copied_buffer(string, length);
+ grpc_slice slice = grpc_slice_from_copied_buffer(string, length);
grpc_byte_buffer *buffer = grpc_raw_byte_buffer_create(&slice, 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return buffer;
}
@@ -66,11 +66,11 @@ void byte_buffer_to_string(grpc_byte_buffer *buffer, char **out_string,
return;
}
- gpr_slice slice = grpc_byte_buffer_reader_readall(&reader);
+ grpc_slice slice = grpc_byte_buffer_reader_readall(&reader);
size_t length = GPR_SLICE_LENGTH(slice);
char *string = ecalloc(length + 1, sizeof(char));
memcpy(string, GPR_SLICE_START_PTR(slice), length);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
*out_string = string;
*out_length = length;
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
index 9560fad137..ba26284b2c 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
@@ -53,23 +53,23 @@ cdef extern from "grpc/byte_buffer_reader.h":
cdef extern from "grpc/grpc.h":
- ctypedef struct gpr_slice:
- # don't worry about writing out the members of gpr_slice; we never access
+ ctypedef struct grpc_slice:
+ # don't worry about writing out the members of grpc_slice; we never access
# them directly.
pass
- gpr_slice gpr_slice_ref(gpr_slice s) nogil
- void gpr_slice_unref(gpr_slice s) nogil
- gpr_slice gpr_slice_new(void *p, size_t len, void (*destroy)(void *)) nogil
- gpr_slice gpr_slice_new_with_len(
+ grpc_slice grpc_slice_ref(grpc_slice s) nogil
+ void grpc_slice_unref(grpc_slice s) nogil
+ grpc_slice grpc_slice_new(void *p, size_t len, void (*destroy)(void *)) nogil
+ grpc_slice grpc_slice_new_with_len(
void *p, size_t len, void (*destroy)(void *, size_t)) nogil
- gpr_slice gpr_slice_malloc(size_t length) nogil
- gpr_slice gpr_slice_from_copied_string(const char *source) nogil
- gpr_slice gpr_slice_from_copied_buffer(const char *source, size_t len) nogil
+ grpc_slice grpc_slice_malloc(size_t length) nogil
+ grpc_slice grpc_slice_from_copied_string(const char *source) nogil
+ grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t len) nogil
# Declare functions for function-like macros (because Cython)...
- void *gpr_slice_start_ptr "GPR_SLICE_START_PTR" (gpr_slice s) nogil
- size_t gpr_slice_length "GPR_SLICE_LENGTH" (gpr_slice s) nogil
+ void *grpc_slice_start_ptr "GPR_SLICE_START_PTR" (grpc_slice s) nogil
+ size_t grpc_slice_length "GPR_SLICE_LENGTH" (grpc_slice s) nogil
ctypedef enum gpr_clock_type:
GPR_CLOCK_MONOTONIC
@@ -101,7 +101,7 @@ cdef extern from "grpc/grpc.h":
# We don't care about the internals.
pass
- grpc_byte_buffer *grpc_raw_byte_buffer_create(gpr_slice *slices,
+ grpc_byte_buffer *grpc_raw_byte_buffer_create(grpc_slice *slices,
size_t nslices) nogil
size_t grpc_byte_buffer_length(grpc_byte_buffer *bb) nogil
void grpc_byte_buffer_destroy(grpc_byte_buffer *byte_buffer) nogil
@@ -109,7 +109,7 @@ cdef extern from "grpc/grpc.h":
int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
grpc_byte_buffer *buffer) nogil
int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
- gpr_slice *slice) nogil
+ grpc_slice *slice) nogil
void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader) nogil
ctypedef enum grpc_status_code:
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
index 8a4eef4d2e..cadfce6ee6 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
@@ -242,19 +242,19 @@ cdef class ByteBuffer:
return
cdef char *c_data = data
- cdef gpr_slice data_slice
+ cdef grpc_slice data_slice
cdef size_t data_length = len(data)
with nogil:
- data_slice = gpr_slice_from_copied_buffer(c_data, data_length)
+ data_slice = grpc_slice_from_copied_buffer(c_data, data_length)
with nogil:
self.c_byte_buffer = grpc_raw_byte_buffer_create(
&data_slice, 1)
with nogil:
- gpr_slice_unref(data_slice)
+ grpc_slice_unref(data_slice)
def bytes(self):
cdef grpc_byte_buffer_reader reader
- cdef gpr_slice data_slice
+ cdef grpc_slice data_slice
cdef size_t data_slice_length
cdef void *data_slice_pointer
cdef bint reader_status
@@ -267,11 +267,11 @@ cdef class ByteBuffer:
result = bytearray()
with nogil:
while grpc_byte_buffer_reader_next(&reader, &data_slice):
- data_slice_pointer = gpr_slice_start_ptr(data_slice)
- data_slice_length = gpr_slice_length(data_slice)
+ data_slice_pointer = grpc_slice_start_ptr(data_slice)
+ data_slice_length = grpc_slice_length(data_slice)
with gil:
result += (<char *>data_slice_pointer)[:data_slice_length]
- gpr_slice_unref(data_slice)
+ grpc_slice_unref(data_slice)
with nogil:
grpc_byte_buffer_reader_destroy(&reader)
return bytes(result)
diff --git a/src/ruby/ext/grpc/rb_byte_buffer.c b/src/ruby/ext/grpc/rb_byte_buffer.c
index 61b7c30315..511abe3fbe 100644
--- a/src/ruby/ext/grpc/rb_byte_buffer.c
+++ b/src/ruby/ext/grpc/rb_byte_buffer.c
@@ -42,16 +42,16 @@
#include "rb_grpc.h"
grpc_byte_buffer* grpc_rb_s_to_byte_buffer(char *string, size_t length) {
- gpr_slice slice = gpr_slice_from_copied_buffer(string, length);
+ grpc_slice slice = grpc_slice_from_copied_buffer(string, length);
grpc_byte_buffer *buffer = grpc_raw_byte_buffer_create(&slice, 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return buffer;
}
VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer *buffer) {
VALUE rb_string;
grpc_byte_buffer_reader reader;
- gpr_slice next;
+ grpc_slice next;
if (buffer == NULL) {
return Qnil;
}
@@ -63,7 +63,7 @@ VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer *buffer) {
while (grpc_byte_buffer_reader_next(&reader, &next) != 0) {
rb_str_cat(rb_string, (const char *) GPR_SLICE_START_PTR(next),
GPR_SLICE_LENGTH(next));
- gpr_slice_unref(next);
+ grpc_slice_unref(next);
}
return rb_string;
}
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c
index fd73cc7970..dd156f0867 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c
@@ -221,35 +221,35 @@ gpr_set_log_verbosity_type gpr_set_log_verbosity_import;
gpr_log_verbosity_init_type gpr_log_verbosity_init_import;
gpr_set_log_function_type gpr_set_log_function_import;
gpr_format_message_type gpr_format_message_import;
-gpr_slice_ref_type gpr_slice_ref_import;
-gpr_slice_unref_type gpr_slice_unref_import;
-gpr_slice_new_type gpr_slice_new_import;
-gpr_slice_new_with_user_data_type gpr_slice_new_with_user_data_import;
-gpr_slice_new_with_len_type gpr_slice_new_with_len_import;
-gpr_slice_malloc_type gpr_slice_malloc_import;
-gpr_slice_from_copied_string_type gpr_slice_from_copied_string_import;
-gpr_slice_from_copied_buffer_type gpr_slice_from_copied_buffer_import;
-gpr_slice_from_static_string_type gpr_slice_from_static_string_import;
-gpr_slice_sub_type gpr_slice_sub_import;
-gpr_slice_sub_no_ref_type gpr_slice_sub_no_ref_import;
-gpr_slice_split_tail_type gpr_slice_split_tail_import;
-gpr_slice_split_head_type gpr_slice_split_head_import;
+grpc_slice_ref_type grpc_slice_ref_import;
+grpc_slice_unref_type grpc_slice_unref_import;
+grpc_slice_new_type grpc_slice_new_import;
+grpc_slice_new_with_user_data_type grpc_slice_new_with_user_data_import;
+grpc_slice_new_with_len_type grpc_slice_new_with_len_import;
+grpc_slice_malloc_type grpc_slice_malloc_import;
+grpc_slice_from_copied_string_type grpc_slice_from_copied_string_import;
+grpc_slice_from_copied_buffer_type grpc_slice_from_copied_buffer_import;
+grpc_slice_from_static_string_type grpc_slice_from_static_string_import;
+grpc_slice_sub_type grpc_slice_sub_import;
+grpc_slice_sub_no_ref_type grpc_slice_sub_no_ref_import;
+grpc_slice_split_tail_type grpc_slice_split_tail_import;
+grpc_slice_split_head_type grpc_slice_split_head_import;
gpr_empty_slice_type gpr_empty_slice_import;
-gpr_slice_cmp_type gpr_slice_cmp_import;
-gpr_slice_str_cmp_type gpr_slice_str_cmp_import;
-gpr_slice_buffer_init_type gpr_slice_buffer_init_import;
-gpr_slice_buffer_destroy_type gpr_slice_buffer_destroy_import;
-gpr_slice_buffer_add_type gpr_slice_buffer_add_import;
-gpr_slice_buffer_add_indexed_type gpr_slice_buffer_add_indexed_import;
-gpr_slice_buffer_addn_type gpr_slice_buffer_addn_import;
-gpr_slice_buffer_tiny_add_type gpr_slice_buffer_tiny_add_import;
-gpr_slice_buffer_pop_type gpr_slice_buffer_pop_import;
-gpr_slice_buffer_reset_and_unref_type gpr_slice_buffer_reset_and_unref_import;
-gpr_slice_buffer_swap_type gpr_slice_buffer_swap_import;
-gpr_slice_buffer_move_into_type gpr_slice_buffer_move_into_import;
-gpr_slice_buffer_trim_end_type gpr_slice_buffer_trim_end_import;
-gpr_slice_buffer_move_first_type gpr_slice_buffer_move_first_import;
-gpr_slice_buffer_take_first_type gpr_slice_buffer_take_first_import;
+grpc_slice_cmp_type grpc_slice_cmp_import;
+grpc_slice_str_cmp_type grpc_slice_str_cmp_import;
+grpc_slice_buffer_init_type grpc_slice_buffer_init_import;
+grpc_slice_buffer_destroy_type grpc_slice_buffer_destroy_import;
+grpc_slice_buffer_add_type grpc_slice_buffer_add_import;
+grpc_slice_buffer_add_indexed_type grpc_slice_buffer_add_indexed_import;
+grpc_slice_buffer_addn_type grpc_slice_buffer_addn_import;
+grpc_slice_buffer_tiny_add_type grpc_slice_buffer_tiny_add_import;
+grpc_slice_buffer_pop_type grpc_slice_buffer_pop_import;
+grpc_slice_buffer_reset_and_unref_type grpc_slice_buffer_reset_and_unref_import;
+grpc_slice_buffer_swap_type grpc_slice_buffer_swap_import;
+grpc_slice_buffer_move_into_type grpc_slice_buffer_move_into_import;
+grpc_slice_buffer_trim_end_type grpc_slice_buffer_trim_end_import;
+grpc_slice_buffer_move_first_type grpc_slice_buffer_move_first_import;
+grpc_slice_buffer_take_first_type grpc_slice_buffer_take_first_import;
gpr_strdup_type gpr_strdup_import;
gpr_asprintf_type gpr_asprintf_import;
gpr_subprocess_binary_extension_type gpr_subprocess_binary_extension_import;
@@ -495,35 +495,35 @@ void grpc_rb_load_imports(HMODULE library) {
gpr_log_verbosity_init_import = (gpr_log_verbosity_init_type) GetProcAddress(library, "gpr_log_verbosity_init");
gpr_set_log_function_import = (gpr_set_log_function_type) GetProcAddress(library, "gpr_set_log_function");
gpr_format_message_import = (gpr_format_message_type) GetProcAddress(library, "gpr_format_message");
- gpr_slice_ref_import = (gpr_slice_ref_type) GetProcAddress(library, "gpr_slice_ref");
- gpr_slice_unref_import = (gpr_slice_unref_type) GetProcAddress(library, "gpr_slice_unref");
- gpr_slice_new_import = (gpr_slice_new_type) GetProcAddress(library, "gpr_slice_new");
- gpr_slice_new_with_user_data_import = (gpr_slice_new_with_user_data_type) GetProcAddress(library, "gpr_slice_new_with_user_data");
- gpr_slice_new_with_len_import = (gpr_slice_new_with_len_type) GetProcAddress(library, "gpr_slice_new_with_len");
- gpr_slice_malloc_import = (gpr_slice_malloc_type) GetProcAddress(library, "gpr_slice_malloc");
- gpr_slice_from_copied_string_import = (gpr_slice_from_copied_string_type) GetProcAddress(library, "gpr_slice_from_copied_string");
- gpr_slice_from_copied_buffer_import = (gpr_slice_from_copied_buffer_type) GetProcAddress(library, "gpr_slice_from_copied_buffer");
- gpr_slice_from_static_string_import = (gpr_slice_from_static_string_type) GetProcAddress(library, "gpr_slice_from_static_string");
- gpr_slice_sub_import = (gpr_slice_sub_type) GetProcAddress(library, "gpr_slice_sub");
- gpr_slice_sub_no_ref_import = (gpr_slice_sub_no_ref_type) GetProcAddress(library, "gpr_slice_sub_no_ref");
- gpr_slice_split_tail_import = (gpr_slice_split_tail_type) GetProcAddress(library, "gpr_slice_split_tail");
- gpr_slice_split_head_import = (gpr_slice_split_head_type) GetProcAddress(library, "gpr_slice_split_head");
+ grpc_slice_ref_import = (grpc_slice_ref_type) GetProcAddress(library, "grpc_slice_ref");
+ grpc_slice_unref_import = (grpc_slice_unref_type) GetProcAddress(library, "grpc_slice_unref");
+ grpc_slice_new_import = (grpc_slice_new_type) GetProcAddress(library, "grpc_slice_new");
+ grpc_slice_new_with_user_data_import = (grpc_slice_new_with_user_data_type) GetProcAddress(library, "grpc_slice_new_with_user_data");
+ grpc_slice_new_with_len_import = (grpc_slice_new_with_len_type) GetProcAddress(library, "grpc_slice_new_with_len");
+ grpc_slice_malloc_import = (grpc_slice_malloc_type) GetProcAddress(library, "grpc_slice_malloc");
+ grpc_slice_from_copied_string_import = (grpc_slice_from_copied_string_type) GetProcAddress(library, "grpc_slice_from_copied_string");
+ grpc_slice_from_copied_buffer_import = (grpc_slice_from_copied_buffer_type) GetProcAddress(library, "grpc_slice_from_copied_buffer");
+ grpc_slice_from_static_string_import = (grpc_slice_from_static_string_type) GetProcAddress(library, "grpc_slice_from_static_string");
+ grpc_slice_sub_import = (grpc_slice_sub_type) GetProcAddress(library, "grpc_slice_sub");
+ grpc_slice_sub_no_ref_import = (grpc_slice_sub_no_ref_type) GetProcAddress(library, "grpc_slice_sub_no_ref");
+ grpc_slice_split_tail_import = (grpc_slice_split_tail_type) GetProcAddress(library, "grpc_slice_split_tail");
+ grpc_slice_split_head_import = (grpc_slice_split_head_type) GetProcAddress(library, "grpc_slice_split_head");
gpr_empty_slice_import = (gpr_empty_slice_type) GetProcAddress(library, "gpr_empty_slice");
- gpr_slice_cmp_import = (gpr_slice_cmp_type) GetProcAddress(library, "gpr_slice_cmp");
- gpr_slice_str_cmp_import = (gpr_slice_str_cmp_type) GetProcAddress(library, "gpr_slice_str_cmp");
- gpr_slice_buffer_init_import = (gpr_slice_buffer_init_type) GetProcAddress(library, "gpr_slice_buffer_init");
- gpr_slice_buffer_destroy_import = (gpr_slice_buffer_destroy_type) GetProcAddress(library, "gpr_slice_buffer_destroy");
- gpr_slice_buffer_add_import = (gpr_slice_buffer_add_type) GetProcAddress(library, "gpr_slice_buffer_add");
- gpr_slice_buffer_add_indexed_import = (gpr_slice_buffer_add_indexed_type) GetProcAddress(library, "gpr_slice_buffer_add_indexed");
- gpr_slice_buffer_addn_import = (gpr_slice_buffer_addn_type) GetProcAddress(library, "gpr_slice_buffer_addn");
- gpr_slice_buffer_tiny_add_import = (gpr_slice_buffer_tiny_add_type) GetProcAddress(library, "gpr_slice_buffer_tiny_add");
- gpr_slice_buffer_pop_import = (gpr_slice_buffer_pop_type) GetProcAddress(library, "gpr_slice_buffer_pop");
- gpr_slice_buffer_reset_and_unref_import = (gpr_slice_buffer_reset_and_unref_type) GetProcAddress(library, "gpr_slice_buffer_reset_and_unref");
- gpr_slice_buffer_swap_import = (gpr_slice_buffer_swap_type) GetProcAddress(library, "gpr_slice_buffer_swap");
- gpr_slice_buffer_move_into_import = (gpr_slice_buffer_move_into_type) GetProcAddress(library, "gpr_slice_buffer_move_into");
- gpr_slice_buffer_trim_end_import = (gpr_slice_buffer_trim_end_type) GetProcAddress(library, "gpr_slice_buffer_trim_end");
- gpr_slice_buffer_move_first_import = (gpr_slice_buffer_move_first_type) GetProcAddress(library, "gpr_slice_buffer_move_first");
- gpr_slice_buffer_take_first_import = (gpr_slice_buffer_take_first_type) GetProcAddress(library, "gpr_slice_buffer_take_first");
+ grpc_slice_cmp_import = (grpc_slice_cmp_type) GetProcAddress(library, "grpc_slice_cmp");
+ grpc_slice_str_cmp_import = (grpc_slice_str_cmp_type) GetProcAddress(library, "grpc_slice_str_cmp");
+ grpc_slice_buffer_init_import = (grpc_slice_buffer_init_type) GetProcAddress(library, "grpc_slice_buffer_init");
+ grpc_slice_buffer_destroy_import = (grpc_slice_buffer_destroy_type) GetProcAddress(library, "grpc_slice_buffer_destroy");
+ grpc_slice_buffer_add_import = (grpc_slice_buffer_add_type) GetProcAddress(library, "grpc_slice_buffer_add");
+ grpc_slice_buffer_add_indexed_import = (grpc_slice_buffer_add_indexed_type) GetProcAddress(library, "grpc_slice_buffer_add_indexed");
+ grpc_slice_buffer_addn_import = (grpc_slice_buffer_addn_type) GetProcAddress(library, "grpc_slice_buffer_addn");
+ grpc_slice_buffer_tiny_add_import = (grpc_slice_buffer_tiny_add_type) GetProcAddress(library, "grpc_slice_buffer_tiny_add");
+ grpc_slice_buffer_pop_import = (grpc_slice_buffer_pop_type) GetProcAddress(library, "grpc_slice_buffer_pop");
+ grpc_slice_buffer_reset_and_unref_import = (grpc_slice_buffer_reset_and_unref_type) GetProcAddress(library, "grpc_slice_buffer_reset_and_unref");
+ grpc_slice_buffer_swap_import = (grpc_slice_buffer_swap_type) GetProcAddress(library, "grpc_slice_buffer_swap");
+ grpc_slice_buffer_move_into_import = (grpc_slice_buffer_move_into_type) GetProcAddress(library, "grpc_slice_buffer_move_into");
+ grpc_slice_buffer_trim_end_import = (grpc_slice_buffer_trim_end_type) GetProcAddress(library, "grpc_slice_buffer_trim_end");
+ grpc_slice_buffer_move_first_import = (grpc_slice_buffer_move_first_type) GetProcAddress(library, "grpc_slice_buffer_move_first");
+ grpc_slice_buffer_take_first_import = (grpc_slice_buffer_take_first_type) GetProcAddress(library, "grpc_slice_buffer_take_first");
gpr_strdup_import = (gpr_strdup_type) GetProcAddress(library, "gpr_strdup");
gpr_asprintf_import = (gpr_asprintf_type) GetProcAddress(library, "gpr_asprintf");
gpr_subprocess_binary_extension_import = (gpr_subprocess_binary_extension_type) GetProcAddress(library, "gpr_subprocess_binary_extension");
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
index c2244150f2..30962a1c79 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
@@ -62,10 +62,10 @@
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
-typedef grpc_byte_buffer *(*grpc_raw_byte_buffer_create_type)(gpr_slice *slices, size_t nslices);
+typedef grpc_byte_buffer *(*grpc_raw_byte_buffer_create_type)(grpc_slice *slices, size_t nslices);
extern grpc_raw_byte_buffer_create_type grpc_raw_byte_buffer_create_import;
#define grpc_raw_byte_buffer_create grpc_raw_byte_buffer_create_import
-typedef grpc_byte_buffer *(*grpc_raw_compressed_byte_buffer_create_type)(gpr_slice *slices, size_t nslices, grpc_compression_algorithm compression);
+typedef grpc_byte_buffer *(*grpc_raw_compressed_byte_buffer_create_type)(grpc_slice *slices, size_t nslices, grpc_compression_algorithm compression);
extern grpc_raw_compressed_byte_buffer_create_type grpc_raw_compressed_byte_buffer_create_import;
#define grpc_raw_compressed_byte_buffer_create grpc_raw_compressed_byte_buffer_create_import
typedef grpc_byte_buffer *(*grpc_byte_buffer_copy_type)(grpc_byte_buffer *bb);
@@ -83,10 +83,10 @@ extern grpc_byte_buffer_reader_init_type grpc_byte_buffer_reader_init_import;
typedef void(*grpc_byte_buffer_reader_destroy_type)(grpc_byte_buffer_reader *reader);
extern grpc_byte_buffer_reader_destroy_type grpc_byte_buffer_reader_destroy_import;
#define grpc_byte_buffer_reader_destroy grpc_byte_buffer_reader_destroy_import
-typedef int(*grpc_byte_buffer_reader_next_type)(grpc_byte_buffer_reader *reader, gpr_slice *slice);
+typedef int(*grpc_byte_buffer_reader_next_type)(grpc_byte_buffer_reader *reader, grpc_slice *slice);
extern grpc_byte_buffer_reader_next_type grpc_byte_buffer_reader_next_import;
#define grpc_byte_buffer_reader_next grpc_byte_buffer_reader_next_import
-typedef gpr_slice(*grpc_byte_buffer_reader_readall_type)(grpc_byte_buffer_reader *reader);
+typedef grpc_slice(*grpc_byte_buffer_reader_readall_type)(grpc_byte_buffer_reader *reader);
extern grpc_byte_buffer_reader_readall_type grpc_byte_buffer_reader_readall_import;
#define grpc_byte_buffer_reader_readall grpc_byte_buffer_reader_readall_import
typedef grpc_byte_buffer *(*grpc_raw_byte_buffer_from_reader_type)(grpc_byte_buffer_reader *reader);
@@ -614,93 +614,93 @@ extern gpr_set_log_function_type gpr_set_log_function_import;
typedef char *(*gpr_format_message_type)(int messageid);
extern gpr_format_message_type gpr_format_message_import;
#define gpr_format_message gpr_format_message_import
-typedef gpr_slice(*gpr_slice_ref_type)(gpr_slice s);
-extern gpr_slice_ref_type gpr_slice_ref_import;
-#define gpr_slice_ref gpr_slice_ref_import
-typedef void(*gpr_slice_unref_type)(gpr_slice s);
-extern gpr_slice_unref_type gpr_slice_unref_import;
-#define gpr_slice_unref gpr_slice_unref_import
-typedef gpr_slice(*gpr_slice_new_type)(void *p, size_t len, void (*destroy)(void *));
-extern gpr_slice_new_type gpr_slice_new_import;
-#define gpr_slice_new gpr_slice_new_import
-typedef gpr_slice(*gpr_slice_new_with_user_data_type)(void *p, size_t len, void (*destroy)(void *), void *user_data);
-extern gpr_slice_new_with_user_data_type gpr_slice_new_with_user_data_import;
-#define gpr_slice_new_with_user_data gpr_slice_new_with_user_data_import
-typedef gpr_slice(*gpr_slice_new_with_len_type)(void *p, size_t len, void (*destroy)(void *, size_t));
-extern gpr_slice_new_with_len_type gpr_slice_new_with_len_import;
-#define gpr_slice_new_with_len gpr_slice_new_with_len_import
-typedef gpr_slice(*gpr_slice_malloc_type)(size_t length);
-extern gpr_slice_malloc_type gpr_slice_malloc_import;
-#define gpr_slice_malloc gpr_slice_malloc_import
-typedef gpr_slice(*gpr_slice_from_copied_string_type)(const char *source);
-extern gpr_slice_from_copied_string_type gpr_slice_from_copied_string_import;
-#define gpr_slice_from_copied_string gpr_slice_from_copied_string_import
-typedef gpr_slice(*gpr_slice_from_copied_buffer_type)(const char *source, size_t len);
-extern gpr_slice_from_copied_buffer_type gpr_slice_from_copied_buffer_import;
-#define gpr_slice_from_copied_buffer gpr_slice_from_copied_buffer_import
-typedef gpr_slice(*gpr_slice_from_static_string_type)(const char *source);
-extern gpr_slice_from_static_string_type gpr_slice_from_static_string_import;
-#define gpr_slice_from_static_string gpr_slice_from_static_string_import
-typedef gpr_slice(*gpr_slice_sub_type)(gpr_slice s, size_t begin, size_t end);
-extern gpr_slice_sub_type gpr_slice_sub_import;
-#define gpr_slice_sub gpr_slice_sub_import
-typedef gpr_slice(*gpr_slice_sub_no_ref_type)(gpr_slice s, size_t begin, size_t end);
-extern gpr_slice_sub_no_ref_type gpr_slice_sub_no_ref_import;
-#define gpr_slice_sub_no_ref gpr_slice_sub_no_ref_import
-typedef gpr_slice(*gpr_slice_split_tail_type)(gpr_slice *s, size_t split);
-extern gpr_slice_split_tail_type gpr_slice_split_tail_import;
-#define gpr_slice_split_tail gpr_slice_split_tail_import
-typedef gpr_slice(*gpr_slice_split_head_type)(gpr_slice *s, size_t split);
-extern gpr_slice_split_head_type gpr_slice_split_head_import;
-#define gpr_slice_split_head gpr_slice_split_head_import
-typedef gpr_slice(*gpr_empty_slice_type)(void);
+typedef grpc_slice(*grpc_slice_ref_type)(grpc_slice s);
+extern grpc_slice_ref_type grpc_slice_ref_import;
+#define grpc_slice_ref grpc_slice_ref_import
+typedef void(*grpc_slice_unref_type)(grpc_slice s);
+extern grpc_slice_unref_type grpc_slice_unref_import;
+#define grpc_slice_unref grpc_slice_unref_import
+typedef grpc_slice(*grpc_slice_new_type)(void *p, size_t len, void (*destroy)(void *));
+extern grpc_slice_new_type grpc_slice_new_import;
+#define grpc_slice_new grpc_slice_new_import
+typedef grpc_slice(*grpc_slice_new_with_user_data_type)(void *p, size_t len, void (*destroy)(void *), void *user_data);
+extern grpc_slice_new_with_user_data_type grpc_slice_new_with_user_data_import;
+#define grpc_slice_new_with_user_data grpc_slice_new_with_user_data_import
+typedef grpc_slice(*grpc_slice_new_with_len_type)(void *p, size_t len, void (*destroy)(void *, size_t));
+extern grpc_slice_new_with_len_type grpc_slice_new_with_len_import;
+#define grpc_slice_new_with_len grpc_slice_new_with_len_import
+typedef grpc_slice(*grpc_slice_malloc_type)(size_t length);
+extern grpc_slice_malloc_type grpc_slice_malloc_import;
+#define grpc_slice_malloc grpc_slice_malloc_import
+typedef grpc_slice(*grpc_slice_from_copied_string_type)(const char *source);
+extern grpc_slice_from_copied_string_type grpc_slice_from_copied_string_import;
+#define grpc_slice_from_copied_string grpc_slice_from_copied_string_import
+typedef grpc_slice(*grpc_slice_from_copied_buffer_type)(const char *source, size_t len);
+extern grpc_slice_from_copied_buffer_type grpc_slice_from_copied_buffer_import;
+#define grpc_slice_from_copied_buffer grpc_slice_from_copied_buffer_import
+typedef grpc_slice(*grpc_slice_from_static_string_type)(const char *source);
+extern grpc_slice_from_static_string_type grpc_slice_from_static_string_import;
+#define grpc_slice_from_static_string grpc_slice_from_static_string_import
+typedef grpc_slice(*grpc_slice_sub_type)(grpc_slice s, size_t begin, size_t end);
+extern grpc_slice_sub_type grpc_slice_sub_import;
+#define grpc_slice_sub grpc_slice_sub_import
+typedef grpc_slice(*grpc_slice_sub_no_ref_type)(grpc_slice s, size_t begin, size_t end);
+extern grpc_slice_sub_no_ref_type grpc_slice_sub_no_ref_import;
+#define grpc_slice_sub_no_ref grpc_slice_sub_no_ref_import
+typedef grpc_slice(*grpc_slice_split_tail_type)(grpc_slice *s, size_t split);
+extern grpc_slice_split_tail_type grpc_slice_split_tail_import;
+#define grpc_slice_split_tail grpc_slice_split_tail_import
+typedef grpc_slice(*grpc_slice_split_head_type)(grpc_slice *s, size_t split);
+extern grpc_slice_split_head_type grpc_slice_split_head_import;
+#define grpc_slice_split_head grpc_slice_split_head_import
+typedef grpc_slice(*gpr_empty_slice_type)(void);
extern gpr_empty_slice_type gpr_empty_slice_import;
#define gpr_empty_slice gpr_empty_slice_import
-typedef int(*gpr_slice_cmp_type)(gpr_slice a, gpr_slice b);
-extern gpr_slice_cmp_type gpr_slice_cmp_import;
-#define gpr_slice_cmp gpr_slice_cmp_import
-typedef int(*gpr_slice_str_cmp_type)(gpr_slice a, const char *b);
-extern gpr_slice_str_cmp_type gpr_slice_str_cmp_import;
-#define gpr_slice_str_cmp gpr_slice_str_cmp_import
-typedef void(*gpr_slice_buffer_init_type)(gpr_slice_buffer *sb);
-extern gpr_slice_buffer_init_type gpr_slice_buffer_init_import;
-#define gpr_slice_buffer_init gpr_slice_buffer_init_import
-typedef void(*gpr_slice_buffer_destroy_type)(gpr_slice_buffer *sb);
-extern gpr_slice_buffer_destroy_type gpr_slice_buffer_destroy_import;
-#define gpr_slice_buffer_destroy gpr_slice_buffer_destroy_import
-typedef void(*gpr_slice_buffer_add_type)(gpr_slice_buffer *sb, gpr_slice slice);
-extern gpr_slice_buffer_add_type gpr_slice_buffer_add_import;
-#define gpr_slice_buffer_add gpr_slice_buffer_add_import
-typedef size_t(*gpr_slice_buffer_add_indexed_type)(gpr_slice_buffer *sb, gpr_slice slice);
-extern gpr_slice_buffer_add_indexed_type gpr_slice_buffer_add_indexed_import;
-#define gpr_slice_buffer_add_indexed gpr_slice_buffer_add_indexed_import
-typedef void(*gpr_slice_buffer_addn_type)(gpr_slice_buffer *sb, gpr_slice *slices, size_t n);
-extern gpr_slice_buffer_addn_type gpr_slice_buffer_addn_import;
-#define gpr_slice_buffer_addn gpr_slice_buffer_addn_import
-typedef uint8_t *(*gpr_slice_buffer_tiny_add_type)(gpr_slice_buffer *sb, size_t len);
-extern gpr_slice_buffer_tiny_add_type gpr_slice_buffer_tiny_add_import;
-#define gpr_slice_buffer_tiny_add gpr_slice_buffer_tiny_add_import
-typedef void(*gpr_slice_buffer_pop_type)(gpr_slice_buffer *sb);
-extern gpr_slice_buffer_pop_type gpr_slice_buffer_pop_import;
-#define gpr_slice_buffer_pop gpr_slice_buffer_pop_import
-typedef void(*gpr_slice_buffer_reset_and_unref_type)(gpr_slice_buffer *sb);
-extern gpr_slice_buffer_reset_and_unref_type gpr_slice_buffer_reset_and_unref_import;
-#define gpr_slice_buffer_reset_and_unref gpr_slice_buffer_reset_and_unref_import
-typedef void(*gpr_slice_buffer_swap_type)(gpr_slice_buffer *a, gpr_slice_buffer *b);
-extern gpr_slice_buffer_swap_type gpr_slice_buffer_swap_import;
-#define gpr_slice_buffer_swap gpr_slice_buffer_swap_import
-typedef void(*gpr_slice_buffer_move_into_type)(gpr_slice_buffer *src, gpr_slice_buffer *dst);
-extern gpr_slice_buffer_move_into_type gpr_slice_buffer_move_into_import;
-#define gpr_slice_buffer_move_into gpr_slice_buffer_move_into_import
-typedef void(*gpr_slice_buffer_trim_end_type)(gpr_slice_buffer *src, size_t n, gpr_slice_buffer *garbage);
-extern gpr_slice_buffer_trim_end_type gpr_slice_buffer_trim_end_import;
-#define gpr_slice_buffer_trim_end gpr_slice_buffer_trim_end_import
-typedef void(*gpr_slice_buffer_move_first_type)(gpr_slice_buffer *src, size_t n, gpr_slice_buffer *dst);
-extern gpr_slice_buffer_move_first_type gpr_slice_buffer_move_first_import;
-#define gpr_slice_buffer_move_first gpr_slice_buffer_move_first_import
-typedef gpr_slice(*gpr_slice_buffer_take_first_type)(gpr_slice_buffer *src);
-extern gpr_slice_buffer_take_first_type gpr_slice_buffer_take_first_import;
-#define gpr_slice_buffer_take_first gpr_slice_buffer_take_first_import
+typedef int(*grpc_slice_cmp_type)(grpc_slice a, grpc_slice b);
+extern grpc_slice_cmp_type grpc_slice_cmp_import;
+#define grpc_slice_cmp grpc_slice_cmp_import
+typedef int(*grpc_slice_str_cmp_type)(grpc_slice a, const char *b);
+extern grpc_slice_str_cmp_type grpc_slice_str_cmp_import;
+#define grpc_slice_str_cmp grpc_slice_str_cmp_import
+typedef void(*grpc_slice_buffer_init_type)(grpc_slice_buffer *sb);
+extern grpc_slice_buffer_init_type grpc_slice_buffer_init_import;
+#define grpc_slice_buffer_init grpc_slice_buffer_init_import
+typedef void(*grpc_slice_buffer_destroy_type)(grpc_slice_buffer *sb);
+extern grpc_slice_buffer_destroy_type grpc_slice_buffer_destroy_import;
+#define grpc_slice_buffer_destroy grpc_slice_buffer_destroy_import
+typedef void(*grpc_slice_buffer_add_type)(grpc_slice_buffer *sb, grpc_slice slice);
+extern grpc_slice_buffer_add_type grpc_slice_buffer_add_import;
+#define grpc_slice_buffer_add grpc_slice_buffer_add_import
+typedef size_t(*grpc_slice_buffer_add_indexed_type)(grpc_slice_buffer *sb, grpc_slice slice);
+extern grpc_slice_buffer_add_indexed_type grpc_slice_buffer_add_indexed_import;
+#define grpc_slice_buffer_add_indexed grpc_slice_buffer_add_indexed_import
+typedef void(*grpc_slice_buffer_addn_type)(grpc_slice_buffer *sb, grpc_slice *slices, size_t n);
+extern grpc_slice_buffer_addn_type grpc_slice_buffer_addn_import;
+#define grpc_slice_buffer_addn grpc_slice_buffer_addn_import
+typedef uint8_t *(*grpc_slice_buffer_tiny_add_type)(grpc_slice_buffer *sb, size_t len);
+extern grpc_slice_buffer_tiny_add_type grpc_slice_buffer_tiny_add_import;
+#define grpc_slice_buffer_tiny_add grpc_slice_buffer_tiny_add_import
+typedef void(*grpc_slice_buffer_pop_type)(grpc_slice_buffer *sb);
+extern grpc_slice_buffer_pop_type grpc_slice_buffer_pop_import;
+#define grpc_slice_buffer_pop grpc_slice_buffer_pop_import
+typedef void(*grpc_slice_buffer_reset_and_unref_type)(grpc_slice_buffer *sb);
+extern grpc_slice_buffer_reset_and_unref_type grpc_slice_buffer_reset_and_unref_import;
+#define grpc_slice_buffer_reset_and_unref grpc_slice_buffer_reset_and_unref_import
+typedef void(*grpc_slice_buffer_swap_type)(grpc_slice_buffer *a, grpc_slice_buffer *b);
+extern grpc_slice_buffer_swap_type grpc_slice_buffer_swap_import;
+#define grpc_slice_buffer_swap grpc_slice_buffer_swap_import
+typedef void(*grpc_slice_buffer_move_into_type)(grpc_slice_buffer *src, grpc_slice_buffer *dst);
+extern grpc_slice_buffer_move_into_type grpc_slice_buffer_move_into_import;
+#define grpc_slice_buffer_move_into grpc_slice_buffer_move_into_import
+typedef void(*grpc_slice_buffer_trim_end_type)(grpc_slice_buffer *src, size_t n, grpc_slice_buffer *garbage);
+extern grpc_slice_buffer_trim_end_type grpc_slice_buffer_trim_end_import;
+#define grpc_slice_buffer_trim_end grpc_slice_buffer_trim_end_import
+typedef void(*grpc_slice_buffer_move_first_type)(grpc_slice_buffer *src, size_t n, grpc_slice_buffer *dst);
+extern grpc_slice_buffer_move_first_type grpc_slice_buffer_move_first_import;
+#define grpc_slice_buffer_move_first grpc_slice_buffer_move_first_import
+typedef grpc_slice(*grpc_slice_buffer_take_first_type)(grpc_slice_buffer *src);
+extern grpc_slice_buffer_take_first_type grpc_slice_buffer_take_first_import;
+#define grpc_slice_buffer_take_first grpc_slice_buffer_take_first_import
typedef char *(*gpr_strdup_type)(const char *src);
extern gpr_strdup_type gpr_strdup_import;
#define gpr_strdup gpr_strdup_import
diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c
index a9638500b7..07fcd995d7 100644
--- a/test/core/bad_client/bad_client.c
+++ b/test/core/bad_client/bad_client.c
@@ -77,7 +77,7 @@ static void server_setup_transport(void *ts, grpc_transport *transport) {
typedef struct {
grpc_bad_client_client_stream_validator validator;
- gpr_slice_buffer incoming;
+ grpc_slice_buffer incoming;
gpr_event read_done;
} read_args;
@@ -96,9 +96,9 @@ void grpc_run_bad_client_test(
gpr_thd_id id;
char *hex;
grpc_transport *transport;
- gpr_slice slice =
- gpr_slice_from_copied_buffer(client_payload, client_payload_length);
- gpr_slice_buffer outgoing;
+ grpc_slice slice =
+ grpc_slice_from_copied_buffer(client_payload, client_payload_length);
+ grpc_slice_buffer outgoing;
grpc_closure done_write_closure;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -146,8 +146,8 @@ void grpc_run_bad_client_test(
/* Start validator */
gpr_thd_new(&id, thd_func, &a, NULL);
- gpr_slice_buffer_init(&outgoing);
- gpr_slice_buffer_add(&outgoing, slice);
+ grpc_slice_buffer_init(&outgoing);
+ grpc_slice_buffer_add(&outgoing, slice);
grpc_closure_init(&done_write_closure, done_write, &a);
/* Write data */
@@ -172,7 +172,7 @@ void grpc_run_bad_client_test(
if (client_validator != NULL) {
read_args args;
args.validator = client_validator;
- gpr_slice_buffer_init(&args.incoming);
+ grpc_slice_buffer_init(&args.incoming);
gpr_event_init(&args.read_done);
grpc_closure read_done_closure;
grpc_closure_init(&read_done_closure, read_done, &args);
@@ -181,7 +181,7 @@ void grpc_run_bad_client_test(
grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(
gpr_event_wait(&args.read_done, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)));
- gpr_slice_buffer_destroy(&args.incoming);
+ grpc_slice_buffer_destroy(&args.incoming);
}
// Shutdown.
grpc_endpoint_shutdown(&exec_ctx, sfd.client);
@@ -194,7 +194,7 @@ void grpc_run_bad_client_test(
.type == GRPC_OP_COMPLETE);
grpc_server_destroy(a.server);
grpc_completion_queue_destroy(a.cq);
- gpr_slice_buffer_destroy(&outgoing);
+ grpc_slice_buffer_destroy(&outgoing);
grpc_exec_ctx_finish(&exec_ctx);
grpc_shutdown();
diff --git a/test/core/bad_client/bad_client.h b/test/core/bad_client/bad_client.h
index c8b2a4122f..bbca418ef3 100644
--- a/test/core/bad_client/bad_client.h
+++ b/test/core/bad_client/bad_client.h
@@ -45,7 +45,7 @@ typedef void (*grpc_bad_client_server_side_validator)(grpc_server *server,
void *registered_method);
typedef void (*grpc_bad_client_client_stream_validator)(
- gpr_slice_buffer *incoming);
+ grpc_slice_buffer *incoming);
#define GRPC_BAD_CLIENT_DISCONNECT 1
diff --git a/test/core/bad_client/tests/large_metadata.c b/test/core/bad_client/tests/large_metadata.c
index b9c8093ef9..124035c070 100644
--- a/test/core/bad_client/tests/large_metadata.c
+++ b/test/core/bad_client/tests/large_metadata.c
@@ -183,15 +183,15 @@ static void server_verifier_sends_too_much_metadata(grpc_server *server,
cq_verifier_destroy(cqv);
}
-static void client_validator(gpr_slice_buffer *incoming) {
+static void client_validator(grpc_slice_buffer *incoming) {
// Get last frame from incoming slice buffer.
- gpr_slice_buffer last_frame_buffer;
- gpr_slice_buffer_init(&last_frame_buffer);
- gpr_slice_buffer_trim_end(incoming, 13, &last_frame_buffer);
+ grpc_slice_buffer last_frame_buffer;
+ grpc_slice_buffer_init(&last_frame_buffer);
+ grpc_slice_buffer_trim_end(incoming, 13, &last_frame_buffer);
GPR_ASSERT(last_frame_buffer.count == 1);
- gpr_slice last_frame = last_frame_buffer.slices[0];
+ grpc_slice last_frame = last_frame_buffer.slices[0];
// Construct expected frame.
- gpr_slice expected = gpr_slice_malloc(13);
+ grpc_slice expected = grpc_slice_malloc(13);
uint8_t *p = GPR_SLICE_START_PTR(expected);
// Length.
*p++ = 0;
@@ -212,8 +212,8 @@ static void client_validator(gpr_slice_buffer *incoming) {
*p++ = 0;
*p++ = 11;
// Compare actual and expected.
- GPR_ASSERT(gpr_slice_cmp(last_frame, expected) == 0);
- gpr_slice_buffer_destroy(&last_frame_buffer);
+ GPR_ASSERT(grpc_slice_cmp(last_frame, expected) == 0);
+ grpc_slice_buffer_destroy(&last_frame_buffer);
}
int main(int argc, char **argv) {
diff --git a/test/core/bad_ssl/servers/cert.c b/test/core/bad_ssl/servers/cert.c
index 91dd9de81b..52922f5d6b 100644
--- a/test/core/bad_ssl/servers/cert.c
+++ b/test/core/bad_ssl/servers/cert.c
@@ -51,7 +51,7 @@ int main(int argc, char **argv) {
grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
grpc_server_credentials *ssl_creds;
grpc_server *server;
- gpr_slice cert_slice, key_slice;
+ grpc_slice cert_slice, key_slice;
grpc_init();
@@ -70,8 +70,8 @@ int main(int argc, char **argv) {
GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
grpc_server_credentials_release(ssl_creds);
- gpr_slice_unref(cert_slice);
- gpr_slice_unref(key_slice);
+ grpc_slice_unref(cert_slice);
+ grpc_slice_unref(key_slice);
bad_ssl_run(server);
grpc_shutdown();
diff --git a/test/core/client_channel/set_initial_connect_string_test.c b/test/core/client_channel/set_initial_connect_string_test.c
index b7bd67567c..350f2884d7 100644
--- a/test/core/client_channel/set_initial_connect_string_test.c
+++ b/test/core/client_channel/set_initial_connect_string_test.c
@@ -54,8 +54,8 @@ struct rpc_state {
grpc_channel *channel;
grpc_call *call;
grpc_op op;
- gpr_slice_buffer incoming_buffer;
- gpr_slice_buffer temp_incoming_buffer;
+ grpc_slice_buffer incoming_buffer;
+ grpc_slice_buffer temp_incoming_buffer;
grpc_endpoint *tcp;
gpr_atm done_atm;
};
@@ -67,7 +67,7 @@ static grpc_closure on_read;
static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
GPR_ASSERT(error == GRPC_ERROR_NONE);
- gpr_slice_buffer_move_into(&state.temp_incoming_buffer,
+ grpc_slice_buffer_move_into(&state.temp_incoming_buffer,
&state.incoming_buffer);
gpr_log(GPR_DEBUG, "got %" PRIuPTR " bytes, magic is %" PRIuPTR " bytes",
state.incoming_buffer.length, strlen(magic_connect_string));
@@ -86,25 +86,25 @@ static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp,
grpc_tcp_server_acceptor *acceptor) {
test_tcp_server *server = arg;
grpc_closure_init(&on_read, handle_read, NULL);
- gpr_slice_buffer_init(&state.incoming_buffer);
- gpr_slice_buffer_init(&state.temp_incoming_buffer);
+ grpc_slice_buffer_init(&state.incoming_buffer);
+ grpc_slice_buffer_init(&state.temp_incoming_buffer);
state.tcp = tcp;
grpc_endpoint_add_to_pollset(exec_ctx, tcp, server->pollset);
grpc_endpoint_read(exec_ctx, tcp, &state.temp_incoming_buffer, &on_read);
}
static void set_magic_initial_string(struct sockaddr **addr, size_t *addr_len,
- gpr_slice *connect_string) {
+ grpc_slice *connect_string) {
GPR_ASSERT(addr);
GPR_ASSERT(addr_len);
- *connect_string = gpr_slice_from_copied_string(magic_connect_string);
+ *connect_string = grpc_slice_from_copied_string(magic_connect_string);
}
static void reset_addr_and_set_magic_string(struct sockaddr **addr,
size_t *addr_len,
- gpr_slice *connect_string) {
+ grpc_slice *connect_string) {
struct sockaddr_in target;
- *connect_string = gpr_slice_from_copied_string(magic_connect_string);
+ *connect_string = grpc_slice_from_copied_string(magic_connect_string);
gpr_free(*addr);
target.sin_family = AF_INET;
target.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
@@ -148,8 +148,8 @@ static void start_rpc(int use_creds, int target_port) {
static void cleanup_rpc(void) {
grpc_event ev;
- gpr_slice_buffer_destroy(&state.incoming_buffer);
- gpr_slice_buffer_destroy(&state.temp_incoming_buffer);
+ grpc_slice_buffer_destroy(&state.incoming_buffer);
+ grpc_slice_buffer_destroy(&state.temp_incoming_buffer);
grpc_channel_credentials_unref(state.creds);
grpc_call_destroy(state.call);
grpc_completion_queue_shutdown(state.cq);
@@ -194,7 +194,7 @@ static void poll_server_until_read_done(test_tcp_server *server,
gpr_thd_new(&id, actually_poll_server, pa, NULL);
}
-static void match_initial_magic_string(gpr_slice_buffer *buffer) {
+static void match_initial_magic_string(grpc_slice_buffer *buffer) {
size_t i, j, cmp_length;
size_t magic_length = strlen(magic_connect_string);
GPR_ASSERT(buffer->length >= magic_length);
diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c
index 47ecf72e08..c6963df85d 100644
--- a/test/core/compression/message_compress_test.c
+++ b/test/core/compression/message_compress_test.c
@@ -52,16 +52,16 @@ typedef enum {
MAYBE_COMPRESSES
} compressability;
-static void assert_passthrough(gpr_slice value,
+static void assert_passthrough(grpc_slice value,
grpc_compression_algorithm algorithm,
grpc_slice_split_mode uncompressed_split_mode,
grpc_slice_split_mode compressed_split_mode,
compressability compress_result_check) {
- gpr_slice_buffer input;
- gpr_slice_buffer compressed_raw;
- gpr_slice_buffer compressed;
- gpr_slice_buffer output;
- gpr_slice final;
+ grpc_slice_buffer input;
+ grpc_slice_buffer compressed_raw;
+ grpc_slice_buffer compressed;
+ grpc_slice_buffer output;
+ grpc_slice final;
int was_compressed;
char *algorithm_name;
@@ -75,10 +75,10 @@ static void assert_passthrough(gpr_slice value,
algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode),
grpc_slice_split_mode_name(compressed_split_mode));
- gpr_slice_buffer_init(&input);
- gpr_slice_buffer_init(&compressed_raw);
- gpr_slice_buffer_init(&compressed);
- gpr_slice_buffer_init(&output);
+ grpc_slice_buffer_init(&input);
+ grpc_slice_buffer_init(&compressed_raw);
+ grpc_slice_buffer_init(&compressed);
+ grpc_slice_buffer_init(&output);
grpc_split_slices_to_buffer(uncompressed_split_mode, &value, 1, &input);
@@ -103,17 +103,17 @@ static void assert_passthrough(gpr_slice value,
was_compressed ? algorithm : GRPC_COMPRESS_NONE, &compressed, &output));
final = grpc_slice_merge(output.slices, output.count);
- GPR_ASSERT(0 == gpr_slice_cmp(value, final));
+ GPR_ASSERT(0 == grpc_slice_cmp(value, final));
- gpr_slice_buffer_destroy(&input);
- gpr_slice_buffer_destroy(&compressed);
- gpr_slice_buffer_destroy(&compressed_raw);
- gpr_slice_buffer_destroy(&output);
- gpr_slice_unref(final);
+ grpc_slice_buffer_destroy(&input);
+ grpc_slice_buffer_destroy(&compressed);
+ grpc_slice_buffer_destroy(&compressed_raw);
+ grpc_slice_buffer_destroy(&output);
+ grpc_slice_unref(final);
}
-static gpr_slice repeated(char c, size_t length) {
- gpr_slice out = gpr_slice_malloc(length);
+static grpc_slice repeated(char c, size_t length) {
+ grpc_slice out = grpc_slice_malloc(length);
memset(GPR_SLICE_START_PTR(out), c, length);
return out;
}
@@ -134,10 +134,10 @@ static compressability get_compressability(
return MAYBE_COMPRESSES;
}
-static gpr_slice create_test_value(test_value id) {
+static grpc_slice create_test_value(test_value id) {
switch (id) {
case ONE_A:
- return gpr_slice_from_copied_string("a");
+ return grpc_slice_from_copied_string("a");
case ONE_KB_A:
return repeated('a', 1024);
case ONE_MB_A:
@@ -146,17 +146,17 @@ static gpr_slice create_test_value(test_value id) {
abort();
break;
}
- return gpr_slice_from_copied_string("bad value");
+ return grpc_slice_from_copied_string("bad value");
}
static void test_tiny_data_compress(void) {
- gpr_slice_buffer input;
- gpr_slice_buffer output;
+ grpc_slice_buffer input;
+ grpc_slice_buffer output;
grpc_compression_algorithm i;
- gpr_slice_buffer_init(&input);
- gpr_slice_buffer_init(&output);
- gpr_slice_buffer_add(&input, create_test_value(ONE_A));
+ grpc_slice_buffer_init(&input);
+ grpc_slice_buffer_init(&output);
+ grpc_slice_buffer_add(&input, create_test_value(ONE_A));
for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
if (i == GRPC_COMPRESS_NONE) continue;
@@ -164,21 +164,21 @@ static void test_tiny_data_compress(void) {
GPR_ASSERT(1 == output.count);
}
- gpr_slice_buffer_destroy(&input);
- gpr_slice_buffer_destroy(&output);
+ grpc_slice_buffer_destroy(&input);
+ grpc_slice_buffer_destroy(&output);
}
static void test_bad_decompression_data_crc(void) {
- gpr_slice_buffer input;
- gpr_slice_buffer corrupted;
- gpr_slice_buffer output;
+ grpc_slice_buffer input;
+ grpc_slice_buffer corrupted;
+ grpc_slice_buffer output;
size_t idx;
const uint32_t bad = 0xdeadbeef;
- gpr_slice_buffer_init(&input);
- gpr_slice_buffer_init(&corrupted);
- gpr_slice_buffer_init(&output);
- gpr_slice_buffer_add(&input, create_test_value(ONE_MB_A));
+ grpc_slice_buffer_init(&input);
+ grpc_slice_buffer_init(&corrupted);
+ grpc_slice_buffer_init(&output);
+ grpc_slice_buffer_add(&input, create_test_value(ONE_MB_A));
/* compress it */
grpc_msg_compress(GRPC_COMPRESS_GZIP, &input, &corrupted);
@@ -191,54 +191,54 @@ static void test_bad_decompression_data_crc(void) {
/* try (and fail) to decompress the corrupted compresed buffer */
GPR_ASSERT(0 == grpc_msg_decompress(GRPC_COMPRESS_GZIP, &corrupted, &output));
- gpr_slice_buffer_destroy(&input);
- gpr_slice_buffer_destroy(&corrupted);
- gpr_slice_buffer_destroy(&output);
+ grpc_slice_buffer_destroy(&input);
+ grpc_slice_buffer_destroy(&corrupted);
+ grpc_slice_buffer_destroy(&output);
}
static void test_bad_decompression_data_trailing_garbage(void) {
- gpr_slice_buffer input;
- gpr_slice_buffer output;
+ grpc_slice_buffer input;
+ grpc_slice_buffer output;
- gpr_slice_buffer_init(&input);
- gpr_slice_buffer_init(&output);
+ grpc_slice_buffer_init(&input);
+ grpc_slice_buffer_init(&output);
/* append 0x99 to the end of an otherwise valid stream */
- gpr_slice_buffer_add(
- &input, gpr_slice_from_copied_buffer(
+ grpc_slice_buffer_add(
+ &input, grpc_slice_from_copied_buffer(
"\x78\xda\x63\x60\x60\x60\x00\x00\x00\x04\x00\x01\x99", 13));
/* try (and fail) to decompress the invalid compresed buffer */
GPR_ASSERT(0 == grpc_msg_decompress(GRPC_COMPRESS_DEFLATE, &input, &output));
- gpr_slice_buffer_destroy(&input);
- gpr_slice_buffer_destroy(&output);
+ grpc_slice_buffer_destroy(&input);
+ grpc_slice_buffer_destroy(&output);
}
static void test_bad_decompression_data_stream(void) {
- gpr_slice_buffer input;
- gpr_slice_buffer output;
+ grpc_slice_buffer input;
+ grpc_slice_buffer output;
- gpr_slice_buffer_init(&input);
- gpr_slice_buffer_init(&output);
- gpr_slice_buffer_add(&input,
- gpr_slice_from_copied_buffer("\x78\xda\xff\xff", 4));
+ grpc_slice_buffer_init(&input);
+ grpc_slice_buffer_init(&output);
+ grpc_slice_buffer_add(&input,
+ grpc_slice_from_copied_buffer("\x78\xda\xff\xff", 4));
/* try (and fail) to decompress the invalid compresed buffer */
GPR_ASSERT(0 == grpc_msg_decompress(GRPC_COMPRESS_DEFLATE, &input, &output));
- gpr_slice_buffer_destroy(&input);
- gpr_slice_buffer_destroy(&output);
+ grpc_slice_buffer_destroy(&input);
+ grpc_slice_buffer_destroy(&output);
}
static void test_bad_compression_algorithm(void) {
- gpr_slice_buffer input;
- gpr_slice_buffer output;
+ grpc_slice_buffer input;
+ grpc_slice_buffer output;
int was_compressed;
- gpr_slice_buffer_init(&input);
- gpr_slice_buffer_init(&output);
- gpr_slice_buffer_add(&input,
- gpr_slice_from_copied_string("Never gonna give you up"));
+ grpc_slice_buffer_init(&input);
+ grpc_slice_buffer_init(&output);
+ grpc_slice_buffer_add(&input,
+ grpc_slice_from_copied_string("Never gonna give you up"));
was_compressed =
grpc_msg_compress(GRPC_COMPRESS_ALGORITHMS_COUNT, &input, &output);
GPR_ASSERT(0 == was_compressed);
@@ -247,19 +247,19 @@ static void test_bad_compression_algorithm(void) {
grpc_msg_compress(GRPC_COMPRESS_ALGORITHMS_COUNT + 123, &input, &output);
GPR_ASSERT(0 == was_compressed);
- gpr_slice_buffer_destroy(&input);
- gpr_slice_buffer_destroy(&output);
+ grpc_slice_buffer_destroy(&input);
+ grpc_slice_buffer_destroy(&output);
}
static void test_bad_decompression_algorithm(void) {
- gpr_slice_buffer input;
- gpr_slice_buffer output;
+ grpc_slice_buffer input;
+ grpc_slice_buffer output;
int was_decompressed;
- gpr_slice_buffer_init(&input);
- gpr_slice_buffer_init(&output);
- gpr_slice_buffer_add(&input,
- gpr_slice_from_copied_string(
+ grpc_slice_buffer_init(&input);
+ grpc_slice_buffer_init(&output);
+ grpc_slice_buffer_add(&input,
+ grpc_slice_from_copied_string(
"I'm not really compressed but it doesn't matter"));
was_decompressed =
grpc_msg_decompress(GRPC_COMPRESS_ALGORITHMS_COUNT, &input, &output);
@@ -269,8 +269,8 @@ static void test_bad_decompression_algorithm(void) {
&input, &output);
GPR_ASSERT(0 == was_decompressed);
- gpr_slice_buffer_destroy(&input);
- gpr_slice_buffer_destroy(&output);
+ grpc_slice_buffer_destroy(&input);
+ grpc_slice_buffer_destroy(&output);
}
int main(int argc, char **argv) {
@@ -288,9 +288,9 @@ int main(int argc, char **argv) {
for (j = 0; j < GPR_ARRAY_SIZE(uncompressed_split_modes); j++) {
for (k = 0; k < GPR_ARRAY_SIZE(compressed_split_modes); k++) {
for (m = 0; m < TEST_VALUE_COUNT; m++) {
- gpr_slice slice = create_test_value(m);
+ grpc_slice slice = create_test_value(m);
assert_passthrough(slice, i, j, k, get_compressability(m, i));
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
}
}
diff --git a/test/core/end2end/bad_server_response_test.c b/test/core/end2end/bad_server_response_test.c
index 5ed0eb64d2..cb2030a7d7 100644
--- a/test/core/end2end/bad_server_response_test.c
+++ b/test/core/end2end/bad_server_response_test.c
@@ -82,8 +82,8 @@ struct rpc_state {
grpc_channel *channel;
grpc_call *call;
size_t incoming_data_length;
- gpr_slice_buffer temp_incoming_buffer;
- gpr_slice_buffer outgoing_buffer;
+ grpc_slice_buffer temp_incoming_buffer;
+ grpc_slice_buffer outgoing_buffer;
grpc_endpoint *tcp;
gpr_atm done_atm;
bool write_done;
@@ -105,11 +105,11 @@ static void done_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
}
static void handle_write(grpc_exec_ctx *exec_ctx) {
- gpr_slice slice = gpr_slice_from_copied_buffer(state.response_payload,
+ grpc_slice slice = grpc_slice_from_copied_buffer(state.response_payload,
state.response_payload_length);
- gpr_slice_buffer_reset_and_unref(&state.outgoing_buffer);
- gpr_slice_buffer_add(&state.outgoing_buffer, slice);
+ grpc_slice_buffer_reset_and_unref(&state.outgoing_buffer);
+ grpc_slice_buffer_add(&state.outgoing_buffer, slice);
grpc_endpoint_write(exec_ctx, state.tcp, &state.outgoing_buffer, &on_write);
}
@@ -141,8 +141,8 @@ static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp,
test_tcp_server *server = arg;
grpc_closure_init(&on_read, handle_read, NULL);
grpc_closure_init(&on_write, done_write, NULL);
- gpr_slice_buffer_init(&state.temp_incoming_buffer);
- gpr_slice_buffer_init(&state.outgoing_buffer);
+ grpc_slice_buffer_init(&state.temp_incoming_buffer);
+ grpc_slice_buffer_init(&state.outgoing_buffer);
state.tcp = tcp;
state.incoming_data_length = 0;
grpc_endpoint_add_to_pollset(exec_ctx, tcp, server->pollset);
@@ -221,8 +221,8 @@ static void start_rpc(int target_port, grpc_status_code expected_status,
static void cleanup_rpc(void) {
grpc_event ev;
- gpr_slice_buffer_destroy(&state.temp_incoming_buffer);
- gpr_slice_buffer_destroy(&state.outgoing_buffer);
+ grpc_slice_buffer_destroy(&state.temp_incoming_buffer);
+ grpc_slice_buffer_destroy(&state.outgoing_buffer);
grpc_call_destroy(state.call);
grpc_completion_queue_shutdown(state.cq);
do {
diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c
index 3e7e3f22a2..3b9aa24368 100644
--- a/test/core/end2end/cq_verifier.c
+++ b/test/core/end2end/cq_verifier.c
@@ -105,17 +105,17 @@ int contains_metadata(grpc_metadata_array *array, const char *key,
return has_metadata(array->metadata, array->count, key, value);
}
-static gpr_slice merge_slices(gpr_slice *slices, size_t nslices) {
+static grpc_slice merge_slices(grpc_slice *slices, size_t nslices) {
size_t i;
size_t len = 0;
uint8_t *cursor;
- gpr_slice out;
+ grpc_slice out;
for (i = 0; i < nslices; i++) {
len += GPR_SLICE_LENGTH(slices[i]);
}
- out = gpr_slice_malloc(len);
+ out = grpc_slice_malloc(len);
cursor = GPR_SLICE_START_PTR(out);
for (i = 0; i < nslices; i++) {
@@ -126,8 +126,8 @@ static gpr_slice merge_slices(gpr_slice *slices, size_t nslices) {
return out;
}
-int raw_byte_buffer_eq_slice(grpc_byte_buffer *rbb, gpr_slice b) {
- gpr_slice a;
+int raw_byte_buffer_eq_slice(grpc_byte_buffer *rbb, grpc_slice b) {
+ grpc_slice a;
int ok;
if (!rbb) return 0;
@@ -137,12 +137,12 @@ int raw_byte_buffer_eq_slice(grpc_byte_buffer *rbb, gpr_slice b) {
ok = GPR_SLICE_LENGTH(a) == GPR_SLICE_LENGTH(b) &&
0 == memcmp(GPR_SLICE_START_PTR(a), GPR_SLICE_START_PTR(b),
GPR_SLICE_LENGTH(a));
- gpr_slice_unref(a);
- gpr_slice_unref(b);
+ grpc_slice_unref(a);
+ grpc_slice_unref(b);
return ok;
}
-int byte_buffer_eq_slice(grpc_byte_buffer *bb, gpr_slice b) {
+int byte_buffer_eq_slice(grpc_byte_buffer *bb, grpc_slice b) {
grpc_byte_buffer_reader reader;
grpc_byte_buffer *rbb;
int res;
@@ -165,7 +165,7 @@ int byte_buffer_eq_string(grpc_byte_buffer *bb, const char *str) {
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, bb) &&
"Couldn't init byte buffer reader");
rbb = grpc_raw_byte_buffer_from_reader(&reader);
- res = raw_byte_buffer_eq_slice(rbb, gpr_slice_from_copied_string(str));
+ res = raw_byte_buffer_eq_slice(rbb, grpc_slice_from_copied_string(str));
grpc_byte_buffer_reader_destroy(&reader);
grpc_byte_buffer_destroy(rbb);
diff --git a/test/core/end2end/cq_verifier.h b/test/core/end2end/cq_verifier.h
index 47464fa319..b754de9bbe 100644
--- a/test/core/end2end/cq_verifier.h
+++ b/test/core/end2end/cq_verifier.h
@@ -67,7 +67,7 @@ void cq_expect_completion(cq_verifier *v, const char *file, int line, void *tag,
#define CQ_EXPECT_COMPLETION(v, tag, success) \
cq_expect_completion(v, __FILE__, __LINE__, tag, success)
-int byte_buffer_eq_slice(grpc_byte_buffer *bb, gpr_slice b);
+int byte_buffer_eq_slice(grpc_byte_buffer *bb, grpc_slice b);
int byte_buffer_eq_string(grpc_byte_buffer *byte_buffer, const char *string);
int contains_metadata(grpc_metadata_array *array, const char *key,
const char *value);
diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c
index cb07ca535b..5860257607 100644
--- a/test/core/end2end/dualstack_socket_test.c
+++ b/test/core/end2end/dualstack_socket_test.c
@@ -120,14 +120,14 @@ void test_connect(const char *server_host, const char *client_host, int port,
if (client_host[0] == 'i') {
/* for ipv4:/ipv6: addresses, concatenate the port to each of the parts */
size_t i;
- gpr_slice uri_slice;
- gpr_slice_buffer uri_parts;
+ grpc_slice uri_slice;
+ grpc_slice_buffer uri_parts;
char **hosts_with_port;
uri_slice =
- gpr_slice_new((char *)client_host, strlen(client_host), do_nothing);
- gpr_slice_buffer_init(&uri_parts);
- gpr_slice_split(uri_slice, ",", &uri_parts);
+ grpc_slice_new((char *)client_host, strlen(client_host), do_nothing);
+ grpc_slice_buffer_init(&uri_parts);
+ grpc_slice_split(uri_slice, ",", &uri_parts);
hosts_with_port = gpr_malloc(sizeof(char *) * uri_parts.count);
for (i = 0; i < uri_parts.count; i++) {
char *uri_part_str = gpr_dump_slice(uri_parts.slices[i], GPR_DUMP_ASCII);
@@ -140,8 +140,8 @@ void test_connect(const char *server_host, const char *client_host, int port,
gpr_free(hosts_with_port[i]);
}
gpr_free(hosts_with_port);
- gpr_slice_buffer_destroy(&uri_parts);
- gpr_slice_unref(uri_slice);
+ grpc_slice_buffer_destroy(&uri_parts);
+ grpc_slice_unref(uri_slice);
} else {
gpr_join_host_port(&client_hostport, client_host, port);
}
diff --git a/test/core/end2end/fake_resolver.c b/test/core/end2end/fake_resolver.c
index 5669ce51e8..4687e52313 100644
--- a/test/core/end2end/fake_resolver.c
+++ b/test/core/end2end/fake_resolver.c
@@ -163,11 +163,11 @@ static grpc_resolver* fake_resolver_create(grpc_resolver_factory* factory,
const bool lb_enabled =
lb_enabled_qpart != NULL && strcmp("0", lb_enabled_qpart) != 0;
// Construct addresses.
- gpr_slice path_slice =
- gpr_slice_new(args->uri->path, strlen(args->uri->path), do_nothing);
- gpr_slice_buffer path_parts;
- gpr_slice_buffer_init(&path_parts);
- gpr_slice_split(path_slice, ",", &path_parts);
+ grpc_slice path_slice =
+ grpc_slice_new(args->uri->path, strlen(args->uri->path), do_nothing);
+ grpc_slice_buffer path_parts;
+ grpc_slice_buffer_init(&path_parts);
+ grpc_slice_split(path_slice, ",", &path_parts);
grpc_lb_addresses* addresses = grpc_lb_addresses_create(path_parts.count);
bool errors_found = false;
for (size_t i = 0; i < addresses->num_addresses; i++) {
@@ -184,8 +184,8 @@ static grpc_resolver* fake_resolver_create(grpc_resolver_factory* factory,
addresses->addresses[i].is_balancer = lb_enabled;
if (errors_found) break;
}
- gpr_slice_buffer_destroy(&path_parts);
- gpr_slice_unref(path_slice);
+ grpc_slice_buffer_destroy(&path_parts);
+ grpc_slice_unref(path_slice);
if (errors_found) {
grpc_lb_addresses_destroy(addresses, NULL /* user_data_destroy */);
return NULL;
diff --git a/test/core/end2end/fixtures/http_proxy.c b/test/core/end2end/fixtures/http_proxy.c
index bc24cb33cf..88c77a5168 100644
--- a/test/core/end2end/fixtures/http_proxy.c
+++ b/test/core/end2end/fixtures/http_proxy.c
@@ -89,12 +89,12 @@ typedef struct proxy_connection {
grpc_closure on_server_read_done;
grpc_closure on_server_write_done;
- gpr_slice_buffer client_read_buffer;
- gpr_slice_buffer client_deferred_write_buffer;
- gpr_slice_buffer client_write_buffer;
- gpr_slice_buffer server_read_buffer;
- gpr_slice_buffer server_deferred_write_buffer;
- gpr_slice_buffer server_write_buffer;
+ grpc_slice_buffer client_read_buffer;
+ grpc_slice_buffer client_deferred_write_buffer;
+ grpc_slice_buffer client_write_buffer;
+ grpc_slice_buffer server_read_buffer;
+ grpc_slice_buffer server_deferred_write_buffer;
+ grpc_slice_buffer server_write_buffer;
grpc_http_parser http_parser;
grpc_http_request http_request;
@@ -108,12 +108,12 @@ static void proxy_connection_unref(grpc_exec_ctx* exec_ctx,
if (conn->server_endpoint != NULL)
grpc_endpoint_destroy(exec_ctx, conn->server_endpoint);
grpc_pollset_set_destroy(conn->pollset_set);
- gpr_slice_buffer_destroy(&conn->client_read_buffer);
- gpr_slice_buffer_destroy(&conn->client_deferred_write_buffer);
- gpr_slice_buffer_destroy(&conn->client_write_buffer);
- gpr_slice_buffer_destroy(&conn->server_read_buffer);
- gpr_slice_buffer_destroy(&conn->server_deferred_write_buffer);
- gpr_slice_buffer_destroy(&conn->server_write_buffer);
+ grpc_slice_buffer_destroy(&conn->client_read_buffer);
+ grpc_slice_buffer_destroy(&conn->client_deferred_write_buffer);
+ grpc_slice_buffer_destroy(&conn->client_write_buffer);
+ grpc_slice_buffer_destroy(&conn->server_read_buffer);
+ grpc_slice_buffer_destroy(&conn->server_deferred_write_buffer);
+ grpc_slice_buffer_destroy(&conn->server_write_buffer);
grpc_http_parser_destroy(&conn->http_parser);
grpc_http_request_destroy(&conn->http_request);
gpr_free(conn);
@@ -144,11 +144,11 @@ static void on_client_write_done(grpc_exec_ctx* exec_ctx, void* arg,
return;
}
// Clear write buffer (the data we just wrote).
- gpr_slice_buffer_reset_and_unref(&conn->client_write_buffer);
+ grpc_slice_buffer_reset_and_unref(&conn->client_write_buffer);
// If more data was read from the server since we started this write,
// write that data now.
if (conn->client_deferred_write_buffer.length > 0) {
- gpr_slice_buffer_move_into(&conn->client_deferred_write_buffer,
+ grpc_slice_buffer_move_into(&conn->client_deferred_write_buffer,
&conn->client_write_buffer);
grpc_endpoint_write(exec_ctx, conn->client_endpoint,
&conn->client_write_buffer,
@@ -169,11 +169,11 @@ static void on_server_write_done(grpc_exec_ctx* exec_ctx, void* arg,
return;
}
// Clear write buffer (the data we just wrote).
- gpr_slice_buffer_reset_and_unref(&conn->server_write_buffer);
+ grpc_slice_buffer_reset_and_unref(&conn->server_write_buffer);
// If more data was read from the client since we started this write,
// write that data now.
if (conn->server_deferred_write_buffer.length > 0) {
- gpr_slice_buffer_move_into(&conn->server_deferred_write_buffer,
+ grpc_slice_buffer_move_into(&conn->server_deferred_write_buffer,
&conn->server_write_buffer);
grpc_endpoint_write(exec_ctx, conn->server_endpoint,
&conn->server_write_buffer,
@@ -201,10 +201,10 @@ static void on_client_read_done(grpc_exec_ctx* exec_ctx, void* arg,
//
// Otherwise, move the read data into the write buffer and write it.
if (conn->server_write_buffer.length > 0) {
- gpr_slice_buffer_move_into(&conn->client_read_buffer,
+ grpc_slice_buffer_move_into(&conn->client_read_buffer,
&conn->server_deferred_write_buffer);
} else {
- gpr_slice_buffer_move_into(&conn->client_read_buffer,
+ grpc_slice_buffer_move_into(&conn->client_read_buffer,
&conn->server_write_buffer);
gpr_ref(&conn->refcount);
grpc_endpoint_write(exec_ctx, conn->server_endpoint,
@@ -233,10 +233,10 @@ static void on_server_read_done(grpc_exec_ctx* exec_ctx, void* arg,
//
// Otherwise, move the read data into the write buffer and write it.
if (conn->client_write_buffer.length > 0) {
- gpr_slice_buffer_move_into(&conn->server_read_buffer,
+ grpc_slice_buffer_move_into(&conn->server_read_buffer,
&conn->client_deferred_write_buffer);
} else {
- gpr_slice_buffer_move_into(&conn->server_read_buffer,
+ grpc_slice_buffer_move_into(&conn->server_read_buffer,
&conn->client_write_buffer);
gpr_ref(&conn->refcount);
grpc_endpoint_write(exec_ctx, conn->client_endpoint,
@@ -258,7 +258,7 @@ static void on_write_response_done(grpc_exec_ctx* exec_ctx, void* arg,
return;
}
// Clear write buffer.
- gpr_slice_buffer_reset_and_unref(&conn->client_write_buffer);
+ grpc_slice_buffer_reset_and_unref(&conn->client_write_buffer);
// Start reading from both client and server. One of the read
// requests inherits our ref to conn, but we need to take a new ref
// for the other one.
@@ -287,9 +287,9 @@ static void on_server_connect_done(grpc_exec_ctx* exec_ctx, void* arg,
// We've established a connection, so send back a 200 response code to
// the client.
// The write callback inherits our reference to conn.
- gpr_slice slice =
- gpr_slice_from_copied_string("HTTP/1.0 200 connected\r\n\r\n");
- gpr_slice_buffer_add(&conn->client_write_buffer, slice);
+ grpc_slice slice =
+ grpc_slice_from_copied_string("HTTP/1.0 200 connected\r\n\r\n");
+ grpc_slice_buffer_add(&conn->client_write_buffer, slice);
grpc_endpoint_write(exec_ctx, conn->client_endpoint,
&conn->client_write_buffer,
&conn->on_write_response_done);
@@ -322,7 +322,7 @@ static void on_read_request_done(grpc_exec_ctx* exec_ctx, void* arg,
}
}
}
- gpr_slice_buffer_reset_and_unref(&conn->client_read_buffer);
+ grpc_slice_buffer_reset_and_unref(&conn->client_read_buffer);
// If we're not done reading the request, read more data.
if (conn->http_parser.state != GRPC_HTTP_BODY) {
grpc_endpoint_read(exec_ctx, conn->client_endpoint,
@@ -383,12 +383,12 @@ static void on_accept(grpc_exec_ctx* exec_ctx, void* arg,
grpc_closure_init(&conn->on_client_write_done, on_client_write_done, conn);
grpc_closure_init(&conn->on_server_read_done, on_server_read_done, conn);
grpc_closure_init(&conn->on_server_write_done, on_server_write_done, conn);
- gpr_slice_buffer_init(&conn->client_read_buffer);
- gpr_slice_buffer_init(&conn->client_deferred_write_buffer);
- gpr_slice_buffer_init(&conn->client_write_buffer);
- gpr_slice_buffer_init(&conn->server_read_buffer);
- gpr_slice_buffer_init(&conn->server_deferred_write_buffer);
- gpr_slice_buffer_init(&conn->server_write_buffer);
+ grpc_slice_buffer_init(&conn->client_read_buffer);
+ grpc_slice_buffer_init(&conn->client_deferred_write_buffer);
+ grpc_slice_buffer_init(&conn->client_write_buffer);
+ grpc_slice_buffer_init(&conn->server_read_buffer);
+ grpc_slice_buffer_init(&conn->server_deferred_write_buffer);
+ grpc_slice_buffer_init(&conn->server_write_buffer);
grpc_http_parser_init(&conn->http_parser, GRPC_HTTP_REQUEST,
&conn->http_request);
grpc_endpoint_read(exec_ctx, conn->client_endpoint, &conn->client_read_buffer,
diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c
index 945cc960e9..210a863f48 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.c
+++ b/test/core/end2end/fuzzers/api_fuzzer.c
@@ -137,10 +137,10 @@ static uint32_t read_uint32(input_stream *inp) {
}
static grpc_byte_buffer *read_message(input_stream *inp) {
- gpr_slice slice = gpr_slice_malloc(read_uint22(inp));
+ grpc_slice slice = grpc_slice_malloc(read_uint22(inp));
memset(GPR_SLICE_START_PTR(slice), 0, GPR_SLICE_LENGTH(slice));
grpc_byte_buffer *out = grpc_raw_byte_buffer_create(&slice, 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return out;
}
diff --git a/test/core/end2end/fuzzers/client_fuzzer.c b/test/core/end2end/fuzzers/client_fuzzer.c
index d104fe55e5..c5260cd287 100644
--- a/test/core/end2end/fuzzers/client_fuzzer.c
+++ b/test/core/end2end/fuzzers/client_fuzzer.c
@@ -44,7 +44,7 @@
bool squelch = true;
bool leak_check = true;
-static void discard_write(gpr_slice slice) {}
+static void discard_write(grpc_slice slice) {}
static void *tag(int n) { return (void *)(uintptr_t)n; }
@@ -121,7 +121,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_mock_endpoint_put_read(
&exec_ctx, mock_endpoint,
- gpr_slice_from_copied_buffer((const char *)data, size));
+ grpc_slice_from_copied_buffer((const char *)data, size));
grpc_event ev;
while (1) {
diff --git a/test/core/end2end/fuzzers/server_fuzzer.c b/test/core/end2end/fuzzers/server_fuzzer.c
index ae4c8e658d..164022ec79 100644
--- a/test/core/end2end/fuzzers/server_fuzzer.c
+++ b/test/core/end2end/fuzzers/server_fuzzer.c
@@ -41,7 +41,7 @@
bool squelch = true;
bool leak_check = true;
-static void discard_write(gpr_slice slice) {}
+static void discard_write(grpc_slice slice) {}
static void *tag(int n) { return (void *)(uintptr_t)n; }
static int detag(void *p) { return (int)(uintptr_t)p; }
@@ -63,7 +63,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_resource_quota_internal_unref(&exec_ctx, resource_quota);
grpc_mock_endpoint_put_read(
&exec_ctx, mock_endpoint,
- gpr_slice_from_copied_buffer((const char *)data, size));
+ grpc_slice_from_copied_buffer((const char *)data, size));
grpc_server *server = grpc_server_create(NULL, NULL);
grpc_completion_queue *cq = grpc_completion_queue_create(NULL);
diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c
index 2b9904a244..6cc7d28489 100644
--- a/test/core/end2end/invalid_call_argument_test.c
+++ b/test/core/end2end/invalid_call_argument_test.c
@@ -251,7 +251,7 @@ static void test_send_messages_at_the_same_time() {
gpr_log(GPR_INFO, "test_send_messages_at_the_same_time");
grpc_op *op;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
prepare_test(1);
diff --git a/test/core/end2end/tests/binary_metadata.c b/test/core/end2end/tests/binary_metadata.c
index 73b0f17c24..317ca3110b 100644
--- a/test/core/end2end/tests/binary_metadata.c
+++ b/test/core/end2end/tests/binary_metadata.c
@@ -100,8 +100,8 @@ static void test_request_response_with_metadata_and_payload(
grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
- gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
+ grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =
diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c
index 99c5d94e39..8f8b7d5119 100644
--- a/test/core/end2end/tests/call_creds.c
+++ b/test/core/end2end/tests/call_creds.c
@@ -135,8 +135,8 @@ static void request_response_with_payload_and_call_creds(
override_mode mode) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
- gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
+ grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =
@@ -389,7 +389,7 @@ static void test_request_with_server_rejecting_client_creds(
char *details = NULL;
size_t details_capacity = 0;
grpc_byte_buffer *response_payload_recv = NULL;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_call_credentials *creds;
diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c
index 9f49815527..4bf55c8725 100644
--- a/test/core/end2end/tests/cancel_after_accept.c
+++ b/test/core/end2end/tests/cancel_after_accept.c
@@ -118,8 +118,8 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
size_t details_capacity = 0;
grpc_byte_buffer *request_payload_recv = NULL;
grpc_byte_buffer *response_payload_recv = NULL;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
- gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
+ grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =
diff --git a/test/core/end2end/tests/cancel_after_client_done.c b/test/core/end2end/tests/cancel_after_client_done.c
index f61a404b2d..afb17b0719 100644
--- a/test/core/end2end/tests/cancel_after_client_done.c
+++ b/test/core/end2end/tests/cancel_after_client_done.c
@@ -117,8 +117,8 @@ static void test_cancel_after_accept_and_writes_closed(
size_t details_capacity = 0;
grpc_byte_buffer *request_payload_recv = NULL;
grpc_byte_buffer *response_payload_recv = NULL;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
- gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
+ grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =
diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c
index c31582bf2e..fe0e0d689c 100644
--- a/test/core/end2end/tests/cancel_after_invoke.c
+++ b/test/core/end2end/tests/cancel_after_invoke.c
@@ -116,7 +116,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
char *details = NULL;
size_t details_capacity = 0;
grpc_byte_buffer *response_payload_recv = NULL;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c
index 5dcd44e7b4..3a0b83c4d2 100644
--- a/test/core/end2end/tests/cancel_before_invoke.c
+++ b/test/core/end2end/tests/cancel_before_invoke.c
@@ -114,7 +114,7 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config,
char *details = NULL;
size_t details_capacity = 0;
grpc_byte_buffer *response_payload_recv = NULL;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c
index f598a3812b..92788dd8fa 100644
--- a/test/core/end2end/tests/compressed_payload.c
+++ b/test/core/end2end/tests/compressed_payload.c
@@ -110,7 +110,7 @@ static void request_for_disabled_algorithm(
grpc_status_code expected_error, grpc_metadata *client_metadata) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice;
+ grpc_slice request_payload_slice;
grpc_byte_buffer *request_payload;
gpr_timespec deadline = five_seconds_time();
grpc_channel_args *client_args;
@@ -133,7 +133,7 @@ static void request_for_disabled_algorithm(
memset(str, 'x', 1023);
str[1023] = '\0';
- request_payload_slice = gpr_slice_from_copied_string(str);
+ request_payload_slice = grpc_slice_from_copied_string(str);
request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
client_args = grpc_channel_args_set_compression_algorithm(
@@ -255,7 +255,7 @@ static void request_for_disabled_algorithm(
cq_verifier_destroy(cqv);
- gpr_slice_unref(request_payload_slice);
+ grpc_slice_unref(request_payload_slice);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(request_payload_recv);
@@ -277,7 +277,7 @@ static void request_with_payload_template(
grpc_compression_level server_compression_level) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice;
+ grpc_slice request_payload_slice;
grpc_byte_buffer *request_payload;
gpr_timespec deadline = five_seconds_time();
grpc_channel_args *client_args;
@@ -307,8 +307,8 @@ static void request_with_payload_template(
memset(response_str, 'y', 1023);
response_str[1023] = '\0';
- request_payload_slice = gpr_slice_from_copied_string(request_str);
- gpr_slice response_payload_slice = gpr_slice_from_copied_string(response_str);
+ request_payload_slice = grpc_slice_from_copied_string(request_str);
+ grpc_slice response_payload_slice = grpc_slice_from_copied_string(response_str);
client_args = grpc_channel_args_set_compression_algorithm(
NULL, default_client_channel_compression_algorithm);
@@ -458,8 +458,8 @@ static void request_with_payload_template(
grpc_byte_buffer_destroy(response_payload_recv);
}
- gpr_slice_unref(request_payload_slice);
- gpr_slice_unref(response_payload_slice);
+ grpc_slice_unref(request_payload_slice);
+ grpc_slice_unref(response_payload_slice);
memset(ops, 0, sizeof(ops));
op = ops;
diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.c
index 0e5692f4c9..36f98694b6 100644
--- a/test/core/end2end/tests/filter_call_init_fails.c
+++ b/test/core/end2end/tests/filter_call_init_fails.c
@@ -108,7 +108,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test_request(grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c
index d5eddc7330..66449558c7 100644
--- a/test/core/end2end/tests/filter_causes_close.c
+++ b/test/core/end2end/tests/filter_causes_close.c
@@ -104,7 +104,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test_request(grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
@@ -207,8 +207,8 @@ static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg,
call_data *calld = elem->call_data;
if (error == GRPC_ERROR_NONE) {
// close the stream with an error.
- gpr_slice message =
- gpr_slice_from_copied_string("Failure that's not preventable.");
+ grpc_slice message =
+ grpc_slice_from_copied_string("Failure that's not preventable.");
grpc_transport_stream_op *op = grpc_make_transport_stream_op(NULL);
grpc_transport_stream_op_add_close(op, GRPC_STATUS_PERMISSION_DENIED,
&message);
diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c
index 3820504e11..0a4d87c2fb 100644
--- a/test/core/end2end/tests/invoke_large_request.c
+++ b/test/core/end2end/tests/invoke_large_request.c
@@ -94,8 +94,8 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_destroy(f->cq);
}
-static gpr_slice large_slice(void) {
- gpr_slice slice = gpr_slice_malloc(1000000);
+static grpc_slice large_slice(void) {
+ grpc_slice slice = grpc_slice_malloc(1000000);
memset(GPR_SLICE_START_PTR(slice), 'x', GPR_SLICE_LENGTH(slice));
return slice;
}
@@ -120,8 +120,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config,
begin_test(config, name, &channel_args, &channel_args);
gpr_free(name);
- gpr_slice request_payload_slice = large_slice();
- gpr_slice response_payload_slice = large_slice();
+ grpc_slice request_payload_slice = large_slice();
+ grpc_slice response_payload_slice = large_slice();
grpc_call *c;
grpc_call *s;
grpc_byte_buffer *request_payload =
@@ -262,8 +262,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config,
grpc_byte_buffer_destroy(response_payload);
grpc_byte_buffer_destroy(request_payload_recv);
grpc_byte_buffer_destroy(response_payload_recv);
- gpr_slice_unref(request_payload_slice);
- gpr_slice_unref(response_payload_slice);
+ grpc_slice_unref(request_payload_slice);
+ grpc_slice_unref(response_payload_slice);
end_test(&f);
config.tear_down_data(&f);
diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c
index 6107836b12..29dcafb985 100644
--- a/test/core/end2end/tests/large_metadata.c
+++ b/test/core/end2end/tests/large_metadata.c
@@ -99,7 +99,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test_request_with_large_metadata(grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c
index 0915730a02..1dba200c02 100644
--- a/test/core/end2end/tests/load_reporting_hook.c
+++ b/test/core/end2end/tests/load_reporting_hook.c
@@ -127,8 +127,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f,
const char *response_msg,
grpc_metadata *initial_lr_metadata,
grpc_metadata *trailing_lr_metadata) {
- gpr_slice request_payload_slice = gpr_slice_from_static_string(request_msg);
- gpr_slice response_payload_slice = gpr_slice_from_static_string(response_msg);
+ grpc_slice request_payload_slice = grpc_slice_from_static_string(request_msg);
+ grpc_slice response_payload_slice = grpc_slice_from_static_string(response_msg);
grpc_call *c;
grpc_call *s;
grpc_byte_buffer *request_payload =
diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c
index 449a581d23..cdf52f9838 100644
--- a/test/core/end2end/tests/max_message_length.c
+++ b/test/core/end2end/tests/max_message_length.c
@@ -116,7 +116,7 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config,
cq_verifier *cqv;
grpc_op ops[6];
grpc_op *op;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *recv_payload = NULL;
@@ -277,8 +277,8 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config,
cq_verifier *cqv;
grpc_op ops[6];
grpc_op *op;
- gpr_slice response_payload_slice =
- gpr_slice_from_copied_string("hello world");
+ grpc_slice response_payload_slice =
+ grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *response_payload =
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
grpc_byte_buffer *recv_payload = NULL;
diff --git a/test/core/end2end/tests/network_status_change.c b/test/core/end2end/tests/network_status_change.c
index fa711bb0b6..e9528ff105 100644
--- a/test/core/end2end/tests/network_status_change.c
+++ b/test/core/end2end/tests/network_status_change.c
@@ -102,7 +102,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test_invoke_network_status_change(grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c
index 8353ea32fd..5a19950726 100644
--- a/test/core/end2end/tests/payload.c
+++ b/test/core/end2end/tests/payload.c
@@ -95,8 +95,8 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_destroy(f->cq);
}
-/* Creates and returns a gpr_slice containing random alphanumeric characters. */
-static gpr_slice generate_random_slice() {
+/* Creates and returns a grpc_slice containing random alphanumeric characters. */
+static grpc_slice generate_random_slice() {
size_t i;
static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
char *output;
@@ -106,7 +106,7 @@ static gpr_slice generate_random_slice() {
output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
}
output[output_size - 1] = '\0';
- gpr_slice out = gpr_slice_from_copied_string(output);
+ grpc_slice out = grpc_slice_from_copied_string(output);
gpr_free(output);
return out;
}
@@ -115,8 +115,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
/* Create large request and response bodies. These are big enough to require
* multiple round trips to deliver to the peer, and their exact contents of
* will be verified on completion. */
- gpr_slice request_payload_slice = generate_random_slice();
- gpr_slice response_payload_slice = generate_random_slice();
+ grpc_slice request_payload_slice = generate_random_slice();
+ grpc_slice response_payload_slice = generate_random_slice();
grpc_call *c;
grpc_call *s;
diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c
index 30ea80043b..3398a9cff7 100644
--- a/test/core/end2end/tests/ping_pong_streaming.c
+++ b/test/core/end2end/tests/ping_pong_streaming.c
@@ -120,8 +120,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
grpc_byte_buffer *response_payload;
grpc_byte_buffer *response_payload_recv;
int i;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
- gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
+ grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
"/foo", "foo.test.google.fr:1234", deadline,
@@ -228,8 +228,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
grpc_byte_buffer_destroy(response_payload_recv);
}
- gpr_slice_unref(request_payload_slice);
- gpr_slice_unref(response_payload_slice);
+ grpc_slice_unref(request_payload_slice);
+ grpc_slice_unref(response_payload_slice);
memset(ops, 0, sizeof(ops));
op = ops;
diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c
index 69ad69af66..a37fc645b4 100644
--- a/test/core/end2end/tests/request_with_flags.c
+++ b/test/core/end2end/tests/request_with_flags.c
@@ -100,7 +100,7 @@ static void test_invoke_request_with_flags(
grpc_end2end_test_config config, uint32_t *flags_for_op,
grpc_call_error call_start_batch_expected_result) {
grpc_call *c;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c
index 56ff83cdb4..3e2bbb3b0e 100644
--- a/test/core/end2end/tests/request_with_payload.c
+++ b/test/core/end2end/tests/request_with_payload.c
@@ -99,7 +99,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c
index 6170444373..280bad5749 100644
--- a/test/core/end2end/tests/resource_quota_server.c
+++ b/test/core/end2end/tests/resource_quota_server.c
@@ -95,8 +95,8 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_destroy(f->cq);
}
-/* Creates and returns a gpr_slice containing random alphanumeric characters. */
-static gpr_slice generate_random_slice() {
+/* Creates and returns a grpc_slice containing random alphanumeric characters. */
+static grpc_slice generate_random_slice() {
size_t i;
static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
char output[1024 * 1024];
@@ -104,7 +104,7 @@ static gpr_slice generate_random_slice() {
output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
}
output[GPR_ARRAY_SIZE(output) - 1] = '\0';
- return gpr_slice_from_copied_string(output);
+ return grpc_slice_from_copied_string(output);
}
void resource_quota_server(grpc_end2end_test_config config) {
@@ -131,7 +131,7 @@ void resource_quota_server(grpc_end2end_test_config config) {
/* Create large request and response bodies. These are big enough to require
* multiple round trips to deliver to the peer, and their exact contents of
* will be verified on completion. */
- gpr_slice request_payload_slice = generate_random_slice();
+ grpc_slice request_payload_slice = generate_random_slice();
grpc_call *client_calls[NUM_CALLS];
grpc_call *server_calls[NUM_CALLS];
@@ -349,7 +349,7 @@ void resource_quota_server(grpc_end2end_test_config config) {
GPR_ASSERT(cancelled_calls_on_server >= 0.9 * cancelled_calls_on_client);
grpc_byte_buffer_destroy(request_payload);
- gpr_slice_unref(request_payload_slice);
+ grpc_slice_unref(request_payload_slice);
grpc_resource_quota_unref(resource_quota);
end_test(&f);
diff --git a/test/core/end2end/tests/simple_cacheable_request.c b/test/core/end2end/tests/simple_cacheable_request.c
index 29ba41bd8b..40dd3983e1 100644
--- a/test/core/end2end/tests/simple_cacheable_request.c
+++ b/test/core/end2end/tests/simple_cacheable_request.c
@@ -102,8 +102,8 @@ static void test_cacheable_request_response_with_metadata_and_payload(
grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
- gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
+ grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =
diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.c
index 304af9c3fa..1ac9dc8210 100644
--- a/test/core/end2end/tests/simple_metadata.c
+++ b/test/core/end2end/tests/simple_metadata.c
@@ -100,8 +100,8 @@ static void test_request_response_with_metadata_and_payload(
grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
- gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
+ grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =
diff --git a/test/core/end2end/tests/streaming_error_response.c b/test/core/end2end/tests/streaming_error_response.c
index fe63c6f7bb..efd41c508c 100644
--- a/test/core/end2end/tests/streaming_error_response.c
+++ b/test/core/end2end/tests/streaming_error_response.c
@@ -101,10 +101,10 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test(grpc_end2end_test_config config, bool request_status_early) {
grpc_call *c;
grpc_call *s;
- gpr_slice response_payload1_slice = gpr_slice_from_copied_string("hello");
+ grpc_slice response_payload1_slice = grpc_slice_from_copied_string("hello");
grpc_byte_buffer *response_payload1 =
grpc_raw_byte_buffer_create(&response_payload1_slice, 1);
- gpr_slice response_payload2_slice = gpr_slice_from_copied_string("world");
+ grpc_slice response_payload2_slice = grpc_slice_from_copied_string("world");
grpc_byte_buffer *response_payload2 =
grpc_raw_byte_buffer_create(&response_payload2_slice, 1);
gpr_timespec deadline = five_seconds_time();
diff --git a/test/core/end2end/tests/trailing_metadata.c b/test/core/end2end/tests/trailing_metadata.c
index e6bfc7c9f1..0bbf0879cc 100644
--- a/test/core/end2end/tests/trailing_metadata.c
+++ b/test/core/end2end/tests/trailing_metadata.c
@@ -100,8 +100,8 @@ static void test_request_response_with_metadata_and_payload(
grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
- gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
+ grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =
diff --git a/test/core/fling/client.c b/test/core/fling/client.c
index bcc195a92f..e717b7f7fe 100644
--- a/test/core/fling/client.c
+++ b/test/core/fling/client.c
@@ -155,7 +155,7 @@ static const scenario scenarios[] = {
};
int main(int argc, char **argv) {
- gpr_slice slice = gpr_slice_from_copied_string("x");
+ grpc_slice slice = grpc_slice_from_copied_string("x");
double start, stop;
unsigned i;
@@ -241,7 +241,7 @@ int main(int argc, char **argv) {
} while (event.type != GRPC_QUEUE_SHUTDOWN);
grpc_completion_queue_destroy(cq);
grpc_byte_buffer_destroy(the_buffer);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
gpr_log(GPR_INFO, "latency (50/95/99/99.9): %f/%f/%f/%f",
gpr_histogram_percentile(histogram, 50),
diff --git a/test/core/http/format_request_test.c b/test/core/http/format_request_test.c
index 0d21e1200b..bd31e5e8ab 100644
--- a/test/core/http/format_request_test.c
+++ b/test/core/http/format_request_test.c
@@ -41,7 +41,7 @@
static void test_format_get_request(void) {
grpc_http_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req;
- gpr_slice slice;
+ grpc_slice slice;
memset(&req, 0, sizeof(req));
req.host = "example.com";
@@ -51,7 +51,7 @@ static void test_format_get_request(void) {
slice = grpc_httpcli_format_get_request(&req);
- GPR_ASSERT(0 == gpr_slice_str_cmp(slice,
+ GPR_ASSERT(0 == grpc_slice_str_cmp(slice,
"GET /index.html HTTP/1.0\r\n"
"Host: example.com\r\n"
"Connection: close\r\n"
@@ -60,13 +60,13 @@ static void test_format_get_request(void) {
"x-yz: abc\r\n"
"\r\n"));
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
static void test_format_post_request(void) {
grpc_http_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req;
- gpr_slice slice;
+ grpc_slice slice;
char body_bytes[] = "fake body";
size_t body_len = 9;
@@ -78,7 +78,7 @@ static void test_format_post_request(void) {
slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len);
- GPR_ASSERT(0 == gpr_slice_str_cmp(slice,
+ GPR_ASSERT(0 == grpc_slice_str_cmp(slice,
"POST /index.html HTTP/1.0\r\n"
"Host: example.com\r\n"
"Connection: close\r\n"
@@ -90,13 +90,13 @@ static void test_format_post_request(void) {
"\r\n"
"fake body"));
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
static void test_format_post_request_no_body(void) {
grpc_http_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req;
- gpr_slice slice;
+ grpc_slice slice;
memset(&req, 0, sizeof(req));
req.host = "example.com";
@@ -106,7 +106,7 @@ static void test_format_post_request_no_body(void) {
slice = grpc_httpcli_format_post_request(&req, NULL, 0);
- GPR_ASSERT(0 == gpr_slice_str_cmp(slice,
+ GPR_ASSERT(0 == grpc_slice_str_cmp(slice,
"POST /index.html HTTP/1.0\r\n"
"Host: example.com\r\n"
"Connection: close\r\n"
@@ -115,13 +115,13 @@ static void test_format_post_request_no_body(void) {
"x-yz: abc\r\n"
"\r\n"));
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
static void test_format_post_request_content_type_override(void) {
grpc_http_header hdrs[2];
grpc_httpcli_request req;
- gpr_slice slice;
+ grpc_slice slice;
char body_bytes[] = "fake%20body";
size_t body_len = 11;
@@ -137,7 +137,7 @@ static void test_format_post_request_content_type_override(void) {
slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len);
- GPR_ASSERT(0 == gpr_slice_str_cmp(
+ GPR_ASSERT(0 == grpc_slice_str_cmp(
slice,
"POST /index.html HTTP/1.0\r\n"
"Host: example.com\r\n"
@@ -149,7 +149,7 @@ static void test_format_post_request_content_type_override(void) {
"\r\n"
"fake%20body"));
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
int main(int argc, char **argv) {
diff --git a/test/core/http/parser_test.c b/test/core/http/parser_test.c
index 2fc354d9ee..4f1445d3f1 100644
--- a/test/core/http/parser_test.c
+++ b/test/core/http/parser_test.c
@@ -48,23 +48,23 @@ static void test_request_succeeds(grpc_slice_split_mode split_mode,
grpc_http_version expect_version,
char *expect_path, char *expect_body, ...) {
grpc_http_parser parser;
- gpr_slice input_slice = gpr_slice_from_copied_string(request_text);
+ grpc_slice input_slice = grpc_slice_from_copied_string(request_text);
size_t num_slices;
size_t i;
- gpr_slice *slices;
+ grpc_slice *slices;
va_list args;
grpc_http_request request;
memset(&request, 0, sizeof(request));
grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
- gpr_slice_unref(input_slice);
+ grpc_slice_unref(input_slice);
grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request);
for (i = 0; i < num_slices; i++) {
GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i], NULL) ==
GRPC_ERROR_NONE);
- gpr_slice_unref(slices[i]);
+ grpc_slice_unref(slices[i]);
}
GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE);
@@ -105,23 +105,23 @@ static void test_request_succeeds(grpc_slice_split_mode split_mode,
static void test_succeeds(grpc_slice_split_mode split_mode, char *response_text,
int expect_status, char *expect_body, ...) {
grpc_http_parser parser;
- gpr_slice input_slice = gpr_slice_from_copied_string(response_text);
+ grpc_slice input_slice = grpc_slice_from_copied_string(response_text);
size_t num_slices;
size_t i;
- gpr_slice *slices;
+ grpc_slice *slices;
va_list args;
grpc_http_response response;
memset(&response, 0, sizeof(response));
grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
- gpr_slice_unref(input_slice);
+ grpc_slice_unref(input_slice);
grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
for (i = 0; i < num_slices; i++) {
GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i], NULL) ==
GRPC_ERROR_NONE);
- gpr_slice_unref(slices[i]);
+ grpc_slice_unref(slices[i]);
}
GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE);
@@ -158,16 +158,16 @@ static void test_succeeds(grpc_slice_split_mode split_mode, char *response_text,
static void test_fails(grpc_slice_split_mode split_mode, char *response_text) {
grpc_http_parser parser;
- gpr_slice input_slice = gpr_slice_from_copied_string(response_text);
+ grpc_slice input_slice = grpc_slice_from_copied_string(response_text);
size_t num_slices;
size_t i;
- gpr_slice *slices;
+ grpc_slice *slices;
grpc_error *error = GRPC_ERROR_NONE;
grpc_http_response response;
memset(&response, 0, sizeof(response));
grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
- gpr_slice_unref(input_slice);
+ grpc_slice_unref(input_slice);
grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
@@ -175,7 +175,7 @@ static void test_fails(grpc_slice_split_mode split_mode, char *response_text) {
if (GRPC_ERROR_NONE == error) {
error = grpc_http_parser_parse(&parser, slices[i], NULL);
}
- gpr_slice_unref(slices[i]);
+ grpc_slice_unref(slices[i]);
}
if (GRPC_ERROR_NONE == error) {
error = grpc_http_parser_eof(&parser);
@@ -191,16 +191,16 @@ static void test_fails(grpc_slice_split_mode split_mode, char *response_text) {
static void test_request_fails(grpc_slice_split_mode split_mode,
char *request_text) {
grpc_http_parser parser;
- gpr_slice input_slice = gpr_slice_from_copied_string(request_text);
+ grpc_slice input_slice = grpc_slice_from_copied_string(request_text);
size_t num_slices;
size_t i;
- gpr_slice *slices;
+ grpc_slice *slices;
grpc_error *error = GRPC_ERROR_NONE;
grpc_http_request request;
memset(&request, 0, sizeof(request));
grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
- gpr_slice_unref(input_slice);
+ grpc_slice_unref(input_slice);
grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request);
@@ -208,7 +208,7 @@ static void test_request_fails(grpc_slice_split_mode split_mode,
if (error == GRPC_ERROR_NONE) {
error = grpc_http_parser_parse(&parser, slices[i], NULL);
}
- gpr_slice_unref(slices[i]);
+ grpc_slice_unref(slices[i]);
}
if (error == GRPC_ERROR_NONE) {
error = grpc_http_parser_eof(&parser);
diff --git a/test/core/http/request_fuzzer.c b/test/core/http/request_fuzzer.c
index bb6cb92c0c..98e2c9680d 100644
--- a/test/core/http/request_fuzzer.c
+++ b/test/core/http/request_fuzzer.c
@@ -47,10 +47,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_http_request request;
memset(&request, 0, sizeof(request));
grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request);
- gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size);
+ grpc_slice slice = grpc_slice_from_copied_buffer((const char *)data, size);
GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice, NULL));
GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser));
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
grpc_http_parser_destroy(&parser);
grpc_http_request_destroy(&request);
return 0;
diff --git a/test/core/http/response_fuzzer.c b/test/core/http/response_fuzzer.c
index 4393840484..fff04117b2 100644
--- a/test/core/http/response_fuzzer.c
+++ b/test/core/http/response_fuzzer.c
@@ -46,10 +46,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_http_response response;
memset(&response, 0, sizeof(response));
grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
- gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size);
+ grpc_slice slice = grpc_slice_from_copied_buffer((const char *)data, size);
GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice, NULL));
GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser));
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
grpc_http_parser_destroy(&parser);
grpc_http_response_destroy(&response);
return 0;
diff --git a/test/core/internal_api_canaries/transport.c b/test/core/internal_api_canaries/transport.c
index 0617865412..2989f59535 100644
--- a/test/core/internal_api_canaries/transport.c
+++ b/test/core/internal_api_canaries/transport.c
@@ -69,7 +69,7 @@ static void test_code(void) {
grpc_transport_perform_op(&transport, NULL, NULL);
grpc_transport_ping(&transport, NULL);
grpc_transport_goaway(&transport, GRPC_STATUS_UNAVAILABLE,
- gpr_slice_malloc(0));
+ grpc_slice_malloc(0));
grpc_transport_close(&transport);
grpc_transport_destroy(&transport, NULL);
GPR_ASSERT("xyz" == grpc_transport_get_peer(&transport, NULL));
diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c
index b79c22e42a..775c0a3e6b 100644
--- a/test/core/iomgr/endpoint_tests.c
+++ b/test/core/iomgr/endpoint_tests.c
@@ -62,7 +62,7 @@
static gpr_mu *g_mu;
static grpc_pollset *g_pollset;
-size_t count_slices(gpr_slice *slices, size_t nslices, int *current_data) {
+size_t count_slices(grpc_slice *slices, size_t nslices, int *current_data) {
size_t num_bytes = 0;
size_t i;
size_t j;
@@ -87,10 +87,10 @@ static grpc_endpoint_test_fixture begin_test(grpc_endpoint_test_config config,
static void end_test(grpc_endpoint_test_config config) { config.clean_up(); }
-static gpr_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
+static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
size_t *num_blocks, uint8_t *current_data) {
size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1 : 0);
- gpr_slice *slices = gpr_malloc(sizeof(gpr_slice) * nslices);
+ grpc_slice *slices = gpr_malloc(sizeof(grpc_slice) * nslices);
size_t num_bytes_left = num_bytes;
size_t i;
size_t j;
@@ -98,7 +98,7 @@ static gpr_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
*num_blocks = nslices;
for (i = 0; i < nslices; ++i) {
- slices[i] = gpr_slice_malloc(slice_size > num_bytes_left ? num_bytes_left
+ slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left
: slice_size);
num_bytes_left -= GPR_SLICE_LENGTH(slices[i]);
buf = GPR_SLICE_START_PTR(slices[i]);
@@ -122,8 +122,8 @@ struct read_and_write_test_state {
uint8_t current_write_data;
int read_done;
int write_done;
- gpr_slice_buffer incoming;
- gpr_slice_buffer outgoing;
+ grpc_slice_buffer incoming;
+ grpc_slice_buffer outgoing;
grpc_closure done_read;
grpc_closure done_write;
};
@@ -149,7 +149,7 @@ static void read_and_write_test_read_handler(grpc_exec_ctx *exec_ctx,
static void read_and_write_test_write_handler(grpc_exec_ctx *exec_ctx,
void *data, grpc_error *error) {
struct read_and_write_test_state *state = data;
- gpr_slice *slices = NULL;
+ grpc_slice *slices = NULL;
size_t nslices;
if (error == GRPC_ERROR_NONE) {
@@ -161,8 +161,8 @@ static void read_and_write_test_write_handler(grpc_exec_ctx *exec_ctx,
if (state->current_write_size != 0) {
slices = allocate_blocks(state->current_write_size, 8192, &nslices,
&state->current_write_data);
- gpr_slice_buffer_reset_and_unref(&state->outgoing);
- gpr_slice_buffer_addn(&state->outgoing, slices, nslices);
+ grpc_slice_buffer_reset_and_unref(&state->outgoing);
+ grpc_slice_buffer_addn(&state->outgoing, slices, nslices);
grpc_endpoint_write(exec_ctx, state->write_ep, &state->outgoing,
&state->done_write);
gpr_free(slices);
@@ -214,8 +214,8 @@ static void read_and_write_test(grpc_endpoint_test_config config,
grpc_closure_init(&state.done_read, read_and_write_test_read_handler, &state);
grpc_closure_init(&state.done_write, read_and_write_test_write_handler,
&state);
- gpr_slice_buffer_init(&state.outgoing);
- gpr_slice_buffer_init(&state.incoming);
+ grpc_slice_buffer_init(&state.outgoing);
+ grpc_slice_buffer_init(&state.incoming);
/* Get started by pretending an initial write completed */
/* NOTE: Sets up initial conditions so we can have the same write handler
@@ -249,8 +249,8 @@ static void read_and_write_test(grpc_endpoint_test_config config,
grpc_exec_ctx_flush(&exec_ctx);
end_test(config);
- gpr_slice_buffer_destroy(&state.outgoing);
- gpr_slice_buffer_destroy(&state.incoming);
+ grpc_slice_buffer_destroy(&state.outgoing);
+ grpc_slice_buffer_destroy(&state.incoming);
grpc_endpoint_destroy(&exec_ctx, state.read_ep);
grpc_endpoint_destroy(&exec_ctx, state.write_ep);
grpc_exec_ctx_finish(&exec_ctx);
@@ -284,8 +284,8 @@ static void multiple_shutdown_test(grpc_endpoint_test_config config) {
begin_test(config, "multiple_shutdown_test", 128);
int fail_count = 0;
- gpr_slice_buffer slice_buffer;
- gpr_slice_buffer_init(&slice_buffer);
+ grpc_slice_buffer slice_buffer;
+ grpc_slice_buffer_init(&slice_buffer);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset);
@@ -297,14 +297,14 @@ static void multiple_shutdown_test(grpc_endpoint_test_config config) {
grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer,
grpc_closure_create(inc_on_failure, &fail_count));
wait_for_fail_count(&exec_ctx, &fail_count, 2);
- gpr_slice_buffer_add(&slice_buffer, gpr_slice_from_copied_string("a"));
+ grpc_slice_buffer_add(&slice_buffer, grpc_slice_from_copied_string("a"));
grpc_endpoint_write(&exec_ctx, f.client_ep, &slice_buffer,
grpc_closure_create(inc_on_failure, &fail_count));
wait_for_fail_count(&exec_ctx, &fail_count, 3);
grpc_endpoint_shutdown(&exec_ctx, f.client_ep);
wait_for_fail_count(&exec_ctx, &fail_count, 3);
- gpr_slice_buffer_destroy(&slice_buffer);
+ grpc_slice_buffer_destroy(&slice_buffer);
grpc_endpoint_destroy(&exec_ctx, f.client_ep);
grpc_endpoint_destroy(&exec_ctx, f.server_ep);
diff --git a/test/core/iomgr/load_file_test.c b/test/core/iomgr/load_file_test.c
index f70295a81c..c7387fe7a4 100644
--- a/test/core/iomgr/load_file_test.c
+++ b/test/core/iomgr/load_file_test.c
@@ -49,8 +49,8 @@ static const char prefix[] = "file_test";
static void test_load_empty_file(void) {
FILE *tmp = NULL;
- gpr_slice slice;
- gpr_slice slice_with_null_term;
+ grpc_slice slice;
+ grpc_slice slice_with_null_term;
grpc_error *error;
char *tmp_name;
@@ -72,13 +72,13 @@ static void test_load_empty_file(void) {
remove(tmp_name);
gpr_free(tmp_name);
- gpr_slice_unref(slice);
- gpr_slice_unref(slice_with_null_term);
+ grpc_slice_unref(slice);
+ grpc_slice_unref(slice_with_null_term);
}
static void test_load_failure(void) {
FILE *tmp = NULL;
- gpr_slice slice;
+ grpc_slice slice;
grpc_error *error;
char *tmp_name;
@@ -95,13 +95,13 @@ static void test_load_failure(void) {
GRPC_ERROR_UNREF(error);
GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 0);
gpr_free(tmp_name);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
static void test_load_small_file(void) {
FILE *tmp = NULL;
- gpr_slice slice;
- gpr_slice slice_with_null_term;
+ grpc_slice slice;
+ grpc_slice slice_with_null_term;
grpc_error *error;
char *tmp_name;
const char *blah = "blah";
@@ -127,13 +127,13 @@ static void test_load_small_file(void) {
remove(tmp_name);
gpr_free(tmp_name);
- gpr_slice_unref(slice);
- gpr_slice_unref(slice_with_null_term);
+ grpc_slice_unref(slice);
+ grpc_slice_unref(slice_with_null_term);
}
static void test_load_big_file(void) {
FILE *tmp = NULL;
- gpr_slice slice;
+ grpc_slice slice;
grpc_error *error;
char *tmp_name;
static const size_t buffer_size = 124631;
@@ -161,7 +161,7 @@ static void test_load_big_file(void) {
remove(tmp_name);
gpr_free(tmp_name);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
gpr_free(buffer);
}
diff --git a/test/core/iomgr/resource_quota_test.c b/test/core/iomgr/resource_quota_test.c
index 5e2f9f8359..85c6ce6e70 100644
--- a/test/core/iomgr/resource_quota_test.c
+++ b/test/core/iomgr/resource_quota_test.c
@@ -657,8 +657,8 @@ static void test_one_slice(void) {
grpc_resource_user_slice_allocator_init(&alloc, &usr, inc_int_cb,
&num_allocs);
- gpr_slice_buffer buffer;
- gpr_slice_buffer_init(&buffer);
+ grpc_slice_buffer buffer;
+ grpc_slice_buffer_init(&buffer);
{
const int start_allocs = num_allocs;
@@ -668,7 +668,7 @@ static void test_one_slice(void) {
GPR_ASSERT(num_allocs == start_allocs + 1);
}
- gpr_slice_buffer_destroy(&buffer);
+ grpc_slice_buffer_destroy(&buffer);
destroy_user(&usr);
grpc_resource_quota_unref(q);
}
@@ -688,8 +688,8 @@ static void test_one_slice_deleted_late(void) {
grpc_resource_user_slice_allocator_init(&alloc, &usr, inc_int_cb,
&num_allocs);
- gpr_slice_buffer buffer;
- gpr_slice_buffer_init(&buffer);
+ grpc_slice_buffer buffer;
+ grpc_slice_buffer_init(&buffer);
{
const int start_allocs = num_allocs;
@@ -708,7 +708,7 @@ static void test_one_slice_deleted_late(void) {
}
grpc_resource_quota_unref(q);
- gpr_slice_buffer_destroy(&buffer);
+ grpc_slice_buffer_destroy(&buffer);
GPR_ASSERT(done);
{
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c
index 3f2e19ffd8..a259390d5e 100644
--- a/test/core/iomgr/tcp_posix_test.c
+++ b/test/core/iomgr/tcp_posix_test.c
@@ -119,11 +119,11 @@ struct read_socket_state {
grpc_endpoint *ep;
size_t read_bytes;
size_t target_read_bytes;
- gpr_slice_buffer incoming;
+ grpc_slice_buffer incoming;
grpc_closure read_cb;
};
-static size_t count_slices(gpr_slice *slices, size_t nslices,
+static size_t count_slices(grpc_slice *slices, size_t nslices,
int *current_data) {
size_t num_bytes = 0;
unsigned i, j;
@@ -188,7 +188,7 @@ static void read_test(size_t num_bytes, size_t slice_size) {
state.ep = ep;
state.read_bytes = 0;
state.target_read_bytes = written_bytes;
- gpr_slice_buffer_init(&state.incoming);
+ grpc_slice_buffer_init(&state.incoming);
grpc_closure_init(&state.read_cb, read_cb, &state);
grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
@@ -207,7 +207,7 @@ static void read_test(size_t num_bytes, size_t slice_size) {
GPR_ASSERT(state.read_bytes == state.target_read_bytes);
gpr_mu_unlock(g_mu);
- gpr_slice_buffer_destroy(&state.incoming);
+ grpc_slice_buffer_destroy(&state.incoming);
grpc_endpoint_destroy(&exec_ctx, ep);
grpc_exec_ctx_finish(&exec_ctx);
}
@@ -239,7 +239,7 @@ static void large_read_test(size_t slice_size) {
state.ep = ep;
state.read_bytes = 0;
state.target_read_bytes = (size_t)written_bytes;
- gpr_slice_buffer_init(&state.incoming);
+ grpc_slice_buffer_init(&state.incoming);
grpc_closure_init(&state.read_cb, read_cb, &state);
grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
@@ -258,7 +258,7 @@ static void large_read_test(size_t slice_size) {
GPR_ASSERT(state.read_bytes == state.target_read_bytes);
gpr_mu_unlock(g_mu);
- gpr_slice_buffer_destroy(&state.incoming);
+ grpc_slice_buffer_destroy(&state.incoming);
grpc_endpoint_destroy(&exec_ctx, ep);
grpc_exec_ctx_finish(&exec_ctx);
}
@@ -268,17 +268,17 @@ struct write_socket_state {
int write_done;
};
-static gpr_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
+static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
size_t *num_blocks, uint8_t *current_data) {
size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1u : 0u);
- gpr_slice *slices = gpr_malloc(sizeof(gpr_slice) * nslices);
+ grpc_slice *slices = gpr_malloc(sizeof(grpc_slice) * nslices);
size_t num_bytes_left = num_bytes;
unsigned i, j;
unsigned char *buf;
*num_blocks = nslices;
for (i = 0; i < nslices; ++i) {
- slices[i] = gpr_slice_malloc(slice_size > num_bytes_left ? num_bytes_left
+ slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left
: slice_size);
num_bytes_left -= GPR_SLICE_LENGTH(slices[i]);
buf = GPR_SLICE_START_PTR(slices[i]);
@@ -352,9 +352,9 @@ static void write_test(size_t num_bytes, size_t slice_size) {
grpc_endpoint *ep;
struct write_socket_state state;
size_t num_blocks;
- gpr_slice *slices;
+ grpc_slice *slices;
uint8_t current_data = 0;
- gpr_slice_buffer outgoing;
+ grpc_slice_buffer outgoing;
grpc_closure write_done_closure;
gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -377,8 +377,8 @@ static void write_test(size_t num_bytes, size_t slice_size) {
slices = allocate_blocks(num_bytes, slice_size, &num_blocks, &current_data);
- gpr_slice_buffer_init(&outgoing);
- gpr_slice_buffer_addn(&outgoing, slices, num_blocks);
+ grpc_slice_buffer_init(&outgoing);
+ grpc_slice_buffer_addn(&outgoing, slices, num_blocks);
grpc_closure_init(&write_done_closure, write_done, &state);
grpc_endpoint_write(&exec_ctx, ep, &outgoing, &write_done_closure);
@@ -399,7 +399,7 @@ static void write_test(size_t num_bytes, size_t slice_size) {
}
gpr_mu_unlock(g_mu);
- gpr_slice_buffer_destroy(&outgoing);
+ grpc_slice_buffer_destroy(&outgoing);
grpc_endpoint_destroy(&exec_ctx, ep);
gpr_free(slices);
grpc_exec_ctx_finish(&exec_ctx);
@@ -446,7 +446,7 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) {
state.ep = ep;
state.read_bytes = 0;
state.target_read_bytes = written_bytes;
- gpr_slice_buffer_init(&state.incoming);
+ grpc_slice_buffer_init(&state.incoming);
grpc_closure_init(&state.read_cb, read_cb, &state);
grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
@@ -467,7 +467,7 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) {
GPR_ASSERT(state.read_bytes == state.target_read_bytes);
gpr_mu_unlock(g_mu);
- gpr_slice_buffer_destroy(&state.incoming);
+ grpc_slice_buffer_destroy(&state.incoming);
grpc_tcp_destroy_and_release_fd(&exec_ctx, ep, &fd, &fd_released_cb);
grpc_exec_ctx_flush(&exec_ctx);
gpr_mu_lock(g_mu);
diff --git a/test/core/nanopb/fuzzer_response.c b/test/core/nanopb/fuzzer_response.c
index a82f20df83..202c120c67 100644
--- a/test/core/nanopb/fuzzer_response.c
+++ b/test/core/nanopb/fuzzer_response.c
@@ -45,11 +45,11 @@ static void dont_log(gpr_log_func_args *args) {}
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (squelch) gpr_set_log_function(dont_log);
- gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size);
+ grpc_slice slice = grpc_slice_from_copied_buffer((const char *)data, size);
grpc_grpclb_initial_response *response;
if ((response = grpc_grpclb_initial_response_parse(slice))) {
grpc_grpclb_initial_response_destroy(response);
}
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return 0;
}
diff --git a/test/core/nanopb/fuzzer_serverlist.c b/test/core/nanopb/fuzzer_serverlist.c
index 9700bf1cda..b225ae0d51 100644
--- a/test/core/nanopb/fuzzer_serverlist.c
+++ b/test/core/nanopb/fuzzer_serverlist.c
@@ -45,11 +45,11 @@ static void dont_log(gpr_log_func_args *args) {}
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (squelch) gpr_set_log_function(dont_log);
- gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size);
+ grpc_slice slice = grpc_slice_from_copied_buffer((const char *)data, size);
grpc_grpclb_serverlist *serverlist;
if ((serverlist = grpc_grpclb_response_parse_serverlist(slice))) {
grpc_grpclb_destroy_serverlist(serverlist);
}
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return 0;
}
diff --git a/test/core/security/b64_test.c b/test/core/security/b64_test.c
index b26bd026fd..f88be392a2 100644
--- a/test/core/security/b64_test.c
+++ b/test/core/security/b64_test.c
@@ -57,12 +57,12 @@ static void test_simple_encode_decode_b64(int url_safe, int multiline) {
const char *hello = "hello";
char *hello_b64 =
grpc_base64_encode(hello, strlen(hello), url_safe, multiline);
- gpr_slice hello_slice = grpc_base64_decode(hello_b64, url_safe);
+ grpc_slice hello_slice = grpc_base64_decode(hello_b64, url_safe);
GPR_ASSERT(GPR_SLICE_LENGTH(hello_slice) == strlen(hello));
GPR_ASSERT(strncmp((const char *)GPR_SLICE_START_PTR(hello_slice), hello,
GPR_SLICE_LENGTH(hello_slice)) == 0);
- gpr_slice_unref(hello_slice);
+ grpc_slice_unref(hello_slice);
gpr_free(hello_b64);
}
@@ -70,7 +70,7 @@ static void test_full_range_encode_decode_b64(int url_safe, int multiline) {
unsigned char orig[256];
size_t i;
char *b64;
- gpr_slice orig_decoded;
+ grpc_slice orig_decoded;
for (i = 0; i < sizeof(orig); i++) orig[i] = (uint8_t)i;
/* Try all the different paddings. */
@@ -80,7 +80,7 @@ static void test_full_range_encode_decode_b64(int url_safe, int multiline) {
GPR_ASSERT(GPR_SLICE_LENGTH(orig_decoded) == (sizeof(orig) - i));
GPR_ASSERT(buffers_are_equal(orig, GPR_SLICE_START_PTR(orig_decoded),
sizeof(orig) - i));
- gpr_slice_unref(orig_decoded);
+ grpc_slice_unref(orig_decoded);
gpr_free(b64);
}
}
@@ -121,7 +121,7 @@ static void test_url_safe_unsafe_mismtach_failure(void) {
unsigned char orig[256];
size_t i;
char *b64;
- gpr_slice orig_decoded;
+ grpc_slice orig_decoded;
int url_safe = 1;
for (i = 0; i < sizeof(orig); i++) orig[i] = (uint8_t)i;
@@ -129,13 +129,13 @@ static void test_url_safe_unsafe_mismtach_failure(void) {
orig_decoded = grpc_base64_decode(b64, !url_safe);
GPR_ASSERT(GPR_SLICE_IS_EMPTY(orig_decoded));
gpr_free(b64);
- gpr_slice_unref(orig_decoded);
+ grpc_slice_unref(orig_decoded);
b64 = grpc_base64_encode(orig, sizeof(orig), !url_safe, 0);
orig_decoded = grpc_base64_decode(b64, url_safe);
GPR_ASSERT(GPR_SLICE_IS_EMPTY(orig_decoded));
gpr_free(b64);
- gpr_slice_unref(orig_decoded);
+ grpc_slice_unref(orig_decoded);
}
static void test_rfc4648_test_vectors(void) {
@@ -171,37 +171,37 @@ static void test_rfc4648_test_vectors(void) {
}
static void test_unpadded_decode(void) {
- gpr_slice decoded;
+ grpc_slice decoded;
decoded = grpc_base64_decode("Zm9vYmFy", 0);
GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
- GPR_ASSERT(gpr_slice_str_cmp(decoded, "foobar") == 0);
- gpr_slice_unref(decoded);
+ GPR_ASSERT(grpc_slice_str_cmp(decoded, "foobar") == 0);
+ grpc_slice_unref(decoded);
decoded = grpc_base64_decode("Zm9vYmE", 0);
GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
- GPR_ASSERT(gpr_slice_str_cmp(decoded, "fooba") == 0);
- gpr_slice_unref(decoded);
+ GPR_ASSERT(grpc_slice_str_cmp(decoded, "fooba") == 0);
+ grpc_slice_unref(decoded);
decoded = grpc_base64_decode("Zm9vYg", 0);
GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
- GPR_ASSERT(gpr_slice_str_cmp(decoded, "foob") == 0);
- gpr_slice_unref(decoded);
+ GPR_ASSERT(grpc_slice_str_cmp(decoded, "foob") == 0);
+ grpc_slice_unref(decoded);
decoded = grpc_base64_decode("Zm9v", 0);
GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
- GPR_ASSERT(gpr_slice_str_cmp(decoded, "foo") == 0);
- gpr_slice_unref(decoded);
+ GPR_ASSERT(grpc_slice_str_cmp(decoded, "foo") == 0);
+ grpc_slice_unref(decoded);
decoded = grpc_base64_decode("Zm8", 0);
GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
- GPR_ASSERT(gpr_slice_str_cmp(decoded, "fo") == 0);
- gpr_slice_unref(decoded);
+ GPR_ASSERT(grpc_slice_str_cmp(decoded, "fo") == 0);
+ grpc_slice_unref(decoded);
decoded = grpc_base64_decode("Zg", 0);
GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
- GPR_ASSERT(gpr_slice_str_cmp(decoded, "f") == 0);
- gpr_slice_unref(decoded);
+ GPR_ASSERT(grpc_slice_str_cmp(decoded, "f") == 0);
+ grpc_slice_unref(decoded);
decoded = grpc_base64_decode("", 0);
GPR_ASSERT(GPR_SLICE_IS_EMPTY(decoded));
diff --git a/test/core/security/create_jwt.c b/test/core/security/create_jwt.c
index 1bd135f175..8b78dc5da5 100644
--- a/test/core/security/create_jwt.c
+++ b/test/core/security/create_jwt.c
@@ -46,12 +46,12 @@ void create_jwt(const char *json_key_file_path, const char *service_url,
const char *scope) {
grpc_auth_json_key key;
char *jwt;
- gpr_slice json_key_data;
+ grpc_slice json_key_data;
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"load_file", grpc_load_file(json_key_file_path, 1, &json_key_data)));
key = grpc_auth_json_key_create_from_string(
(const char *)GPR_SLICE_START_PTR(json_key_data));
- gpr_slice_unref(json_key_data);
+ grpc_slice_unref(json_key_data);
if (!grpc_auth_json_key_is_valid(&key)) {
fprintf(stderr, "Could not parse json key.\n");
exit(1);
diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c
index 2f8ffe4da6..d8bde4f2c2 100644
--- a/test/core/security/credentials_test.c
+++ b/test/core/security/credentials_test.c
@@ -187,14 +187,14 @@ static void test_add_to_empty_md_store(void) {
grpc_credentials_md_store *store = grpc_credentials_md_store_create(0);
const char *key_str = "hello";
const char *value_str = "there blah blah blah blah blah blah blah";
- gpr_slice key = gpr_slice_from_copied_string(key_str);
- gpr_slice value = gpr_slice_from_copied_string(value_str);
+ grpc_slice key = grpc_slice_from_copied_string(key_str);
+ grpc_slice value = grpc_slice_from_copied_string(value_str);
grpc_credentials_md_store_add(store, key, value);
GPR_ASSERT(store->num_entries == 1);
- GPR_ASSERT(gpr_slice_cmp(key, store->entries[0].key) == 0);
- GPR_ASSERT(gpr_slice_cmp(value, store->entries[0].value) == 0);
- gpr_slice_unref(key);
- gpr_slice_unref(value);
+ GPR_ASSERT(grpc_slice_cmp(key, store->entries[0].key) == 0);
+ GPR_ASSERT(grpc_slice_cmp(value, store->entries[0].value) == 0);
+ grpc_slice_unref(key);
+ grpc_slice_unref(value);
grpc_credentials_md_store_unref(store);
}
@@ -204,8 +204,8 @@ static void test_add_cstrings_to_empty_md_store(void) {
const char *value_str = "there blah blah blah blah blah blah blah";
grpc_credentials_md_store_add_cstrings(store, key_str, value_str);
GPR_ASSERT(store->num_entries == 1);
- GPR_ASSERT(gpr_slice_str_cmp(store->entries[0].key, key_str) == 0);
- GPR_ASSERT(gpr_slice_str_cmp(store->entries[0].value, value_str) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(store->entries[0].key, key_str) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(store->entries[0].value, value_str) == 0);
grpc_credentials_md_store_unref(store);
}
@@ -227,8 +227,8 @@ static void test_add_abunch_to_md_store(void) {
grpc_credentials_md_store_add_cstrings(store, key_str, value_str);
}
for (i = 0; i < num_entries; i++) {
- GPR_ASSERT(gpr_slice_str_cmp(store->entries[i].key, key_str) == 0);
- GPR_ASSERT(gpr_slice_str_cmp(store->entries[i].value, value_str) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(store->entries[i].key, key_str) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(store->entries[i].value, value_str) == 0);
}
grpc_credentials_md_store_unref(store);
}
@@ -243,8 +243,8 @@ static void test_oauth2_token_fetcher_creds_parsing_ok(void) {
GPR_ASSERT(token_lifetime.tv_sec == 3599);
GPR_ASSERT(token_lifetime.tv_nsec == 0);
GPR_ASSERT(token_md->num_entries == 1);
- GPR_ASSERT(gpr_slice_str_cmp(token_md->entries[0].key, "authorization") == 0);
- GPR_ASSERT(gpr_slice_str_cmp(token_md->entries[0].value,
+ GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].key, "authorization") == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].value,
"Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") ==
0);
grpc_credentials_md_store_unref(token_md);
@@ -333,8 +333,8 @@ static void check_metadata(expected_md *expected, grpc_credentials_md *md_elems,
for (i = 0; i < num_md; i++) {
size_t j;
for (j = 0; j < num_md; j++) {
- if (0 == gpr_slice_str_cmp(md_elems[j].key, expected[i].key)) {
- GPR_ASSERT(gpr_slice_str_cmp(md_elems[j].value, expected[i].value) ==
+ if (0 == grpc_slice_str_cmp(md_elems[j].key, expected[i].key)) {
+ GPR_ASSERT(grpc_slice_str_cmp(md_elems[j].value, expected[i].value) ==
0);
break;
}
@@ -528,8 +528,8 @@ static void on_oauth2_creds_get_metadata_success(
GPR_ASSERT(status == GRPC_CREDENTIALS_OK);
GPR_ASSERT(error_details == NULL);
GPR_ASSERT(num_md == 1);
- GPR_ASSERT(gpr_slice_str_cmp(md_elems[0].key, "authorization") == 0);
- GPR_ASSERT(gpr_slice_str_cmp(md_elems[0].value,
+ GPR_ASSERT(grpc_slice_str_cmp(md_elems[0].key, "authorization") == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(md_elems[0].value,
"Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") ==
0);
GPR_ASSERT(user_data != NULL);
@@ -781,8 +781,8 @@ static void on_jwt_creds_get_metadata_success(
GPR_ASSERT(status == GRPC_CREDENTIALS_OK);
GPR_ASSERT(error_details == NULL);
GPR_ASSERT(num_md == 1);
- GPR_ASSERT(gpr_slice_str_cmp(md_elems[0].key, "authorization") == 0);
- GPR_ASSERT(gpr_slice_str_cmp(md_elems[0].value, expected_md_value) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(md_elems[0].key, "authorization") == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(md_elems[0].value, expected_md_value) == 0);
GPR_ASSERT(user_data != NULL);
GPR_ASSERT(strcmp((const char *)user_data, test_user_data) == 0);
gpr_free(expected_md_value);
@@ -1057,8 +1057,8 @@ static void on_plugin_metadata_received_success(
GPR_ASSERT(md_elems != NULL);
GPR_ASSERT(num_md == GPR_ARRAY_SIZE(plugin_md));
for (i = 0; i < num_md; i++) {
- GPR_ASSERT(gpr_slice_str_cmp(md_elems[i].key, plugin_md[i].key) == 0);
- GPR_ASSERT(gpr_slice_str_cmp(md_elems[i].value, plugin_md[i].value) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(md_elems[i].key, plugin_md[i].key) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(md_elems[i].value, plugin_md[i].value) == 0);
}
}
diff --git a/test/core/security/fetch_oauth2.c b/test/core/security/fetch_oauth2.c
index 292f59a7c1..aa3db9f398 100644
--- a/test/core/security/fetch_oauth2.c
+++ b/test/core/security/fetch_oauth2.c
@@ -48,7 +48,7 @@
static grpc_call_credentials *create_refresh_token_creds(
const char *json_refresh_token_file_path) {
- gpr_slice refresh_token;
+ grpc_slice refresh_token;
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"load_file",
grpc_load_file(json_refresh_token_file_path, 1, &refresh_token)));
diff --git a/test/core/security/json_token_test.c b/test/core/security/json_token_test.c
index 405fe56c46..162997662e 100644
--- a/test/core/security/json_token_test.c
+++ b/test/core/security/json_token_test.c
@@ -223,7 +223,7 @@ static grpc_json *parse_json_part_from_jwt(const char *str, size_t len,
char *b64;
char *decoded;
grpc_json *json;
- gpr_slice slice;
+ grpc_slice slice;
b64 = gpr_malloc(len + 1);
strncpy(b64, str, len);
b64[len] = '\0';
@@ -236,7 +236,7 @@ static grpc_json *parse_json_part_from_jwt(const char *str, size_t len,
json = grpc_json_parse_string(decoded);
gpr_free(b64);
*scratchpad = decoded;
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
return json;
}
@@ -341,7 +341,7 @@ static void check_jwt_signature(const char *b64_signature, RSA *rsa_key,
EVP_MD_CTX *md_ctx = EVP_MD_CTX_create();
EVP_PKEY *key = EVP_PKEY_new();
- gpr_slice sig = grpc_base64_decode(b64_signature, 1);
+ grpc_slice sig = grpc_base64_decode(b64_signature, 1);
GPR_ASSERT(!GPR_SLICE_IS_EMPTY(sig));
GPR_ASSERT(GPR_SLICE_LENGTH(sig) == 128);
@@ -355,7 +355,7 @@ static void check_jwt_signature(const char *b64_signature, RSA *rsa_key,
GPR_ASSERT(EVP_DigestVerifyFinal(md_ctx, GPR_SLICE_START_PTR(sig),
GPR_SLICE_LENGTH(sig)) == 1);
- gpr_slice_unref(sig);
+ grpc_slice_unref(sig);
if (key != NULL) EVP_PKEY_free(key);
if (md_ctx != NULL) EVP_MD_CTX_destroy(md_ctx);
}
diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c
index 36b331a777..ce2ee04c99 100644
--- a/test/core/security/jwt_verifier_test.c
+++ b/test/core/security/jwt_verifier_test.c
@@ -181,7 +181,7 @@ typedef struct {
static void test_claims_success(void) {
grpc_jwt_claims *claims;
- gpr_slice s = gpr_slice_from_copied_string(claims_without_time_constraint);
+ grpc_slice s = grpc_slice_from_copied_string(claims_without_time_constraint);
grpc_json *json = grpc_json_parse_string_with_len(
(char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s));
GPR_ASSERT(json != NULL);
@@ -199,7 +199,7 @@ static void test_claims_success(void) {
static void test_expired_claims_failure(void) {
grpc_jwt_claims *claims;
- gpr_slice s = gpr_slice_from_copied_string(expired_claims);
+ grpc_slice s = grpc_slice_from_copied_string(expired_claims);
grpc_json *json = grpc_json_parse_string_with_len(
(char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s));
gpr_timespec exp_iat = {100, 0, GPR_CLOCK_REALTIME};
@@ -223,7 +223,7 @@ static void test_expired_claims_failure(void) {
}
static void test_invalid_claims_failure(void) {
- gpr_slice s = gpr_slice_from_copied_string(invalid_claims);
+ grpc_slice s = grpc_slice_from_copied_string(invalid_claims);
grpc_json *json = grpc_json_parse_string_with_len(
(char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s));
GPR_ASSERT(grpc_jwt_claims_from_json(json, s) == NULL);
@@ -231,7 +231,7 @@ static void test_invalid_claims_failure(void) {
static void test_bad_audience_claims_failure(void) {
grpc_jwt_claims *claims;
- gpr_slice s = gpr_slice_from_copied_string(claims_without_time_constraint);
+ grpc_slice s = grpc_slice_from_copied_string(claims_without_time_constraint);
grpc_json *json = grpc_json_parse_string_with_len(
(char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s));
GPR_ASSERT(json != NULL);
@@ -478,7 +478,7 @@ static void test_jwt_verifier_bad_json_key(void) {
}
static void corrupt_jwt_sig(char *jwt) {
- gpr_slice sig;
+ grpc_slice sig;
char *bad_b64_sig;
uint8_t *sig_bytes;
char *last_dot = strrchr(jwt, '.');
@@ -491,7 +491,7 @@ static void corrupt_jwt_sig(char *jwt) {
grpc_base64_encode(GPR_SLICE_START_PTR(sig), GPR_SLICE_LENGTH(sig), 1, 0);
memcpy(last_dot + 1, bad_b64_sig, strlen(bad_b64_sig));
gpr_free(bad_b64_sig);
- gpr_slice_unref(sig);
+ grpc_slice_unref(sig);
}
static void on_verification_bad_signature(void *user_data,
diff --git a/test/core/security/oauth2_utils.c b/test/core/security/oauth2_utils.c
index 9b97c38fcb..3b774fecb6 100644
--- a/test/core/security/oauth2_utils.c
+++ b/test/core/security/oauth2_utils.c
@@ -57,7 +57,7 @@ static void on_oauth2_response(grpc_exec_ctx *exec_ctx, void *user_data,
const char *error_details) {
oauth2_request *request = user_data;
char *token = NULL;
- gpr_slice token_slice;
+ grpc_slice token_slice;
if (status == GRPC_CREDENTIALS_ERROR) {
gpr_log(GPR_ERROR, "Fetching token failed.");
} else {
diff --git a/test/core/security/secure_endpoint_test.c b/test/core/security/secure_endpoint_test.c
index 2262fde98d..e12ca48c2f 100644
--- a/test/core/security/secure_endpoint_test.c
+++ b/test/core/security/secure_endpoint_test.c
@@ -49,7 +49,7 @@ static gpr_mu *g_mu;
static grpc_pollset *g_pollset;
static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
- size_t slice_size, gpr_slice *leftover_slices, size_t leftover_nslices) {
+ size_t slice_size, grpc_slice *leftover_slices, size_t leftover_nslices) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
tsi_frame_protector *fake_read_protector = tsi_create_fake_protector(NULL);
tsi_frame_protector *fake_write_protector = tsi_create_fake_protector(NULL);
@@ -74,9 +74,9 @@ static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
size_t buffer_size = total_buffer_size;
uint8_t *encrypted_buffer = gpr_malloc(buffer_size);
uint8_t *cur = encrypted_buffer;
- gpr_slice encrypted_leftover;
+ grpc_slice encrypted_leftover;
for (i = 0; i < leftover_nslices; i++) {
- gpr_slice plain = leftover_slices[i];
+ grpc_slice plain = leftover_slices[i];
uint8_t *message_bytes = GPR_SLICE_START_PTR(plain);
size_t message_size = GPR_SLICE_LENGTH(plain);
while (message_size > 0) {
@@ -92,7 +92,7 @@ static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
GPR_ASSERT(buffer_size >= protected_buffer_size_to_send);
buffer_size -= protected_buffer_size_to_send;
}
- gpr_slice_unref(plain);
+ grpc_slice_unref(plain);
}
do {
size_t protected_buffer_size_to_send = buffer_size;
@@ -104,11 +104,11 @@ static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
GPR_ASSERT(buffer_size >= protected_buffer_size_to_send);
buffer_size -= protected_buffer_size_to_send;
} while (still_pending_size > 0);
- encrypted_leftover = gpr_slice_from_copied_buffer(
+ encrypted_leftover = grpc_slice_from_copied_buffer(
(const char *)encrypted_buffer, total_buffer_size - buffer_size);
f.client_ep = grpc_secure_endpoint_create(fake_read_protector, tcp.client,
&encrypted_leftover, 1);
- gpr_slice_unref(encrypted_leftover);
+ grpc_slice_unref(encrypted_leftover);
gpr_free(encrypted_buffer);
}
@@ -125,8 +125,8 @@ secure_endpoint_create_fixture_tcp_socketpair_noleftover(size_t slice_size) {
static grpc_endpoint_test_fixture
secure_endpoint_create_fixture_tcp_socketpair_leftover(size_t slice_size) {
- gpr_slice s =
- gpr_slice_from_copied_string("hello world 12345678900987654321");
+ grpc_slice s =
+ grpc_slice_from_copied_string("hello world 12345678900987654321");
grpc_endpoint_test_fixture f;
f = secure_endpoint_create_fixture_tcp_socketpair(slice_size, &s, 1);
@@ -149,29 +149,29 @@ static void inc_call_ctr(grpc_exec_ctx *exec_ctx, void *arg,
static void test_leftover(grpc_endpoint_test_config config, size_t slice_size) {
grpc_endpoint_test_fixture f = config.create_fixture(slice_size);
- gpr_slice_buffer incoming;
- gpr_slice s =
- gpr_slice_from_copied_string("hello world 12345678900987654321");
+ grpc_slice_buffer incoming;
+ grpc_slice s =
+ grpc_slice_from_copied_string("hello world 12345678900987654321");
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
int n = 0;
grpc_closure done_closure;
gpr_log(GPR_INFO, "Start test left over");
- gpr_slice_buffer_init(&incoming);
+ grpc_slice_buffer_init(&incoming);
grpc_closure_init(&done_closure, inc_call_ctr, &n);
grpc_endpoint_read(&exec_ctx, f.client_ep, &incoming, &done_closure);
grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(n == 1);
GPR_ASSERT(incoming.count == 1);
- GPR_ASSERT(0 == gpr_slice_cmp(s, incoming.slices[0]));
+ GPR_ASSERT(0 == grpc_slice_cmp(s, incoming.slices[0]));
grpc_endpoint_shutdown(&exec_ctx, f.client_ep);
grpc_endpoint_shutdown(&exec_ctx, f.server_ep);
grpc_endpoint_destroy(&exec_ctx, f.client_ep);
grpc_endpoint_destroy(&exec_ctx, f.server_ep);
grpc_exec_ctx_finish(&exec_ctx);
- gpr_slice_unref(s);
- gpr_slice_buffer_destroy(&incoming);
+ grpc_slice_unref(s);
+ grpc_slice_buffer_destroy(&incoming);
clean_up();
}
diff --git a/test/core/security/security_connector_test.c b/test/core/security/security_connector_test.c
index 6106bec9d3..4692db1853 100644
--- a/test/core/security/security_connector_test.c
+++ b/test/core/security/security_connector_test.c
@@ -368,9 +368,9 @@ static void test_default_ssl_roots(void) {
value. */
gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, "");
grpc_set_ssl_roots_override_callback(override_roots_success);
- gpr_slice roots = grpc_get_default_ssl_roots_for_testing();
+ grpc_slice roots = grpc_get_default_ssl_roots_for_testing();
char *roots_contents = gpr_dump_slice(roots, GPR_DUMP_ASCII);
- gpr_slice_unref(roots);
+ grpc_slice_unref(roots);
GPR_ASSERT(strcmp(roots_contents, roots_for_override_api) == 0);
gpr_free(roots_contents);
@@ -379,7 +379,7 @@ static void test_default_ssl_roots(void) {
gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_env_var_file_path);
roots = grpc_get_default_ssl_roots_for_testing();
roots_contents = gpr_dump_slice(roots, GPR_DUMP_ASCII);
- gpr_slice_unref(roots);
+ grpc_slice_unref(roots);
GPR_ASSERT(strcmp(roots_contents, roots_for_env_var) == 0);
gpr_free(roots_contents);
@@ -388,7 +388,7 @@ static void test_default_ssl_roots(void) {
gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, "");
roots = grpc_get_default_ssl_roots_for_testing();
roots_contents = gpr_dump_slice(roots, GPR_DUMP_ASCII);
- gpr_slice_unref(roots);
+ grpc_slice_unref(roots);
GPR_ASSERT(strcmp(roots_contents, roots_for_override_api) == 0);
gpr_free(roots_contents);
diff --git a/test/core/support/percent_decode_corpus/04cb8ccc553f9b2f5e52c421aff6d1c954d3dae6 b/test/core/slice/percent_decode_corpus/04cb8ccc553f9b2f5e52c421aff6d1c954d3dae6
index a0c7605580..a0c7605580 100644
--- a/test/core/support/percent_decode_corpus/04cb8ccc553f9b2f5e52c421aff6d1c954d3dae6
+++ b/test/core/slice/percent_decode_corpus/04cb8ccc553f9b2f5e52c421aff6d1c954d3dae6
diff --git a/test/core/support/percent_decode_corpus/0dd8f3a63745b3a2d39791559b5c1b311447b537 b/test/core/slice/percent_decode_corpus/0dd8f3a63745b3a2d39791559b5c1b311447b537
index 8b36124b3f..8b36124b3f 100644
--- a/test/core/support/percent_decode_corpus/0dd8f3a63745b3a2d39791559b5c1b311447b537
+++ b/test/core/slice/percent_decode_corpus/0dd8f3a63745b3a2d39791559b5c1b311447b537
diff --git a/test/core/support/percent_decode_corpus/17eeaca784409adbe43365c32ac87915d736bba3 b/test/core/slice/percent_decode_corpus/17eeaca784409adbe43365c32ac87915d736bba3
index ea02afac49..ea02afac49 100644
--- a/test/core/support/percent_decode_corpus/17eeaca784409adbe43365c32ac87915d736bba3
+++ b/test/core/slice/percent_decode_corpus/17eeaca784409adbe43365c32ac87915d736bba3
diff --git a/test/core/support/percent_decode_corpus/2040c1ff65f52a7ae668c2c8f324de5dacc9d695 b/test/core/slice/percent_decode_corpus/2040c1ff65f52a7ae668c2c8f324de5dacc9d695
index 9e9b466b2f..9e9b466b2f 100644
--- a/test/core/support/percent_decode_corpus/2040c1ff65f52a7ae668c2c8f324de5dacc9d695
+++ b/test/core/slice/percent_decode_corpus/2040c1ff65f52a7ae668c2c8f324de5dacc9d695
diff --git a/test/core/support/percent_decode_corpus/26b0d1da23027ae54db96e125e4a9e98842d77fb b/test/core/slice/percent_decode_corpus/26b0d1da23027ae54db96e125e4a9e98842d77fb
index 88c739ecaa..88c739ecaa 100644
--- a/test/core/support/percent_decode_corpus/26b0d1da23027ae54db96e125e4a9e98842d77fb
+++ b/test/core/slice/percent_decode_corpus/26b0d1da23027ae54db96e125e4a9e98842d77fb
diff --git a/test/core/support/percent_decode_corpus/2a089c0db45acdb4c6ed8e7ff81ca7235792c0b9 b/test/core/slice/percent_decode_corpus/2a089c0db45acdb4c6ed8e7ff81ca7235792c0b9
index 5e6f546ff5..5e6f546ff5 100644
--- a/test/core/support/percent_decode_corpus/2a089c0db45acdb4c6ed8e7ff81ca7235792c0b9
+++ b/test/core/slice/percent_decode_corpus/2a089c0db45acdb4c6ed8e7ff81ca7235792c0b9
diff --git a/test/core/support/percent_decode_corpus/35b7b3bc3a740d5c3abca0d75b53f0e1e1ee998a b/test/core/slice/percent_decode_corpus/35b7b3bc3a740d5c3abca0d75b53f0e1e1ee998a
index 71d688b694..71d688b694 100644
--- a/test/core/support/percent_decode_corpus/35b7b3bc3a740d5c3abca0d75b53f0e1e1ee998a
+++ b/test/core/slice/percent_decode_corpus/35b7b3bc3a740d5c3abca0d75b53f0e1e1ee998a
diff --git a/test/core/support/percent_decode_corpus/36367ba1adba47a1cbc3a88707fde8cc7abdc248 b/test/core/slice/percent_decode_corpus/36367ba1adba47a1cbc3a88707fde8cc7abdc248
index 5a89a07ba7..5a89a07ba7 100644
--- a/test/core/support/percent_decode_corpus/36367ba1adba47a1cbc3a88707fde8cc7abdc248
+++ b/test/core/slice/percent_decode_corpus/36367ba1adba47a1cbc3a88707fde8cc7abdc248
diff --git a/test/core/support/percent_decode_corpus/39c2ba51548a0beaf0d6d1164531f1447dc311b5 b/test/core/slice/percent_decode_corpus/39c2ba51548a0beaf0d6d1164531f1447dc311b5
index cfa2be994f..cfa2be994f 100644
--- a/test/core/support/percent_decode_corpus/39c2ba51548a0beaf0d6d1164531f1447dc311b5
+++ b/test/core/slice/percent_decode_corpus/39c2ba51548a0beaf0d6d1164531f1447dc311b5
diff --git a/test/core/support/percent_decode_corpus/56d08fea787c041395c6697ce26cfbc0decbe688 b/test/core/slice/percent_decode_corpus/56d08fea787c041395c6697ce26cfbc0decbe688
index c1ddf65acd..c1ddf65acd 100644
--- a/test/core/support/percent_decode_corpus/56d08fea787c041395c6697ce26cfbc0decbe688
+++ b/test/core/slice/percent_decode_corpus/56d08fea787c041395c6697ce26cfbc0decbe688
diff --git a/test/core/support/percent_decode_corpus/678d981fdabb9f0d6640235cf1719dd1e1e66ae9 b/test/core/slice/percent_decode_corpus/678d981fdabb9f0d6640235cf1719dd1e1e66ae9
index dc427d1e12..dc427d1e12 100644
--- a/test/core/support/percent_decode_corpus/678d981fdabb9f0d6640235cf1719dd1e1e66ae9
+++ b/test/core/slice/percent_decode_corpus/678d981fdabb9f0d6640235cf1719dd1e1e66ae9
diff --git a/test/core/support/percent_decode_corpus/68751961609ec010565de0aa87521dcbf0722c5d b/test/core/slice/percent_decode_corpus/68751961609ec010565de0aa87521dcbf0722c5d
index 154449d0ef..154449d0ef 100644
--- a/test/core/support/percent_decode_corpus/68751961609ec010565de0aa87521dcbf0722c5d
+++ b/test/core/slice/percent_decode_corpus/68751961609ec010565de0aa87521dcbf0722c5d
diff --git a/test/core/support/percent_decode_corpus/7875c06c6f03c9aa2f8e9c59f8d8957c8a32e759 b/test/core/slice/percent_decode_corpus/7875c06c6f03c9aa2f8e9c59f8d8957c8a32e759
index 841ced83c3..841ced83c3 100644
--- a/test/core/support/percent_decode_corpus/7875c06c6f03c9aa2f8e9c59f8d8957c8a32e759
+++ b/test/core/slice/percent_decode_corpus/7875c06c6f03c9aa2f8e9c59f8d8957c8a32e759
diff --git a/test/core/support/percent_decode_corpus/7b302090e090a5829b6d1dd7be30bd4e36a7e60f b/test/core/slice/percent_decode_corpus/7b302090e090a5829b6d1dd7be30bd4e36a7e60f
index 6790bc2798..6790bc2798 100644
--- a/test/core/support/percent_decode_corpus/7b302090e090a5829b6d1dd7be30bd4e36a7e60f
+++ b/test/core/slice/percent_decode_corpus/7b302090e090a5829b6d1dd7be30bd4e36a7e60f
diff --git a/test/core/support/percent_decode_corpus/875e1022169c9e4c541a9ad894e69e989df22ba1 b/test/core/slice/percent_decode_corpus/875e1022169c9e4c541a9ad894e69e989df22ba1
index 1625d0a1ae..1625d0a1ae 100644
--- a/test/core/support/percent_decode_corpus/875e1022169c9e4c541a9ad894e69e989df22ba1
+++ b/test/core/slice/percent_decode_corpus/875e1022169c9e4c541a9ad894e69e989df22ba1
diff --git a/test/core/support/percent_decode_corpus/8c1051ce066f5a26de9a9d133180621d0da957b4 b/test/core/slice/percent_decode_corpus/8c1051ce066f5a26de9a9d133180621d0da957b4
index 125c330b3e..125c330b3e 100644
--- a/test/core/support/percent_decode_corpus/8c1051ce066f5a26de9a9d133180621d0da957b4
+++ b/test/core/slice/percent_decode_corpus/8c1051ce066f5a26de9a9d133180621d0da957b4
diff --git a/test/core/support/percent_decode_corpus/8e084e628ab83a18ac7ca7cb3506525263655c63 b/test/core/slice/percent_decode_corpus/8e084e628ab83a18ac7ca7cb3506525263655c63
index 6e6f08cb07..6e6f08cb07 100644
--- a/test/core/support/percent_decode_corpus/8e084e628ab83a18ac7ca7cb3506525263655c63
+++ b/test/core/slice/percent_decode_corpus/8e084e628ab83a18ac7ca7cb3506525263655c63
diff --git a/test/core/support/percent_decode_corpus/9d316c4675f40ddccaf8f1cc7aea94170b1e4223 b/test/core/slice/percent_decode_corpus/9d316c4675f40ddccaf8f1cc7aea94170b1e4223
index ab4a1c7657..ab4a1c7657 100644
--- a/test/core/support/percent_decode_corpus/9d316c4675f40ddccaf8f1cc7aea94170b1e4223
+++ b/test/core/slice/percent_decode_corpus/9d316c4675f40ddccaf8f1cc7aea94170b1e4223
diff --git a/test/core/support/percent_decode_corpus/ad1c7c11d18a7d116e2c2ef4d4c5afb1270836ae b/test/core/slice/percent_decode_corpus/ad1c7c11d18a7d116e2c2ef4d4c5afb1270836ae
index 4ac1945a84..4ac1945a84 100644
--- a/test/core/support/percent_decode_corpus/ad1c7c11d18a7d116e2c2ef4d4c5afb1270836ae
+++ b/test/core/slice/percent_decode_corpus/ad1c7c11d18a7d116e2c2ef4d4c5afb1270836ae
diff --git a/test/core/support/percent_decode_corpus/b471f94aa4facf502e622e4a248f1ba4063ae681 b/test/core/slice/percent_decode_corpus/b471f94aa4facf502e622e4a248f1ba4063ae681
index 5c673ae28a..5c673ae28a 100644
--- a/test/core/support/percent_decode_corpus/b471f94aa4facf502e622e4a248f1ba4063ae681
+++ b/test/core/slice/percent_decode_corpus/b471f94aa4facf502e622e4a248f1ba4063ae681
diff --git a/test/core/support/percent_decode_corpus/bf52ece030f16136d46e0dc97f58d60a0d8a1f0b b/test/core/slice/percent_decode_corpus/bf52ece030f16136d46e0dc97f58d60a0d8a1f0b
index e478275ed4..e478275ed4 100644
--- a/test/core/support/percent_decode_corpus/bf52ece030f16136d46e0dc97f58d60a0d8a1f0b
+++ b/test/core/slice/percent_decode_corpus/bf52ece030f16136d46e0dc97f58d60a0d8a1f0b
diff --git a/test/core/support/percent_decode_corpus/d5b2a7177339ba2b7ce2f60e5f4459bef1e72758 b/test/core/slice/percent_decode_corpus/d5b2a7177339ba2b7ce2f60e5f4459bef1e72758
index c73cbfe8af..c73cbfe8af 100644
--- a/test/core/support/percent_decode_corpus/d5b2a7177339ba2b7ce2f60e5f4459bef1e72758
+++ b/test/core/slice/percent_decode_corpus/d5b2a7177339ba2b7ce2f60e5f4459bef1e72758
diff --git a/test/core/support/percent_decode_corpus/de867b64c54a7ed773dc611fc5cd2f17c5433113 b/test/core/slice/percent_decode_corpus/de867b64c54a7ed773dc611fc5cd2f17c5433113
index f9f7246e9c..f9f7246e9c 100644
--- a/test/core/support/percent_decode_corpus/de867b64c54a7ed773dc611fc5cd2f17c5433113
+++ b/test/core/slice/percent_decode_corpus/de867b64c54a7ed773dc611fc5cd2f17c5433113
diff --git a/test/core/support/percent_decode_corpus/e3948dbe004950591630dd5c52f4e0fcbd5e388a b/test/core/slice/percent_decode_corpus/e3948dbe004950591630dd5c52f4e0fcbd5e388a
index 83ac46d833..83ac46d833 100644
--- a/test/core/support/percent_decode_corpus/e3948dbe004950591630dd5c52f4e0fcbd5e388a
+++ b/test/core/slice/percent_decode_corpus/e3948dbe004950591630dd5c52f4e0fcbd5e388a
diff --git a/test/core/support/percent_decode_corpus/e7064f0b80f61dbc65915311032d27baa569ae2a b/test/core/slice/percent_decode_corpus/e7064f0b80f61dbc65915311032d27baa569ae2a
index e8a0f87653..e8a0f87653 100644
--- a/test/core/support/percent_decode_corpus/e7064f0b80f61dbc65915311032d27baa569ae2a
+++ b/test/core/slice/percent_decode_corpus/e7064f0b80f61dbc65915311032d27baa569ae2a
diff --git a/test/core/support/percent_decode_corpus/xyz b/test/core/slice/percent_decode_corpus/xyz
index cd470e6190..cd470e6190 100644
--- a/test/core/support/percent_decode_corpus/xyz
+++ b/test/core/slice/percent_decode_corpus/xyz
diff --git a/test/core/support/percent_decode_fuzzer.c b/test/core/slice/percent_decode_fuzzer.c
index 3e02980e05..69d74816a7 100644
--- a/test/core/support/percent_decode_fuzzer.c
+++ b/test/core/slice/percent_decode_fuzzer.c
@@ -47,18 +47,18 @@ bool leak_check = true;
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
struct grpc_memory_counters counters;
grpc_memory_counters_init();
- gpr_slice input = gpr_slice_from_copied_buffer((const char *)data, size);
- gpr_slice output;
+ grpc_slice input = grpc_slice_from_copied_buffer((const char *)data, size);
+ grpc_slice output;
if (gpr_strict_percent_decode_slice(
input, gpr_url_percent_encoding_unreserved_bytes, &output)) {
- gpr_slice_unref(output);
+ grpc_slice_unref(output);
}
if (gpr_strict_percent_decode_slice(
input, gpr_compatible_percent_encoding_unreserved_bytes, &output)) {
- gpr_slice_unref(output);
+ grpc_slice_unref(output);
}
- gpr_slice_unref(gpr_permissive_percent_decode_slice(input));
- gpr_slice_unref(input);
+ grpc_slice_unref(gpr_permissive_percent_decode_slice(input));
+ grpc_slice_unref(input);
counters = grpc_memory_counters_snapshot();
grpc_memory_counters_destroy();
GPR_ASSERT(counters.total_size_relative == 0);
diff --git a/test/core/support/percent_encode_corpus/0d3ee7fa54e6c66103965fd4409b044ba7db6c3f b/test/core/slice/percent_encode_corpus/0d3ee7fa54e6c66103965fd4409b044ba7db6c3f
index d09c4a039c..d09c4a039c 100644
--- a/test/core/support/percent_encode_corpus/0d3ee7fa54e6c66103965fd4409b044ba7db6c3f
+++ b/test/core/slice/percent_encode_corpus/0d3ee7fa54e6c66103965fd4409b044ba7db6c3f
diff --git a/test/core/support/percent_encode_corpus/2e7ccf75e27b9501e3b28cf1c50ed0c45ab7c226 b/test/core/slice/percent_encode_corpus/2e7ccf75e27b9501e3b28cf1c50ed0c45ab7c226
index 4d0c38d0e2..4d0c38d0e2 100644
--- a/test/core/support/percent_encode_corpus/2e7ccf75e27b9501e3b28cf1c50ed0c45ab7c226
+++ b/test/core/slice/percent_encode_corpus/2e7ccf75e27b9501e3b28cf1c50ed0c45ab7c226
diff --git a/test/core/support/percent_encode_corpus/55bb859f3942c462b03b7cbcf22ab4a0ac9705cf b/test/core/slice/percent_encode_corpus/55bb859f3942c462b03b7cbcf22ab4a0ac9705cf
index fc6e93342a..fc6e93342a 100644
--- a/test/core/support/percent_encode_corpus/55bb859f3942c462b03b7cbcf22ab4a0ac9705cf
+++ b/test/core/slice/percent_encode_corpus/55bb859f3942c462b03b7cbcf22ab4a0ac9705cf
diff --git a/test/core/support/percent_encode_corpus/56070cecd54c845b6d4334953b17b712eb000d93 b/test/core/slice/percent_encode_corpus/56070cecd54c845b6d4334953b17b712eb000d93
index 6823c73f76..6823c73f76 100644
--- a/test/core/support/percent_encode_corpus/56070cecd54c845b6d4334953b17b712eb000d93
+++ b/test/core/slice/percent_encode_corpus/56070cecd54c845b6d4334953b17b712eb000d93
diff --git a/test/core/support/percent_encode_corpus/61f50e891bf7ff5eb7a7af206f1e25d77f8756e7 b/test/core/slice/percent_encode_corpus/61f50e891bf7ff5eb7a7af206f1e25d77f8756e7
index a65cbb4d5b..a65cbb4d5b 100644
--- a/test/core/support/percent_encode_corpus/61f50e891bf7ff5eb7a7af206f1e25d77f8756e7
+++ b/test/core/slice/percent_encode_corpus/61f50e891bf7ff5eb7a7af206f1e25d77f8756e7
diff --git a/test/core/support/percent_encode_corpus/6e0c60cefc704c7940e475a87dd9ae423061cb5a b/test/core/slice/percent_encode_corpus/6e0c60cefc704c7940e475a87dd9ae423061cb5a
index 8d031d7e2d..8d031d7e2d 100644
--- a/test/core/support/percent_encode_corpus/6e0c60cefc704c7940e475a87dd9ae423061cb5a
+++ b/test/core/slice/percent_encode_corpus/6e0c60cefc704c7940e475a87dd9ae423061cb5a
diff --git a/test/core/support/percent_encode_corpus/7271ebcc6d22a0f186f7bc3c1973a7ed1bec8d8e b/test/core/slice/percent_encode_corpus/7271ebcc6d22a0f186f7bc3c1973a7ed1bec8d8e
index 4d82ca3953..4d82ca3953 100644
--- a/test/core/support/percent_encode_corpus/7271ebcc6d22a0f186f7bc3c1973a7ed1bec8d8e
+++ b/test/core/slice/percent_encode_corpus/7271ebcc6d22a0f186f7bc3c1973a7ed1bec8d8e
diff --git a/test/core/support/percent_encode_corpus/74c83ece3e2920a67593a9be9c82468f16cbb969 b/test/core/slice/percent_encode_corpus/74c83ece3e2920a67593a9be9c82468f16cbb969
index bb7f4ae07e..bb7f4ae07e 100644
--- a/test/core/support/percent_encode_corpus/74c83ece3e2920a67593a9be9c82468f16cbb969
+++ b/test/core/slice/percent_encode_corpus/74c83ece3e2920a67593a9be9c82468f16cbb969
diff --git a/test/core/support/percent_encode_corpus/98e004fd2a9f141a7a019720820080e12d637c06 b/test/core/slice/percent_encode_corpus/98e004fd2a9f141a7a019720820080e12d637c06
index 50879d0f37..50879d0f37 100644
--- a/test/core/support/percent_encode_corpus/98e004fd2a9f141a7a019720820080e12d637c06
+++ b/test/core/slice/percent_encode_corpus/98e004fd2a9f141a7a019720820080e12d637c06
diff --git a/test/core/support/percent_encode_corpus/ba2c1e98227aa21ea3bb2ca4d0e504119717da8b b/test/core/slice/percent_encode_corpus/ba2c1e98227aa21ea3bb2ca4d0e504119717da8b
index dc1ab9bfc2..dc1ab9bfc2 100644
--- a/test/core/support/percent_encode_corpus/ba2c1e98227aa21ea3bb2ca4d0e504119717da8b
+++ b/test/core/slice/percent_encode_corpus/ba2c1e98227aa21ea3bb2ca4d0e504119717da8b
diff --git a/test/core/support/percent_encode_corpus/c16b9fd45370d4afb5d3ebd307a6e263c25ffd45 b/test/core/slice/percent_encode_corpus/c16b9fd45370d4afb5d3ebd307a6e263c25ffd45
index 3476e0b70b..3476e0b70b 100644
--- a/test/core/support/percent_encode_corpus/c16b9fd45370d4afb5d3ebd307a6e263c25ffd45
+++ b/test/core/slice/percent_encode_corpus/c16b9fd45370d4afb5d3ebd307a6e263c25ffd45
diff --git a/test/core/support/percent_encode_corpus/d58c3cd4eab9b6d2343abfa1c25c90a383fe0ec3 b/test/core/slice/percent_encode_corpus/d58c3cd4eab9b6d2343abfa1c25c90a383fe0ec3
index 822d50abf8..822d50abf8 100644
--- a/test/core/support/percent_encode_corpus/d58c3cd4eab9b6d2343abfa1c25c90a383fe0ec3
+++ b/test/core/slice/percent_encode_corpus/d58c3cd4eab9b6d2343abfa1c25c90a383fe0ec3
diff --git a/test/core/support/percent_encode_corpus/e2619218ede30d2b7b8ecd601a9f0ae754b728b4 b/test/core/slice/percent_encode_corpus/e2619218ede30d2b7b8ecd601a9f0ae754b728b4
index 101639c93d..101639c93d 100644
--- a/test/core/support/percent_encode_corpus/e2619218ede30d2b7b8ecd601a9f0ae754b728b4
+++ b/test/core/slice/percent_encode_corpus/e2619218ede30d2b7b8ecd601a9f0ae754b728b4
diff --git a/test/core/support/percent_encode_corpus/f93b3653e453f0e3eea3198001be6ce46e64bd21 b/test/core/slice/percent_encode_corpus/f93b3653e453f0e3eea3198001be6ce46e64bd21
index 6e07ab342f..6e07ab342f 100644
--- a/test/core/support/percent_encode_corpus/f93b3653e453f0e3eea3198001be6ce46e64bd21
+++ b/test/core/slice/percent_encode_corpus/f93b3653e453f0e3eea3198001be6ce46e64bd21
diff --git a/test/core/support/percent_encode_corpus/fd41d029c7682ad3d1c40a9fd017a4c85b673a54 b/test/core/slice/percent_encode_corpus/fd41d029c7682ad3d1c40a9fd017a4c85b673a54
index 13d7fab596..13d7fab596 100644
--- a/test/core/support/percent_encode_corpus/fd41d029c7682ad3d1c40a9fd017a4c85b673a54
+++ b/test/core/slice/percent_encode_corpus/fd41d029c7682ad3d1c40a9fd017a4c85b673a54
diff --git a/test/core/support/percent_encode_corpus/xyz b/test/core/slice/percent_encode_corpus/xyz
index cd470e6190..cd470e6190 100644
--- a/test/core/support/percent_encode_corpus/xyz
+++ b/test/core/slice/percent_encode_corpus/xyz
diff --git a/test/core/support/percent_encode_fuzzer.c b/test/core/slice/percent_encode_fuzzer.c
index c9548232b5..99599bf16e 100644
--- a/test/core/support/percent_encode_fuzzer.c
+++ b/test/core/slice/percent_encode_fuzzer.c
@@ -47,20 +47,20 @@ bool leak_check = true;
static void test(const uint8_t *data, size_t size, const uint8_t *dict) {
struct grpc_memory_counters counters;
grpc_memory_counters_init();
- gpr_slice input = gpr_slice_from_copied_buffer((const char *)data, size);
- gpr_slice output = gpr_percent_encode_slice(input, dict);
- gpr_slice decoded_output;
+ grpc_slice input = grpc_slice_from_copied_buffer((const char *)data, size);
+ grpc_slice output = gpr_percent_encode_slice(input, dict);
+ grpc_slice decoded_output;
// encoder must always produce decodable output
GPR_ASSERT(gpr_strict_percent_decode_slice(output, dict, &decoded_output));
- gpr_slice permissive_decoded_output =
+ grpc_slice permissive_decoded_output =
gpr_permissive_percent_decode_slice(output);
// and decoded output must always match the input
- GPR_ASSERT(gpr_slice_cmp(input, decoded_output) == 0);
- GPR_ASSERT(gpr_slice_cmp(input, permissive_decoded_output) == 0);
- gpr_slice_unref(input);
- gpr_slice_unref(output);
- gpr_slice_unref(decoded_output);
- gpr_slice_unref(permissive_decoded_output);
+ GPR_ASSERT(grpc_slice_cmp(input, decoded_output) == 0);
+ GPR_ASSERT(grpc_slice_cmp(input, permissive_decoded_output) == 0);
+ grpc_slice_unref(input);
+ grpc_slice_unref(output);
+ grpc_slice_unref(decoded_output);
+ grpc_slice_unref(permissive_decoded_output);
counters = grpc_memory_counters_snapshot();
grpc_memory_counters_destroy();
GPR_ASSERT(counters.total_size_relative == 0);
diff --git a/test/core/support/percent_encoding_test.c b/test/core/slice/percent_encoding_test.c
index ab5f3f2d14..e9ba8f5ec4 100644
--- a/test/core/support/percent_encoding_test.c
+++ b/test/core/slice/percent_encoding_test.c
@@ -56,14 +56,14 @@ static void test_vector(const char *raw, size_t raw_length, const char *encoded,
gpr_free(raw_msg);
gpr_free(encoded_msg);
- gpr_slice raw_slice = gpr_slice_from_copied_buffer(raw, raw_length);
- gpr_slice encoded_slice =
- gpr_slice_from_copied_buffer(encoded, encoded_length);
- gpr_slice raw2encoded_slice = gpr_percent_encode_slice(raw_slice, dict);
- gpr_slice encoded2raw_slice;
+ grpc_slice raw_slice = grpc_slice_from_copied_buffer(raw, raw_length);
+ grpc_slice encoded_slice =
+ grpc_slice_from_copied_buffer(encoded, encoded_length);
+ grpc_slice raw2encoded_slice = gpr_percent_encode_slice(raw_slice, dict);
+ grpc_slice encoded2raw_slice;
GPR_ASSERT(
gpr_strict_percent_decode_slice(encoded_slice, dict, &encoded2raw_slice));
- gpr_slice encoded2raw_permissive_slice =
+ grpc_slice encoded2raw_permissive_slice =
gpr_permissive_percent_decode_slice(encoded_slice);
char *raw2encoded_msg =
@@ -80,15 +80,15 @@ static void test_vector(const char *raw, size_t raw_length, const char *encoded,
gpr_free(encoded2raw_msg);
gpr_free(encoded2raw_permissive_msg);
- GPR_ASSERT(0 == gpr_slice_cmp(raw_slice, encoded2raw_slice));
- GPR_ASSERT(0 == gpr_slice_cmp(raw_slice, encoded2raw_permissive_slice));
- GPR_ASSERT(0 == gpr_slice_cmp(encoded_slice, raw2encoded_slice));
+ GPR_ASSERT(0 == grpc_slice_cmp(raw_slice, encoded2raw_slice));
+ GPR_ASSERT(0 == grpc_slice_cmp(raw_slice, encoded2raw_permissive_slice));
+ GPR_ASSERT(0 == grpc_slice_cmp(encoded_slice, raw2encoded_slice));
- gpr_slice_unref(encoded2raw_slice);
- gpr_slice_unref(encoded2raw_permissive_slice);
- gpr_slice_unref(raw2encoded_slice);
- gpr_slice_unref(raw_slice);
- gpr_slice_unref(encoded_slice);
+ grpc_slice_unref(encoded2raw_slice);
+ grpc_slice_unref(encoded2raw_permissive_slice);
+ grpc_slice_unref(raw2encoded_slice);
+ grpc_slice_unref(raw_slice);
+ grpc_slice_unref(encoded_slice);
}
static void test_nonconformant_vector(const char *encoded,
@@ -106,14 +106,14 @@ static void test_nonconformant_vector(const char *encoded,
gpr_free(permissive_unencoded_msg);
gpr_free(encoded_msg);
- gpr_slice permissive_unencoded_slice = gpr_slice_from_copied_buffer(
+ grpc_slice permissive_unencoded_slice = grpc_slice_from_copied_buffer(
permissive_unencoded, permissive_unencoded_length);
- gpr_slice encoded_slice =
- gpr_slice_from_copied_buffer(encoded, encoded_length);
- gpr_slice encoded2raw_slice;
+ grpc_slice encoded_slice =
+ grpc_slice_from_copied_buffer(encoded, encoded_length);
+ grpc_slice encoded2raw_slice;
GPR_ASSERT(!gpr_strict_percent_decode_slice(encoded_slice, dict,
&encoded2raw_slice));
- gpr_slice encoded2raw_permissive_slice =
+ grpc_slice encoded2raw_permissive_slice =
gpr_permissive_percent_decode_slice(encoded_slice);
char *encoded2raw_permissive_msg = gpr_dump_slice(
@@ -122,12 +122,12 @@ static void test_nonconformant_vector(const char *encoded,
encoded2raw_permissive_msg);
gpr_free(encoded2raw_permissive_msg);
- GPR_ASSERT(0 == gpr_slice_cmp(permissive_unencoded_slice,
+ GPR_ASSERT(0 == grpc_slice_cmp(permissive_unencoded_slice,
encoded2raw_permissive_slice));
- gpr_slice_unref(permissive_unencoded_slice);
- gpr_slice_unref(encoded2raw_permissive_slice);
- gpr_slice_unref(encoded_slice);
+ grpc_slice_unref(permissive_unencoded_slice);
+ grpc_slice_unref(encoded2raw_permissive_slice);
+ grpc_slice_unref(encoded_slice);
}
int main(int argc, char **argv) {
diff --git a/test/core/support/slice_buffer_test.c b/test/core/slice/slice_buffer_test.c
index cf2da84c2b..9c55a5c473 100644
--- a/test/core/support/slice_buffer_test.c
+++ b/test/core/slice/slice_buffer_test.c
@@ -36,67 +36,67 @@
#include "test/core/util/test_config.h"
void test_slice_buffer_add() {
- gpr_slice_buffer buf;
- gpr_slice aaa = gpr_slice_from_copied_string("aaa");
- gpr_slice bb = gpr_slice_from_copied_string("bb");
+ grpc_slice_buffer buf;
+ grpc_slice aaa = grpc_slice_from_copied_string("aaa");
+ grpc_slice bb = grpc_slice_from_copied_string("bb");
size_t i;
- gpr_slice_buffer_init(&buf);
+ grpc_slice_buffer_init(&buf);
for (i = 0; i < 10; i++) {
- gpr_slice_ref(aaa);
- gpr_slice_ref(bb);
- gpr_slice_buffer_add(&buf, aaa);
- gpr_slice_buffer_add(&buf, bb);
+ grpc_slice_ref(aaa);
+ grpc_slice_ref(bb);
+ grpc_slice_buffer_add(&buf, aaa);
+ grpc_slice_buffer_add(&buf, bb);
}
GPR_ASSERT(buf.count > 0);
GPR_ASSERT(buf.length == 50);
- gpr_slice_buffer_reset_and_unref(&buf);
+ grpc_slice_buffer_reset_and_unref(&buf);
GPR_ASSERT(buf.count == 0);
GPR_ASSERT(buf.length == 0);
for (i = 0; i < 10; i++) {
- gpr_slice_ref(aaa);
- gpr_slice_ref(bb);
- gpr_slice_buffer_add(&buf, aaa);
- gpr_slice_buffer_add(&buf, bb);
+ grpc_slice_ref(aaa);
+ grpc_slice_ref(bb);
+ grpc_slice_buffer_add(&buf, aaa);
+ grpc_slice_buffer_add(&buf, bb);
}
GPR_ASSERT(buf.count > 0);
GPR_ASSERT(buf.length == 50);
for (i = 0; i < 10; i++) {
- gpr_slice_buffer_pop(&buf);
- gpr_slice_unref(aaa);
- gpr_slice_unref(bb);
+ grpc_slice_buffer_pop(&buf);
+ grpc_slice_unref(aaa);
+ grpc_slice_unref(bb);
}
GPR_ASSERT(buf.count == 0);
GPR_ASSERT(buf.length == 0);
- gpr_slice_buffer_destroy(&buf);
+ grpc_slice_buffer_destroy(&buf);
}
void test_slice_buffer_move_first() {
- gpr_slice slices[3];
- gpr_slice_buffer src;
- gpr_slice_buffer dst;
+ grpc_slice slices[3];
+ grpc_slice_buffer src;
+ grpc_slice_buffer dst;
int idx = 0;
size_t src_len = 0;
size_t dst_len = 0;
- slices[0] = gpr_slice_from_copied_string("aaa");
- slices[1] = gpr_slice_from_copied_string("bbbb");
- slices[2] = gpr_slice_from_copied_string("ccc");
+ slices[0] = grpc_slice_from_copied_string("aaa");
+ slices[1] = grpc_slice_from_copied_string("bbbb");
+ slices[2] = grpc_slice_from_copied_string("ccc");
- gpr_slice_buffer_init(&src);
- gpr_slice_buffer_init(&dst);
+ grpc_slice_buffer_init(&src);
+ grpc_slice_buffer_init(&dst);
for (idx = 0; idx < 3; idx++) {
- gpr_slice_ref(slices[idx]);
+ grpc_slice_ref(slices[idx]);
/* For this test, it is important that we add each slice at a new
slice index */
- gpr_slice_buffer_add_indexed(&src, slices[idx]);
- gpr_slice_buffer_add_indexed(&dst, slices[idx]);
+ grpc_slice_buffer_add_indexed(&src, slices[idx]);
+ grpc_slice_buffer_add_indexed(&dst, slices[idx]);
}
/* Case 1: Move more than the first slice's length from src to dst */
src_len = src.length;
dst_len = dst.length;
- gpr_slice_buffer_move_first(&src, 4, &dst);
+ grpc_slice_buffer_move_first(&src, 4, &dst);
src_len -= 4;
dst_len += 4;
GPR_ASSERT(src.length == src_len);
@@ -104,7 +104,7 @@ void test_slice_buffer_move_first() {
/* src now has two slices ["bbb"] and ["ccc"] */
/* Case 2: Move the first slice from src to dst */
- gpr_slice_buffer_move_first(&src, 3, &dst);
+ grpc_slice_buffer_move_first(&src, 3, &dst);
src_len -= 3;
dst_len += 3;
GPR_ASSERT(src.length == src_len);
@@ -112,7 +112,7 @@ void test_slice_buffer_move_first() {
/* src now has one slice ["ccc"] */
/* Case 3: Move less than the first slice's length from src to dst*/
- gpr_slice_buffer_move_first(&src, 2, &dst);
+ grpc_slice_buffer_move_first(&src, 2, &dst);
src_len -= 2;
dst_len += 2;
GPR_ASSERT(src.length == src.length);
diff --git a/test/core/slice/slice_string_helpers_test.c b/test/core/slice/slice_string_helpers_test.c
new file mode 100644
index 0000000000..d3dbb1e7f9
--- /dev/null
+++ b/test/core/slice/slice_string_helpers_test.c
@@ -0,0 +1,148 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "src/core/lib/support/string.h"
+
+#include <limits.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/useful.h>
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x)
+
+static void expect_slice_dump(grpc_slice slice, uint32_t flags,
+ const char *result) {
+ char *got = gpr_dump_slice(slice, flags);
+ GPR_ASSERT(0 == strcmp(got, result));
+ gpr_free(got);
+ grpc_slice_unref(slice);
+}
+
+static void test_dump_slice(void) {
+ static const char *text = "HELLO WORLD!";
+ static const char *long_text =
+ "It was a bright cold day in April, and the clocks were striking "
+ "thirteen. Winston Smith, his chin nuzzled into his breast in an effort "
+ "to escape the vile wind, slipped quickly through the glass doors of "
+ "Victory Mansions, though not quickly enough to prevent a swirl of "
+ "gritty dust from entering along with him.";
+
+ LOG_TEST_NAME("test_dump_slice");
+
+ expect_slice_dump(grpc_slice_from_copied_string(text), GPR_DUMP_ASCII, text);
+ expect_slice_dump(grpc_slice_from_copied_string(long_text), GPR_DUMP_ASCII,
+ long_text);
+ expect_slice_dump(grpc_slice_from_copied_buffer("\x01", 1), GPR_DUMP_HEX,
+ "01");
+ expect_slice_dump(grpc_slice_from_copied_buffer("\x01", 1),
+ GPR_DUMP_HEX | GPR_DUMP_ASCII, "01 '.'");
+}
+
+static void test_strsplit(void) {
+ grpc_slice_buffer *parts;
+ grpc_slice str;
+
+ LOG_TEST_NAME("test_strsplit");
+
+ parts = gpr_malloc(sizeof(grpc_slice_buffer));
+ grpc_slice_buffer_init(parts);
+
+ str = grpc_slice_from_copied_string("one, two, three, four");
+ grpc_slice_split(str, ", ", parts);
+ GPR_ASSERT(4 == parts->count);
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], "one"));
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], "two"));
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[2], "three"));
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[3], "four"));
+ grpc_slice_buffer_reset_and_unref(parts);
+ grpc_slice_unref(str);
+
+ /* separator not present in string */
+ str = grpc_slice_from_copied_string("one two three four");
+ grpc_slice_split(str, ", ", parts);
+ GPR_ASSERT(1 == parts->count);
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], "one two three four"));
+ grpc_slice_buffer_reset_and_unref(parts);
+ grpc_slice_unref(str);
+
+ /* separator at the end */
+ str = grpc_slice_from_copied_string("foo,");
+ grpc_slice_split(str, ",", parts);
+ GPR_ASSERT(2 == parts->count);
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], "foo"));
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], ""));
+ grpc_slice_buffer_reset_and_unref(parts);
+ grpc_slice_unref(str);
+
+ /* separator at the beginning */
+ str = grpc_slice_from_copied_string(",foo");
+ grpc_slice_split(str, ",", parts);
+ GPR_ASSERT(2 == parts->count);
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], ""));
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], "foo"));
+ grpc_slice_buffer_reset_and_unref(parts);
+ grpc_slice_unref(str);
+
+ /* standalone separator */
+ str = grpc_slice_from_copied_string(",");
+ grpc_slice_split(str, ",", parts);
+ GPR_ASSERT(2 == parts->count);
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], ""));
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], ""));
+ grpc_slice_buffer_reset_and_unref(parts);
+ grpc_slice_unref(str);
+
+ /* empty input */
+ str = grpc_slice_from_copied_string("");
+ grpc_slice_split(str, ", ", parts);
+ GPR_ASSERT(1 == parts->count);
+ GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], ""));
+ grpc_slice_buffer_reset_and_unref(parts);
+ grpc_slice_unref(str);
+
+ grpc_slice_buffer_destroy(parts);
+ gpr_free(parts);
+}
+
+int main(int argc, char **argv) {
+ grpc_test_init(argc, argv);
+ test_dump_slice();
+ test_strsplit();
+ return 0;
+}
diff --git a/test/core/support/slice_test.c b/test/core/slice/slice_test.c
index 06c364b368..c263fe27d6 100644
--- a/test/core/support/slice_test.c
+++ b/test/core/slice/slice_test.c
@@ -42,16 +42,16 @@
#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x);
static void test_slice_malloc_returns_something_sensible(void) {
- /* Calls gpr_slice_create for various lengths and verifies the internals for
+ /* Calls grpc_slice_create for various lengths and verifies the internals for
consistency. */
size_t length;
size_t i;
- gpr_slice slice;
+ grpc_slice slice;
LOG_TEST_NAME("test_slice_malloc_returns_something_sensible");
for (length = 0; length <= 1024; length++) {
- slice = gpr_slice_malloc(length);
+ slice = grpc_slice_malloc(length);
/* If there is a length, slice.data must be non-NULL. If length is zero
we don't care. */
if (length) {
@@ -69,7 +69,7 @@ static void test_slice_malloc_returns_something_sensible(void) {
GPR_SLICE_START_PTR(slice)[i] = (uint8_t)i;
}
/* And finally we must succeed in destroying the slice */
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
}
@@ -78,11 +78,11 @@ static void do_nothing(void *ignored) {}
static void test_slice_new_returns_something_sensible(void) {
uint8_t x;
- gpr_slice slice = gpr_slice_new(&x, 1, do_nothing);
+ grpc_slice slice = grpc_slice_new(&x, 1, do_nothing);
GPR_ASSERT(slice.refcount);
GPR_ASSERT(slice.data.refcounted.bytes == &x);
GPR_ASSERT(slice.data.refcounted.length == 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
/* destroy function that sets a mark to indicate it was called. */
@@ -91,18 +91,18 @@ static void set_mark(void *p) { *((int *)p) = 1; }
static void test_slice_new_with_user_data(void) {
int marker = 0;
uint8_t buf[2];
- gpr_slice slice;
+ grpc_slice slice;
buf[0] = 0;
buf[1] = 1;
- slice = gpr_slice_new_with_user_data(buf, 2, set_mark, &marker);
+ slice = grpc_slice_new_with_user_data(buf, 2, set_mark, &marker);
GPR_ASSERT(marker == 0);
GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 2);
GPR_ASSERT(GPR_SLICE_START_PTR(slice)[0] == 0);
GPR_ASSERT(GPR_SLICE_START_PTR(slice)[1] == 1);
/* unref should cause destroy function to run. */
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
GPR_ASSERT(marker == 1);
}
@@ -118,7 +118,7 @@ static void test_slice_new_with_len_returns_something_sensible(void) {
int num_refs = 5; /* To test adding/removing an arbitrary number of refs */
int i;
- gpr_slice slice = gpr_slice_new_with_len(&x, 1, do_nothing_with_len_1);
+ grpc_slice slice = grpc_slice_new_with_len(&x, 1, do_nothing_with_len_1);
GPR_ASSERT(slice.refcount); /* ref count is initialized to 1 at this point */
GPR_ASSERT(slice.data.refcounted.bytes == &x);
GPR_ASSERT(slice.data.refcounted.length == 1);
@@ -128,21 +128,21 @@ static void test_slice_new_with_len_returns_something_sensible(void) {
make sure that that the destroy callback (i.e do_nothing_with_len_1()) is
not called until the last unref operation */
for (i = 0; i < num_refs; i++) {
- gpr_slice_ref(slice);
+ grpc_slice_ref(slice);
}
for (i = 0; i < num_refs; i++) {
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
GPR_ASSERT(do_nothing_with_len_1_calls == 0); /* Shouldn't be called yet */
/* last unref */
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
GPR_ASSERT(do_nothing_with_len_1_calls == 1);
}
static void test_slice_sub_works(unsigned length) {
- gpr_slice slice;
- gpr_slice sub;
+ grpc_slice slice;
+ grpc_slice sub;
unsigned i, j, k;
LOG_TEST_NAME("test_slice_sub_works");
@@ -150,7 +150,7 @@ static void test_slice_sub_works(unsigned length) {
/* Create a slice in which each byte is equal to the distance from it to the
beginning of the slice. */
- slice = gpr_slice_malloc(length);
+ slice = grpc_slice_malloc(length);
for (i = 0; i < length; i++) {
GPR_SLICE_START_PTR(slice)[i] = (uint8_t)i;
}
@@ -159,18 +159,18 @@ static void test_slice_sub_works(unsigned length) {
correct byte. Additionally check that no copies were made. */
for (i = 0; i < length; i++) {
for (j = i; j < length; j++) {
- sub = gpr_slice_sub(slice, i, j);
+ sub = grpc_slice_sub(slice, i, j);
GPR_ASSERT(GPR_SLICE_LENGTH(sub) == j - i);
for (k = 0; k < j - i; k++) {
GPR_ASSERT(GPR_SLICE_START_PTR(sub)[k] == (uint8_t)(i + k));
}
- gpr_slice_unref(sub);
+ grpc_slice_unref(sub);
}
}
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
-static void check_head_tail(gpr_slice slice, gpr_slice head, gpr_slice tail) {
+static void check_head_tail(grpc_slice slice, grpc_slice head, grpc_slice tail) {
GPR_ASSERT(GPR_SLICE_LENGTH(slice) ==
GPR_SLICE_LENGTH(head) + GPR_SLICE_LENGTH(tail));
GPR_ASSERT(0 == memcmp(GPR_SLICE_START_PTR(slice), GPR_SLICE_START_PTR(head),
@@ -180,8 +180,8 @@ static void check_head_tail(gpr_slice slice, gpr_slice head, gpr_slice tail) {
}
static void test_slice_split_head_works(size_t length) {
- gpr_slice slice;
- gpr_slice head, tail;
+ grpc_slice slice;
+ grpc_slice head, tail;
size_t i;
LOG_TEST_NAME("test_slice_split_head_works");
@@ -189,7 +189,7 @@ static void test_slice_split_head_works(size_t length) {
/* Create a slice in which each byte is equal to the distance from it to the
beginning of the slice. */
- slice = gpr_slice_malloc(length);
+ slice = grpc_slice_malloc(length);
for (i = 0; i < length; i++) {
GPR_SLICE_START_PTR(slice)[i] = (uint8_t)i;
}
@@ -197,19 +197,19 @@ static void test_slice_split_head_works(size_t length) {
/* Ensure that for all subsets length is correct and that we start on the
correct byte. Additionally check that no copies were made. */
for (i = 0; i < length; i++) {
- tail = gpr_slice_ref(slice);
- head = gpr_slice_split_head(&tail, i);
+ tail = grpc_slice_ref(slice);
+ head = grpc_slice_split_head(&tail, i);
check_head_tail(slice, head, tail);
- gpr_slice_unref(tail);
- gpr_slice_unref(head);
+ grpc_slice_unref(tail);
+ grpc_slice_unref(head);
}
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
static void test_slice_split_tail_works(size_t length) {
- gpr_slice slice;
- gpr_slice head, tail;
+ grpc_slice slice;
+ grpc_slice head, tail;
size_t i;
LOG_TEST_NAME("test_slice_split_tail_works");
@@ -217,7 +217,7 @@ static void test_slice_split_tail_works(size_t length) {
/* Create a slice in which each byte is equal to the distance from it to the
beginning of the slice. */
- slice = gpr_slice_malloc(length);
+ slice = grpc_slice_malloc(length);
for (i = 0; i < length; i++) {
GPR_SLICE_START_PTR(slice)[i] = (uint8_t)i;
}
@@ -225,27 +225,27 @@ static void test_slice_split_tail_works(size_t length) {
/* Ensure that for all subsets length is correct and that we start on the
correct byte. Additionally check that no copies were made. */
for (i = 0; i < length; i++) {
- head = gpr_slice_ref(slice);
- tail = gpr_slice_split_tail(&head, i);
+ head = grpc_slice_ref(slice);
+ tail = grpc_slice_split_tail(&head, i);
check_head_tail(slice, head, tail);
- gpr_slice_unref(tail);
- gpr_slice_unref(head);
+ grpc_slice_unref(tail);
+ grpc_slice_unref(head);
}
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
static void test_slice_from_copied_string_works(void) {
static const char *text = "HELLO WORLD!";
- gpr_slice slice;
+ grpc_slice slice;
LOG_TEST_NAME("test_slice_from_copied_string_works");
- slice = gpr_slice_from_copied_string(text);
+ slice = grpc_slice_from_copied_string(text);
GPR_ASSERT(strlen(text) == GPR_SLICE_LENGTH(slice));
GPR_ASSERT(0 ==
memcmp(text, GPR_SLICE_START_PTR(slice), GPR_SLICE_LENGTH(slice)));
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
}
int main(int argc, char **argv) {
diff --git a/test/core/support/string_test.c b/test/core/support/string_test.c
index 378e45a942..53709ed6f7 100644
--- a/test/core/support/string_test.c
+++ b/test/core/support/string_test.c
@@ -76,34 +76,6 @@ static void test_dump(void) {
expect_dump("ab", 2, GPR_DUMP_HEX | GPR_DUMP_ASCII, "61 62 'ab'");
}
-static void expect_slice_dump(gpr_slice slice, uint32_t flags,
- const char *result) {
- char *got = gpr_dump_slice(slice, flags);
- GPR_ASSERT(0 == strcmp(got, result));
- gpr_free(got);
- gpr_slice_unref(slice);
-}
-
-static void test_dump_slice(void) {
- static const char *text = "HELLO WORLD!";
- static const char *long_text =
- "It was a bright cold day in April, and the clocks were striking "
- "thirteen. Winston Smith, his chin nuzzled into his breast in an effort "
- "to escape the vile wind, slipped quickly through the glass doors of "
- "Victory Mansions, though not quickly enough to prevent a swirl of "
- "gritty dust from entering along with him.";
-
- LOG_TEST_NAME("test_dump_slice");
-
- expect_slice_dump(gpr_slice_from_copied_string(text), GPR_DUMP_ASCII, text);
- expect_slice_dump(gpr_slice_from_copied_string(long_text), GPR_DUMP_ASCII,
- long_text);
- expect_slice_dump(gpr_slice_from_copied_buffer("\x01", 1), GPR_DUMP_HEX,
- "01");
- expect_slice_dump(gpr_slice_from_copied_buffer("\x01", 1),
- GPR_DUMP_HEX | GPR_DUMP_ASCII, "01 '.'");
-}
-
static void test_pu32_fail(const char *s) {
uint32_t out;
GPR_ASSERT(!gpr_parse_bytes_to_uint32(s, strlen(s), &out));
@@ -221,72 +193,6 @@ static void test_strjoin_sep(void) {
gpr_free(joined);
}
-static void test_strsplit(void) {
- gpr_slice_buffer *parts;
- gpr_slice str;
-
- LOG_TEST_NAME("test_strsplit");
-
- parts = gpr_malloc(sizeof(gpr_slice_buffer));
- gpr_slice_buffer_init(parts);
-
- str = gpr_slice_from_copied_string("one, two, three, four");
- gpr_slice_split(str, ", ", parts);
- GPR_ASSERT(4 == parts->count);
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[0], "one"));
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[1], "two"));
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[2], "three"));
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[3], "four"));
- gpr_slice_buffer_reset_and_unref(parts);
- gpr_slice_unref(str);
-
- /* separator not present in string */
- str = gpr_slice_from_copied_string("one two three four");
- gpr_slice_split(str, ", ", parts);
- GPR_ASSERT(1 == parts->count);
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[0], "one two three four"));
- gpr_slice_buffer_reset_and_unref(parts);
- gpr_slice_unref(str);
-
- /* separator at the end */
- str = gpr_slice_from_copied_string("foo,");
- gpr_slice_split(str, ",", parts);
- GPR_ASSERT(2 == parts->count);
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[0], "foo"));
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[1], ""));
- gpr_slice_buffer_reset_and_unref(parts);
- gpr_slice_unref(str);
-
- /* separator at the beginning */
- str = gpr_slice_from_copied_string(",foo");
- gpr_slice_split(str, ",", parts);
- GPR_ASSERT(2 == parts->count);
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[0], ""));
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[1], "foo"));
- gpr_slice_buffer_reset_and_unref(parts);
- gpr_slice_unref(str);
-
- /* standalone separator */
- str = gpr_slice_from_copied_string(",");
- gpr_slice_split(str, ",", parts);
- GPR_ASSERT(2 == parts->count);
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[0], ""));
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[1], ""));
- gpr_slice_buffer_reset_and_unref(parts);
- gpr_slice_unref(str);
-
- /* empty input */
- str = gpr_slice_from_copied_string("");
- gpr_slice_split(str, ", ", parts);
- GPR_ASSERT(1 == parts->count);
- GPR_ASSERT(0 == gpr_slice_str_cmp(parts->slices[0], ""));
- gpr_slice_buffer_reset_and_unref(parts);
- gpr_slice_unref(str);
-
- gpr_slice_buffer_destroy(parts);
- gpr_free(parts);
-}
-
static void test_ltoa() {
char *str;
char buf[GPR_LTOA_MIN_BUFSIZE];
diff --git a/test/core/surface/byte_buffer_reader_test.c b/test/core/surface/byte_buffer_reader_test.c
index 1ab1a06211..eafeb04b11 100644
--- a/test/core/surface/byte_buffer_reader_test.c
+++ b/test/core/surface/byte_buffer_reader_test.c
@@ -49,102 +49,102 @@
#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
static void test_read_one_slice(void) {
- gpr_slice slice;
+ grpc_slice slice;
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader reader;
- gpr_slice first_slice, second_slice;
+ grpc_slice first_slice, second_slice;
int first_code, second_code;
LOG_TEST("test_read_one_slice");
- slice = gpr_slice_from_copied_string("test");
+ slice = grpc_slice_from_copied_string("test");
buffer = grpc_raw_byte_buffer_create(&slice, 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
"Couldn't init byte buffer reader");
first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
GPR_ASSERT(first_code != 0);
GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(first_slice), "test", 4) == 0);
- gpr_slice_unref(first_slice);
+ grpc_slice_unref(first_slice);
second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
GPR_ASSERT(second_code == 0);
grpc_byte_buffer_destroy(buffer);
}
static void test_read_one_slice_malloc(void) {
- gpr_slice slice;
+ grpc_slice slice;
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader reader;
- gpr_slice first_slice, second_slice;
+ grpc_slice first_slice, second_slice;
int first_code, second_code;
LOG_TEST("test_read_one_slice_malloc");
- slice = gpr_slice_malloc(4);
+ slice = grpc_slice_malloc(4);
memcpy(GPR_SLICE_START_PTR(slice), "test", 4);
buffer = grpc_raw_byte_buffer_create(&slice, 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
"Couldn't init byte buffer reader");
first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
GPR_ASSERT(first_code != 0);
GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(first_slice), "test", 4) == 0);
- gpr_slice_unref(first_slice);
+ grpc_slice_unref(first_slice);
second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
GPR_ASSERT(second_code == 0);
grpc_byte_buffer_destroy(buffer);
}
static void test_read_none_compressed_slice(void) {
- gpr_slice slice;
+ grpc_slice slice;
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader reader;
- gpr_slice first_slice, second_slice;
+ grpc_slice first_slice, second_slice;
int first_code, second_code;
LOG_TEST("test_read_none_compressed_slice");
- slice = gpr_slice_from_copied_string("test");
+ slice = grpc_slice_from_copied_string("test");
buffer = grpc_raw_byte_buffer_create(&slice, 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
"Couldn't init byte buffer reader");
first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
GPR_ASSERT(first_code != 0);
GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(first_slice), "test", 4) == 0);
- gpr_slice_unref(first_slice);
+ grpc_slice_unref(first_slice);
second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
GPR_ASSERT(second_code == 0);
grpc_byte_buffer_destroy(buffer);
}
static void test_read_corrupted_slice(void) {
- gpr_slice slice;
+ grpc_slice slice;
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader reader;
LOG_TEST("test_read_corrupted_slice");
- slice = gpr_slice_from_copied_string("test");
+ slice = grpc_slice_from_copied_string("test");
buffer = grpc_raw_byte_buffer_create(&slice, 1);
buffer->data.raw.compression = GRPC_COMPRESS_GZIP; /* lies! */
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
GPR_ASSERT(!grpc_byte_buffer_reader_init(&reader, buffer));
grpc_byte_buffer_destroy(buffer);
}
static void read_compressed_slice(grpc_compression_algorithm algorithm,
size_t input_size) {
- gpr_slice input_slice;
- gpr_slice_buffer sliceb_in;
- gpr_slice_buffer sliceb_out;
+ grpc_slice input_slice;
+ grpc_slice_buffer sliceb_in;
+ grpc_slice_buffer sliceb_out;
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader reader;
- gpr_slice read_slice;
+ grpc_slice read_slice;
size_t read_count = 0;
- gpr_slice_buffer_init(&sliceb_in);
- gpr_slice_buffer_init(&sliceb_out);
+ grpc_slice_buffer_init(&sliceb_in);
+ grpc_slice_buffer_init(&sliceb_out);
- input_slice = gpr_slice_malloc(input_size);
+ input_slice = grpc_slice_malloc(input_size);
memset(GPR_SLICE_START_PTR(input_slice), 'a', input_size);
- gpr_slice_buffer_add(&sliceb_in, input_slice); /* takes ownership */
+ grpc_slice_buffer_add(&sliceb_in, input_slice); /* takes ownership */
GPR_ASSERT(grpc_msg_compress(algorithm, &sliceb_in, &sliceb_out));
buffer = grpc_raw_compressed_byte_buffer_create(sliceb_out.slices,
@@ -157,13 +157,13 @@ static void read_compressed_slice(grpc_compression_algorithm algorithm,
GPR_SLICE_START_PTR(input_slice) + read_count,
GPR_SLICE_LENGTH(read_slice)) == 0);
read_count += GPR_SLICE_LENGTH(read_slice);
- gpr_slice_unref(read_slice);
+ grpc_slice_unref(read_slice);
}
GPR_ASSERT(read_count == input_size);
grpc_byte_buffer_reader_destroy(&reader);
grpc_byte_buffer_destroy(buffer);
- gpr_slice_buffer_destroy(&sliceb_out);
- gpr_slice_buffer_destroy(&sliceb_in);
+ grpc_slice_buffer_destroy(&sliceb_out);
+ grpc_slice_buffer_destroy(&sliceb_in);
}
static void test_read_gzip_compressed_slice(void) {
@@ -179,15 +179,15 @@ static void test_read_deflate_compressed_slice(void) {
}
static void test_byte_buffer_from_reader(void) {
- gpr_slice slice;
+ grpc_slice slice;
grpc_byte_buffer *buffer, *buffer_from_reader;
grpc_byte_buffer_reader reader;
LOG_TEST("test_byte_buffer_from_reader");
- slice = gpr_slice_malloc(4);
+ slice = grpc_slice_malloc(4);
memcpy(GPR_SLICE_START_PTR(slice), "test", 4);
buffer = grpc_raw_byte_buffer_create(&slice, 1);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
"Couldn't init byte buffer reader");
@@ -206,24 +206,24 @@ static void test_byte_buffer_from_reader(void) {
static void test_readall(void) {
char *lotsa_as[512];
char *lotsa_bs[1024];
- gpr_slice slices[2];
+ grpc_slice slices[2];
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader reader;
- gpr_slice slice_out;
+ grpc_slice slice_out;
LOG_TEST("test_readall");
memset(lotsa_as, 'a', 512);
memset(lotsa_bs, 'b', 1024);
/* use slices large enough to overflow inlining */
- slices[0] = gpr_slice_malloc(512);
+ slices[0] = grpc_slice_malloc(512);
memcpy(GPR_SLICE_START_PTR(slices[0]), lotsa_as, 512);
- slices[1] = gpr_slice_malloc(1024);
+ slices[1] = grpc_slice_malloc(1024);
memcpy(GPR_SLICE_START_PTR(slices[1]), lotsa_bs, 1024);
buffer = grpc_raw_byte_buffer_create(slices, 2);
- gpr_slice_unref(slices[0]);
- gpr_slice_unref(slices[1]);
+ grpc_slice_unref(slices[0]);
+ grpc_slice_unref(slices[1]);
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
"Couldn't init byte buffer reader");
@@ -233,32 +233,32 @@ static void test_readall(void) {
GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(slice_out), lotsa_as, 512) == 0);
GPR_ASSERT(memcmp(&(GPR_SLICE_START_PTR(slice_out)[512]), lotsa_bs, 1024) ==
0);
- gpr_slice_unref(slice_out);
+ grpc_slice_unref(slice_out);
grpc_byte_buffer_destroy(buffer);
}
static void test_byte_buffer_copy(void) {
char *lotsa_as[512];
char *lotsa_bs[1024];
- gpr_slice slices[2];
+ grpc_slice slices[2];
grpc_byte_buffer *buffer;
grpc_byte_buffer *copied_buffer;
grpc_byte_buffer_reader reader;
- gpr_slice slice_out;
+ grpc_slice slice_out;
LOG_TEST("test_byte_buffer_copy");
memset(lotsa_as, 'a', 512);
memset(lotsa_bs, 'b', 1024);
/* use slices large enough to overflow inlining */
- slices[0] = gpr_slice_malloc(512);
+ slices[0] = grpc_slice_malloc(512);
memcpy(GPR_SLICE_START_PTR(slices[0]), lotsa_as, 512);
- slices[1] = gpr_slice_malloc(1024);
+ slices[1] = grpc_slice_malloc(1024);
memcpy(GPR_SLICE_START_PTR(slices[1]), lotsa_bs, 1024);
buffer = grpc_raw_byte_buffer_create(slices, 2);
- gpr_slice_unref(slices[0]);
- gpr_slice_unref(slices[1]);
+ grpc_slice_unref(slices[0]);
+ grpc_slice_unref(slices[1]);
copied_buffer = grpc_byte_buffer_copy(buffer);
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
@@ -269,7 +269,7 @@ static void test_byte_buffer_copy(void) {
GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(slice_out), lotsa_as, 512) == 0);
GPR_ASSERT(memcmp(&(GPR_SLICE_START_PTR(slice_out)[512]), lotsa_bs, 1024) ==
0);
- gpr_slice_unref(slice_out);
+ grpc_slice_unref(slice_out);
grpc_byte_buffer_destroy(buffer);
grpc_byte_buffer_destroy(copied_buffer);
}
diff --git a/test/core/transport/chttp2/bin_decoder_test.c b/test/core/transport/chttp2/bin_decoder_test.c
index c4e6cd332f..3b111934ad 100644
--- a/test/core/transport/chttp2/bin_decoder_test.c
+++ b/test/core/transport/chttp2/bin_decoder_test.c
@@ -42,9 +42,9 @@
static int all_ok = 1;
-static void expect_slice_eq(gpr_slice expected, gpr_slice slice, char *debug,
+static void expect_slice_eq(grpc_slice expected, grpc_slice slice, char *debug,
int line) {
- if (0 != gpr_slice_cmp(slice, expected)) {
+ if (0 != grpc_slice_cmp(slice, expected)) {
char *hs = gpr_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
char *he = gpr_dump_slice(expected, GPR_DUMP_HEX | GPR_DUMP_ASCII);
gpr_log(GPR_ERROR, "FAILED:%d: %s\ngot: %s\nwant: %s", line, debug, hs,
@@ -53,35 +53,35 @@ static void expect_slice_eq(gpr_slice expected, gpr_slice slice, char *debug,
gpr_free(he);
all_ok = 0;
}
- gpr_slice_unref(expected);
- gpr_slice_unref(slice);
+ grpc_slice_unref(expected);
+ grpc_slice_unref(slice);
}
-static gpr_slice base64_encode(const char *s) {
- gpr_slice ss = gpr_slice_from_copied_string(s);
- gpr_slice out = grpc_chttp2_base64_encode(ss);
- gpr_slice_unref(ss);
+static grpc_slice base64_encode(const char *s) {
+ grpc_slice ss = grpc_slice_from_copied_string(s);
+ grpc_slice out = grpc_chttp2_base64_encode(ss);
+ grpc_slice_unref(ss);
return out;
}
-static gpr_slice base64_decode(const char *s) {
- gpr_slice ss = gpr_slice_from_copied_string(s);
- gpr_slice out = grpc_chttp2_base64_decode(ss);
- gpr_slice_unref(ss);
+static grpc_slice base64_decode(const char *s) {
+ grpc_slice ss = grpc_slice_from_copied_string(s);
+ grpc_slice out = grpc_chttp2_base64_decode(ss);
+ grpc_slice_unref(ss);
return out;
}
-static gpr_slice base64_decode_with_length(const char *s,
+static grpc_slice base64_decode_with_length(const char *s,
size_t output_length) {
- gpr_slice ss = gpr_slice_from_copied_string(s);
- gpr_slice out = grpc_chttp2_base64_decode_with_length(ss, output_length);
- gpr_slice_unref(ss);
+ grpc_slice ss = grpc_slice_from_copied_string(s);
+ grpc_slice out = grpc_chttp2_base64_decode_with_length(ss, output_length);
+ grpc_slice_unref(ss);
return out;
}
#define EXPECT_SLICE_EQ(expected, slice) \
expect_slice_eq( \
- gpr_slice_from_copied_buffer(expected, sizeof(expected) - 1), slice, \
+ grpc_slice_from_copied_buffer(expected, sizeof(expected) - 1), slice, \
#slice, __LINE__);
#define ENCODE_AND_DECODE(s) \
diff --git a/test/core/transport/chttp2/bin_encoder_test.c b/test/core/transport/chttp2/bin_encoder_test.c
index 08d10735a5..f7df4452ce 100644
--- a/test/core/transport/chttp2/bin_encoder_test.c
+++ b/test/core/transport/chttp2/bin_encoder_test.c
@@ -45,9 +45,9 @@
static int all_ok = 1;
-static void expect_slice_eq(gpr_slice expected, gpr_slice slice, char *debug,
+static void expect_slice_eq(grpc_slice expected, grpc_slice slice, char *debug,
int line) {
- if (0 != gpr_slice_cmp(slice, expected)) {
+ if (0 != grpc_slice_cmp(slice, expected)) {
char *hs = gpr_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
char *he = gpr_dump_slice(expected, GPR_DUMP_HEX | GPR_DUMP_ASCII);
gpr_log(GPR_ERROR, "FAILED:%d: %s\ngot: %s\nwant: %s", line, debug, hs,
@@ -56,35 +56,35 @@ static void expect_slice_eq(gpr_slice expected, gpr_slice slice, char *debug,
gpr_free(he);
all_ok = 0;
}
- gpr_slice_unref(expected);
- gpr_slice_unref(slice);
+ grpc_slice_unref(expected);
+ grpc_slice_unref(slice);
}
-static gpr_slice B64(const char *s) {
- gpr_slice ss = gpr_slice_from_copied_string(s);
- gpr_slice out = grpc_chttp2_base64_encode(ss);
- gpr_slice_unref(ss);
+static grpc_slice B64(const char *s) {
+ grpc_slice ss = grpc_slice_from_copied_string(s);
+ grpc_slice out = grpc_chttp2_base64_encode(ss);
+ grpc_slice_unref(ss);
return out;
}
-static gpr_slice HUFF(const char *s) {
- gpr_slice ss = gpr_slice_from_copied_string(s);
- gpr_slice out = grpc_chttp2_huffman_compress(ss);
- gpr_slice_unref(ss);
+static grpc_slice HUFF(const char *s) {
+ grpc_slice ss = grpc_slice_from_copied_string(s);
+ grpc_slice out = grpc_chttp2_huffman_compress(ss);
+ grpc_slice_unref(ss);
return out;
}
#define EXPECT_SLICE_EQ(expected, slice) \
expect_slice_eq( \
- gpr_slice_from_copied_buffer(expected, sizeof(expected) - 1), slice, \
+ grpc_slice_from_copied_buffer(expected, sizeof(expected) - 1), slice, \
#slice, __LINE__);
static void expect_combined_equiv(const char *s, size_t len, int line) {
- gpr_slice input = gpr_slice_from_copied_buffer(s, len);
- gpr_slice base64 = grpc_chttp2_base64_encode(input);
- gpr_slice expect = grpc_chttp2_huffman_compress(base64);
- gpr_slice got = grpc_chttp2_base64_encode_and_huffman_compress_impl(input);
- if (0 != gpr_slice_cmp(expect, got)) {
+ grpc_slice input = grpc_slice_from_copied_buffer(s, len);
+ grpc_slice base64 = grpc_chttp2_base64_encode(input);
+ grpc_slice expect = grpc_chttp2_huffman_compress(base64);
+ grpc_slice got = grpc_chttp2_base64_encode_and_huffman_compress_impl(input);
+ if (0 != grpc_slice_cmp(expect, got)) {
char *t = gpr_dump_slice(input, GPR_DUMP_HEX | GPR_DUMP_ASCII);
char *e = gpr_dump_slice(expect, GPR_DUMP_HEX | GPR_DUMP_ASCII);
char *g = gpr_dump_slice(got, GPR_DUMP_HEX | GPR_DUMP_ASCII);
@@ -95,10 +95,10 @@ static void expect_combined_equiv(const char *s, size_t len, int line) {
gpr_free(g);
all_ok = 0;
}
- gpr_slice_unref(input);
- gpr_slice_unref(base64);
- gpr_slice_unref(expect);
- gpr_slice_unref(got);
+ grpc_slice_unref(input);
+ grpc_slice_unref(base64);
+ grpc_slice_unref(expect);
+ grpc_slice_unref(got);
}
#define EXPECT_COMBINED_EQUIV(x) \
diff --git a/test/core/transport/chttp2/hpack_encoder_test.c b/test/core/transport/chttp2/hpack_encoder_test.c
index 1c1c74879b..2b4279673a 100644
--- a/test/core/transport/chttp2/hpack_encoder_test.c
+++ b/test/core/transport/chttp2/hpack_encoder_test.c
@@ -60,9 +60,9 @@ size_t cap_to_delete = 0;
hexstring passed in */
static void verify(size_t window_available, int eof, size_t expect_window_used,
const char *expected, size_t nheaders, ...) {
- gpr_slice_buffer output;
- gpr_slice merged;
- gpr_slice expect = parse_hexstring(expected);
+ grpc_slice_buffer output;
+ grpc_slice merged;
+ grpc_slice expect = parse_hexstring(expected);
size_t i;
va_list l;
grpc_linked_mdelem *e = gpr_malloc(sizeof(*e) * nheaders);
@@ -93,17 +93,17 @@ static void verify(size_t window_available, int eof, size_t expect_window_used,
}
to_delete[num_to_delete++] = e;
- gpr_slice_buffer_init(&output);
+ grpc_slice_buffer_init(&output);
grpc_transport_one_way_stats stats;
memset(&stats, 0, sizeof(stats));
grpc_chttp2_encode_header(&g_compressor, 0xdeadbeef, &b, eof, 16384, &stats,
&output);
merged = grpc_slice_merge(output.slices, output.count);
- gpr_slice_buffer_destroy(&output);
+ grpc_slice_buffer_destroy(&output);
grpc_metadata_batch_destroy(&b);
- if (0 != gpr_slice_cmp(merged, expect)) {
+ if (0 != grpc_slice_cmp(merged, expect)) {
char *expect_str = gpr_dump_slice(expect, GPR_DUMP_HEX | GPR_DUMP_ASCII);
char *got_str = gpr_dump_slice(merged, GPR_DUMP_HEX | GPR_DUMP_ASCII);
gpr_log(GPR_ERROR, "mismatched output for %s", expected);
@@ -114,8 +114,8 @@ static void verify(size_t window_available, int eof, size_t expect_window_used,
g_failure = 1;
}
- gpr_slice_unref(merged);
- gpr_slice_unref(expect);
+ grpc_slice_unref(merged);
+ grpc_slice_unref(expect);
}
static void test_basic_headers(void) {
@@ -186,7 +186,7 @@ static void test_decode_table_overflow(void) {
static void verify_table_size_change_match_elem_size(const char *key,
const char *value) {
- gpr_slice_buffer output;
+ grpc_slice_buffer output;
grpc_mdelem *elem = grpc_mdelem_from_strings(key, value);
size_t elem_size = grpc_mdelem_get_size_in_hpack_table(elem);
size_t initial_table_size = g_compressor.table_size;
@@ -198,13 +198,13 @@ static void verify_table_size_change_match_elem_size(const char *key,
e[0].next = NULL;
b.list.head = &e[0];
b.list.tail = &e[0];
- gpr_slice_buffer_init(&output);
+ grpc_slice_buffer_init(&output);
grpc_transport_one_way_stats stats;
memset(&stats, 0, sizeof(stats));
grpc_chttp2_encode_header(&g_compressor, 0xdeadbeef, &b, 0, 16384, &stats,
&output);
- gpr_slice_buffer_destroy(&output);
+ grpc_slice_buffer_destroy(&output);
grpc_metadata_batch_destroy(&b);
GPR_ASSERT(g_compressor.table_size == elem_size + initial_table_size);
diff --git a/test/core/transport/chttp2/hpack_parser_test.c b/test/core/transport/chttp2/hpack_parser_test.c
index 55b64f5d99..ffea0e19e2 100644
--- a/test/core/transport/chttp2/hpack_parser_test.c
+++ b/test/core/transport/chttp2/hpack_parser_test.c
@@ -52,16 +52,16 @@ static void onhdr(grpc_exec_ctx *exec_ctx, void *ud, grpc_mdelem *md) {
GPR_ASSERT(ekey);
evalue = va_arg(chk->args, char *);
GPR_ASSERT(evalue);
- GPR_ASSERT(gpr_slice_str_cmp(md->key->slice, ekey) == 0);
- GPR_ASSERT(gpr_slice_str_cmp(md->value->slice, evalue) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(md->key->slice, ekey) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(md->value->slice, evalue) == 0);
GRPC_MDELEM_UNREF(md);
}
static void test_vector(grpc_chttp2_hpack_parser *parser,
grpc_slice_split_mode mode, const char *hexstring,
... /* char *key, char *value */) {
- gpr_slice input = parse_hexstring(hexstring);
- gpr_slice *slices;
+ grpc_slice input = parse_hexstring(hexstring);
+ grpc_slice *slices;
size_t nslices;
size_t i;
test_checker chk;
@@ -72,7 +72,7 @@ static void test_vector(grpc_chttp2_hpack_parser *parser,
parser->on_header_user_data = &chk;
grpc_split_slices(mode, &input, 1, &slices, &nslices);
- gpr_slice_unref(input);
+ grpc_slice_unref(input);
for (i = 0; i < nslices; i++) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -83,7 +83,7 @@ static void test_vector(grpc_chttp2_hpack_parser *parser,
}
for (i = 0; i < nslices; i++) {
- gpr_slice_unref(slices[i]);
+ grpc_slice_unref(slices[i]);
}
gpr_free(slices);
diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.c
index 75b0ef4629..1a7e2442ca 100644
--- a/test/core/transport/chttp2/hpack_table_test.c
+++ b/test/core/transport/chttp2/hpack_table_test.c
@@ -48,7 +48,7 @@
static void assert_str(const grpc_chttp2_hptbl *tbl, grpc_mdstr *mdstr,
const char *str) {
- GPR_ASSERT(gpr_slice_str_cmp(mdstr->slice, str) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(mdstr->slice, str) == 0);
}
static void assert_index(const grpc_chttp2_hptbl *tbl, uint32_t idx,
diff --git a/test/core/transport/chttp2/varint_test.c b/test/core/transport/chttp2/varint_test.c
index 3552bf0c59..28cb404ce2 100644
--- a/test/core/transport/chttp2/varint_test.c
+++ b/test/core/transport/chttp2/varint_test.c
@@ -41,16 +41,16 @@
static void test_varint(uint32_t value, uint32_t prefix_bits, uint8_t prefix_or,
const char *expect_bytes, size_t expect_length) {
uint32_t nbytes = GRPC_CHTTP2_VARINT_LENGTH(value, prefix_bits);
- gpr_slice expect = gpr_slice_from_copied_buffer(expect_bytes, expect_length);
- gpr_slice slice;
+ grpc_slice expect = grpc_slice_from_copied_buffer(expect_bytes, expect_length);
+ grpc_slice slice;
gpr_log(GPR_DEBUG, "Test: 0x%08x", value);
GPR_ASSERT(nbytes == expect_length);
- slice = gpr_slice_malloc(nbytes);
+ slice = grpc_slice_malloc(nbytes);
GRPC_CHTTP2_WRITE_VARINT(value, prefix_bits, prefix_or,
GPR_SLICE_START_PTR(slice), nbytes);
- GPR_ASSERT(gpr_slice_cmp(expect, slice) == 0);
- gpr_slice_unref(expect);
- gpr_slice_unref(slice);
+ GPR_ASSERT(grpc_slice_cmp(expect, slice) == 0);
+ grpc_slice_unref(expect);
+ grpc_slice_unref(slice);
}
#define TEST_VARINT(value, prefix_bits, prefix_or, expect) \
diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c
index 007892930c..e47777ee72 100644
--- a/test/core/transport/metadata_test.c
+++ b/test/core/transport/metadata_test.c
@@ -68,8 +68,8 @@ static void test_create_string(void) {
s3 = grpc_mdstr_from_string("very much not hello");
GPR_ASSERT(s1 == s2);
GPR_ASSERT(s3 != s1);
- GPR_ASSERT(gpr_slice_str_cmp(s1->slice, "hello") == 0);
- GPR_ASSERT(gpr_slice_str_cmp(s3->slice, "very much not hello") == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(s1->slice, "hello") == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(s3->slice, "very much not hello") == 0);
GRPC_MDSTR_UNREF(s1);
GRPC_MDSTR_UNREF(s2);
GRPC_MDSTR_UNREF(s3);
@@ -89,9 +89,9 @@ static void test_create_metadata(void) {
GPR_ASSERT(m3 != m1);
GPR_ASSERT(m3->key == m1->key);
GPR_ASSERT(m3->value != m1->value);
- GPR_ASSERT(gpr_slice_str_cmp(m1->key->slice, "a") == 0);
- GPR_ASSERT(gpr_slice_str_cmp(m1->value->slice, "b") == 0);
- GPR_ASSERT(gpr_slice_str_cmp(m3->value->slice, "c") == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(m1->key->slice, "a") == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(m1->value->slice, "b") == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(m3->value->slice, "c") == 0);
GRPC_MDELEM_UNREF(m1);
GRPC_MDELEM_UNREF(m2);
GRPC_MDELEM_UNREF(m3);
@@ -205,7 +205,7 @@ static void test_things_stick_around(void) {
static void test_slices_work(void) {
/* ensure no memory leaks when switching representation from mdstr to slice */
grpc_mdstr *str;
- gpr_slice slice;
+ grpc_slice slice;
LOG_TEST("test_slices_work");
@@ -213,14 +213,14 @@ static void test_slices_work(void) {
str = grpc_mdstr_from_string(
"123456789012345678901234567890123456789012345678901234567890");
- slice = gpr_slice_ref(str->slice);
+ slice = grpc_slice_ref(str->slice);
GRPC_MDSTR_UNREF(str);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
str = grpc_mdstr_from_string(
"123456789012345678901234567890123456789012345678901234567890");
- slice = gpr_slice_ref(str->slice);
- gpr_slice_unref(slice);
+ slice = grpc_slice_ref(str->slice);
+ grpc_slice_unref(slice);
GRPC_MDSTR_UNREF(str);
grpc_shutdown();
@@ -228,8 +228,8 @@ static void test_slices_work(void) {
static void test_base64_and_huffman_works(void) {
grpc_mdstr *str;
- gpr_slice slice1;
- gpr_slice slice2;
+ grpc_slice slice1;
+ grpc_slice slice2;
LOG_TEST("test_base64_and_huffman_works");
@@ -237,9 +237,9 @@ static void test_base64_and_huffman_works(void) {
str = grpc_mdstr_from_string("abcdefg");
slice1 = grpc_mdstr_as_base64_encoded_and_huffman_compressed(str);
slice2 = grpc_chttp2_base64_encode_and_huffman_compress(str->slice);
- GPR_ASSERT(0 == gpr_slice_cmp(slice1, slice2));
+ GPR_ASSERT(0 == grpc_slice_cmp(slice1, slice2));
- gpr_slice_unref(slice2);
+ grpc_slice_unref(slice2);
GRPC_MDSTR_UNREF(str);
grpc_shutdown();
}
@@ -276,13 +276,13 @@ static void verify_binary_header_size(const char *key, const uint8_t *value,
grpc_mdelem *elem = grpc_mdelem_from_string_and_buffer(key, value, value_len);
GPR_ASSERT(grpc_is_binary_header(key, strlen(key)));
size_t elem_size = grpc_mdelem_get_size_in_hpack_table(elem);
- gpr_slice value_slice =
- gpr_slice_from_copied_buffer((const char *)value, value_len);
- gpr_slice base64_encoded = grpc_chttp2_base64_encode(value_slice);
+ grpc_slice value_slice =
+ grpc_slice_from_copied_buffer((const char *)value, value_len);
+ grpc_slice base64_encoded = grpc_chttp2_base64_encode(value_slice);
size_t expected_size = 32 + strlen(key) + GPR_SLICE_LENGTH(base64_encoded);
GPR_ASSERT(expected_size == elem_size);
- gpr_slice_unref(value_slice);
- gpr_slice_unref(base64_encoded);
+ grpc_slice_unref(value_slice);
+ grpc_slice_unref(base64_encoded);
GRPC_MDELEM_UNREF(elem);
}
diff --git a/test/core/util/mock_endpoint.c b/test/core/util/mock_endpoint.c
index 2b041a4484..6e09427c2b 100644
--- a/test/core/util/mock_endpoint.c
+++ b/test/core/util/mock_endpoint.c
@@ -42,19 +42,19 @@ typedef struct grpc_mock_endpoint {
grpc_endpoint base;
gpr_mu mu;
int refs;
- void (*on_write)(gpr_slice slice);
- gpr_slice_buffer read_buffer;
- gpr_slice_buffer *on_read_out;
+ void (*on_write)(grpc_slice slice);
+ grpc_slice_buffer read_buffer;
+ grpc_slice_buffer *on_read_out;
grpc_closure *on_read;
grpc_resource_user resource_user;
} grpc_mock_endpoint;
static void me_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *slices, grpc_closure *cb) {
+ grpc_slice_buffer *slices, grpc_closure *cb) {
grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep;
gpr_mu_lock(&m->mu);
if (m->read_buffer.count > 0) {
- gpr_slice_buffer_swap(&m->read_buffer, slices);
+ grpc_slice_buffer_swap(&m->read_buffer, slices);
grpc_exec_ctx_sched(exec_ctx, cb, GRPC_ERROR_NONE, NULL);
} else {
m->on_read = cb;
@@ -64,7 +64,7 @@ static void me_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
}
static void me_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *slices, grpc_closure *cb) {
+ grpc_slice_buffer *slices, grpc_closure *cb) {
grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep;
for (size_t i = 0; i < slices->count; i++) {
m->on_write(slices->slices[i]);
@@ -82,7 +82,7 @@ static void unref(grpc_exec_ctx *exec_ctx, grpc_mock_endpoint *m) {
gpr_mu_lock(&m->mu);
if (0 == --m->refs) {
gpr_mu_unlock(&m->mu);
- gpr_slice_buffer_destroy(&m->read_buffer);
+ grpc_slice_buffer_destroy(&m->read_buffer);
grpc_resource_user_destroy(exec_ctx, &m->resource_user);
gpr_free(m);
} else {
@@ -137,7 +137,7 @@ static const grpc_endpoint_vtable vtable = {
me_get_peer,
};
-grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(gpr_slice slice),
+grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice),
grpc_resource_quota *resource_quota) {
grpc_mock_endpoint *m = gpr_malloc(sizeof(*m));
m->base.vtable = &vtable;
@@ -146,7 +146,7 @@ grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(gpr_slice slice),
gpr_asprintf(&name, "mock_endpoint_%" PRIxPTR, (intptr_t)m);
grpc_resource_user_init(&m->resource_user, resource_quota, name);
gpr_free(name);
- gpr_slice_buffer_init(&m->read_buffer);
+ grpc_slice_buffer_init(&m->read_buffer);
gpr_mu_init(&m->mu);
m->on_write = on_write;
m->on_read = NULL;
@@ -154,15 +154,15 @@ grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(gpr_slice slice),
}
void grpc_mock_endpoint_put_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice slice) {
+ grpc_slice slice) {
grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep;
gpr_mu_lock(&m->mu);
if (m->on_read != NULL) {
- gpr_slice_buffer_add(m->on_read_out, slice);
+ grpc_slice_buffer_add(m->on_read_out, slice);
grpc_exec_ctx_sched(exec_ctx, m->on_read, GRPC_ERROR_NONE, NULL);
m->on_read = NULL;
} else {
- gpr_slice_buffer_add(&m->read_buffer, slice);
+ grpc_slice_buffer_add(&m->read_buffer, slice);
}
gpr_mu_unlock(&m->mu);
}
diff --git a/test/core/util/mock_endpoint.h b/test/core/util/mock_endpoint.h
index b3a464ca01..8f8d2a412d 100644
--- a/test/core/util/mock_endpoint.h
+++ b/test/core/util/mock_endpoint.h
@@ -36,9 +36,9 @@
#include "src/core/lib/iomgr/endpoint.h"
-grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(gpr_slice slice),
+grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice),
grpc_resource_quota *resource_quota);
void grpc_mock_endpoint_put_read(grpc_exec_ctx *exec_ctx,
- grpc_endpoint *mock_endpoint, gpr_slice slice);
+ grpc_endpoint *mock_endpoint, grpc_slice slice);
#endif
diff --git a/test/core/util/one_corpus_entry_fuzzer.c b/test/core/util/one_corpus_entry_fuzzer.c
index 95ae4cf706..a07e83b775 100644
--- a/test/core/util/one_corpus_entry_fuzzer.c
+++ b/test/core/util/one_corpus_entry_fuzzer.c
@@ -42,12 +42,12 @@ extern bool squelch;
extern bool leak_check;
int main(int argc, char **argv) {
- gpr_slice buffer;
+ grpc_slice buffer;
squelch = false;
leak_check = false;
GPR_ASSERT(
GRPC_LOG_IF_ERROR("load_file", grpc_load_file(argv[1], 0, &buffer)));
LLVMFuzzerTestOneInput(GPR_SLICE_START_PTR(buffer), GPR_SLICE_LENGTH(buffer));
- gpr_slice_unref(buffer);
+ grpc_slice_unref(buffer);
return 0;
}
diff --git a/test/core/util/parse_hexstring.c b/test/core/util/parse_hexstring.c
index 3ad7ce5828..91149a691a 100644
--- a/test/core/util/parse_hexstring.c
+++ b/test/core/util/parse_hexstring.c
@@ -34,12 +34,12 @@
#include "test/core/util/parse_hexstring.h"
#include <grpc/support/log.h>
-gpr_slice parse_hexstring(const char *hexstring) {
+grpc_slice parse_hexstring(const char *hexstring) {
size_t nibbles = 0;
const char *p = 0;
uint8_t *out;
uint8_t temp;
- gpr_slice slice;
+ grpc_slice slice;
for (p = hexstring; *p; p++) {
nibbles += (*p >= '0' && *p <= '9') || (*p >= 'a' && *p <= 'f');
@@ -47,7 +47,7 @@ gpr_slice parse_hexstring(const char *hexstring) {
GPR_ASSERT((nibbles & 1) == 0);
- slice = gpr_slice_malloc(nibbles / 2);
+ slice = grpc_slice_malloc(nibbles / 2);
out = GPR_SLICE_START_PTR(slice);
nibbles = 0;
diff --git a/test/core/util/parse_hexstring.h b/test/core/util/parse_hexstring.h
index ddbfe541c6..bfdc23299a 100644
--- a/test/core/util/parse_hexstring.h
+++ b/test/core/util/parse_hexstring.h
@@ -36,6 +36,6 @@
#include <grpc/support/slice.h>
-gpr_slice parse_hexstring(const char *hexstring);
+grpc_slice parse_hexstring(const char *hexstring);
#endif /* GRPC_TEST_CORE_UTIL_PARSE_HEXSTRING_H */
diff --git a/test/core/util/passthru_endpoint.c b/test/core/util/passthru_endpoint.c
index ee6ef7da60..a5bac8aaa8 100644
--- a/test/core/util/passthru_endpoint.c
+++ b/test/core/util/passthru_endpoint.c
@@ -43,8 +43,8 @@ typedef struct passthru_endpoint passthru_endpoint;
typedef struct {
grpc_endpoint base;
passthru_endpoint *parent;
- gpr_slice_buffer read_buffer;
- gpr_slice_buffer *on_read_out;
+ grpc_slice_buffer read_buffer;
+ grpc_slice_buffer *on_read_out;
grpc_closure *on_read;
grpc_resource_user resource_user;
} half;
@@ -58,14 +58,14 @@ struct passthru_endpoint {
};
static void me_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *slices, grpc_closure *cb) {
+ grpc_slice_buffer *slices, grpc_closure *cb) {
half *m = (half *)ep;
gpr_mu_lock(&m->parent->mu);
if (m->parent->shutdown) {
grpc_exec_ctx_sched(exec_ctx, cb, GRPC_ERROR_CREATE("Already shutdown"),
NULL);
} else if (m->read_buffer.count > 0) {
- gpr_slice_buffer_swap(&m->read_buffer, slices);
+ grpc_slice_buffer_swap(&m->read_buffer, slices);
grpc_exec_ctx_sched(exec_ctx, cb, GRPC_ERROR_NONE, NULL);
} else {
m->on_read = cb;
@@ -80,7 +80,7 @@ static half *other_half(half *h) {
}
static void me_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
- gpr_slice_buffer *slices, grpc_closure *cb) {
+ grpc_slice_buffer *slices, grpc_closure *cb) {
half *m = other_half((half *)ep);
gpr_mu_lock(&m->parent->mu);
grpc_error *error = GRPC_ERROR_NONE;
@@ -88,13 +88,13 @@ static void me_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
error = GRPC_ERROR_CREATE("Endpoint already shutdown");
} else if (m->on_read != NULL) {
for (size_t i = 0; i < slices->count; i++) {
- gpr_slice_buffer_add(m->on_read_out, gpr_slice_ref(slices->slices[i]));
+ grpc_slice_buffer_add(m->on_read_out, grpc_slice_ref(slices->slices[i]));
}
grpc_exec_ctx_sched(exec_ctx, m->on_read, GRPC_ERROR_NONE, NULL);
m->on_read = NULL;
} else {
for (size_t i = 0; i < slices->count; i++) {
- gpr_slice_buffer_add(&m->read_buffer, gpr_slice_ref(slices->slices[i]));
+ grpc_slice_buffer_add(&m->read_buffer, grpc_slice_ref(slices->slices[i]));
}
}
gpr_mu_unlock(&m->parent->mu);
@@ -132,8 +132,8 @@ static void me_really_destroy(grpc_exec_ctx *exec_ctx, void *ep,
if (0 == --p->halves) {
gpr_mu_unlock(&p->mu);
gpr_mu_destroy(&p->mu);
- gpr_slice_buffer_destroy(&p->client.read_buffer);
- gpr_slice_buffer_destroy(&p->server.read_buffer);
+ grpc_slice_buffer_destroy(&p->client.read_buffer);
+ grpc_slice_buffer_destroy(&p->server.read_buffer);
gpr_free(p);
} else {
gpr_mu_unlock(&p->mu);
@@ -174,7 +174,7 @@ static void half_init(half *m, passthru_endpoint *parent,
const char *half_name) {
m->base.vtable = &vtable;
m->parent = parent;
- gpr_slice_buffer_init(&m->read_buffer);
+ grpc_slice_buffer_init(&m->read_buffer);
m->on_read = NULL;
char *name;
gpr_asprintf(&name, "passthru_endpoint_%s_%" PRIxPTR, half_name,
diff --git a/test/core/util/slice_splitter.c b/test/core/util/slice_splitter.c
index 95b55a6505..6647b8fbb3 100644
--- a/test/core/util/slice_splitter.c
+++ b/test/core/util/slice_splitter.c
@@ -50,8 +50,8 @@ const char *grpc_slice_split_mode_name(grpc_slice_split_mode mode) {
return "error";
}
-void grpc_split_slices(grpc_slice_split_mode mode, gpr_slice *src_slices,
- size_t src_slice_count, gpr_slice **dst_slices,
+void grpc_split_slices(grpc_slice_split_mode mode, grpc_slice *src_slices,
+ size_t src_slice_count, grpc_slice **dst_slices,
size_t *dst_slice_count) {
size_t i, j;
size_t length;
@@ -59,10 +59,10 @@ void grpc_split_slices(grpc_slice_split_mode mode, gpr_slice *src_slices,
switch (mode) {
case GRPC_SLICE_SPLIT_IDENTITY:
*dst_slice_count = src_slice_count;
- *dst_slices = gpr_malloc(sizeof(gpr_slice) * src_slice_count);
+ *dst_slices = gpr_malloc(sizeof(grpc_slice) * src_slice_count);
for (i = 0; i < src_slice_count; i++) {
(*dst_slices)[i] = src_slices[i];
- gpr_slice_ref((*dst_slices)[i]);
+ grpc_slice_ref((*dst_slices)[i]);
}
break;
case GRPC_SLICE_SPLIT_MERGE_ALL:
@@ -71,8 +71,8 @@ void grpc_split_slices(grpc_slice_split_mode mode, gpr_slice *src_slices,
for (i = 0; i < src_slice_count; i++) {
length += GPR_SLICE_LENGTH(src_slices[i]);
}
- *dst_slices = gpr_malloc(sizeof(gpr_slice));
- **dst_slices = gpr_slice_malloc(length);
+ *dst_slices = gpr_malloc(sizeof(grpc_slice));
+ **dst_slices = grpc_slice_malloc(length);
length = 0;
for (i = 0; i < src_slice_count; i++) {
memcpy(GPR_SLICE_START_PTR(**dst_slices) + length,
@@ -87,11 +87,11 @@ void grpc_split_slices(grpc_slice_split_mode mode, gpr_slice *src_slices,
length += GPR_SLICE_LENGTH(src_slices[i]);
}
*dst_slice_count = length;
- *dst_slices = gpr_malloc(sizeof(gpr_slice) * length);
+ *dst_slices = gpr_malloc(sizeof(grpc_slice) * length);
length = 0;
for (i = 0; i < src_slice_count; i++) {
for (j = 0; j < GPR_SLICE_LENGTH(src_slices[i]); j++) {
- (*dst_slices)[length] = gpr_slice_sub(src_slices[i], j, j + 1);
+ (*dst_slices)[length] = grpc_slice_sub(src_slices[i], j, j + 1);
length++;
}
}
@@ -100,25 +100,25 @@ void grpc_split_slices(grpc_slice_split_mode mode, gpr_slice *src_slices,
}
void grpc_split_slices_to_buffer(grpc_slice_split_mode mode,
- gpr_slice *src_slices, size_t src_slice_count,
- gpr_slice_buffer *dst) {
- gpr_slice *slices;
+ grpc_slice *src_slices, size_t src_slice_count,
+ grpc_slice_buffer *dst) {
+ grpc_slice *slices;
size_t nslices;
size_t i;
grpc_split_slices(mode, src_slices, src_slice_count, &slices, &nslices);
for (i = 0; i < nslices; i++) {
/* add indexed to avoid re-merging split slices */
- gpr_slice_buffer_add_indexed(dst, slices[i]);
+ grpc_slice_buffer_add_indexed(dst, slices[i]);
}
gpr_free(slices);
}
-void grpc_split_slice_buffer(grpc_slice_split_mode mode, gpr_slice_buffer *src,
- gpr_slice_buffer *dst) {
+void grpc_split_slice_buffer(grpc_slice_split_mode mode, grpc_slice_buffer *src,
+ grpc_slice_buffer *dst) {
grpc_split_slices_to_buffer(mode, src->slices, src->count, dst);
}
-gpr_slice grpc_slice_merge(gpr_slice *slices, size_t nslices) {
+grpc_slice grpc_slice_merge(grpc_slice *slices, size_t nslices) {
uint8_t *out = NULL;
size_t length = 0;
size_t capacity = 0;
@@ -134,5 +134,5 @@ gpr_slice grpc_slice_merge(gpr_slice *slices, size_t nslices) {
length += GPR_SLICE_LENGTH(slices[i]);
}
- return gpr_slice_new(out, length, gpr_free);
+ return grpc_slice_new(out, length, gpr_free);
}
diff --git a/test/core/util/slice_splitter.h b/test/core/util/slice_splitter.h
index d030c2cb55..9e62dfa0f3 100644
--- a/test/core/util/slice_splitter.h
+++ b/test/core/util/slice_splitter.h
@@ -51,17 +51,17 @@ typedef enum {
/* allocates *dst_slices; caller must unref all slices in dst_slices then free
it */
-void grpc_split_slices(grpc_slice_split_mode mode, gpr_slice *src_slices,
- size_t src_slice_count, gpr_slice **dst_slices,
+void grpc_split_slices(grpc_slice_split_mode mode, grpc_slice *src_slices,
+ size_t src_slice_count, grpc_slice **dst_slices,
size_t *dst_slice_count);
void grpc_split_slices_to_buffer(grpc_slice_split_mode mode,
- gpr_slice *src_slices, size_t src_slice_count,
- gpr_slice_buffer *dst);
-void grpc_split_slice_buffer(grpc_slice_split_mode mode, gpr_slice_buffer *src,
- gpr_slice_buffer *dst);
+ grpc_slice *src_slices, size_t src_slice_count,
+ grpc_slice_buffer *dst);
+void grpc_split_slice_buffer(grpc_slice_split_mode mode, grpc_slice_buffer *src,
+ grpc_slice_buffer *dst);
-gpr_slice grpc_slice_merge(gpr_slice *slices, size_t nslices);
+grpc_slice grpc_slice_merge(grpc_slice *slices, size_t nslices);
const char *grpc_slice_split_mode_name(grpc_slice_split_mode mode);
diff --git a/test/cpp/grpclb/grpclb_api_test.cc b/test/cpp/grpclb/grpclb_api_test.cc
index e67189c69e..fed5a2cce1 100644
--- a/test/cpp/grpclb/grpclb_api_test.cc
+++ b/test/cpp/grpclb/grpclb_api_test.cc
@@ -71,12 +71,12 @@ TEST_F(GrpclbTest, CreateRequest) {
const grpc::string service_name = "AServiceName";
LoadBalanceRequest request;
grpc_grpclb_request* c_req = grpc_grpclb_request_create(service_name.c_str());
- gpr_slice slice = grpc_grpclb_request_encode(c_req);
+ grpc_slice slice = grpc_grpclb_request_encode(c_req);
const int num_bytes_written = GPR_SLICE_LENGTH(slice);
EXPECT_GT(num_bytes_written, 0);
request.ParseFromArray(GPR_SLICE_START_PTR(slice), num_bytes_written);
EXPECT_EQ(request.initial_request().name(), service_name);
- gpr_slice_unref(slice);
+ grpc_slice_unref(slice);
grpc_grpclb_request_destroy(c_req);
}
@@ -88,15 +88,15 @@ TEST_F(GrpclbTest, ParseInitialResponse) {
client_stats_report_interval->set_seconds(123);
client_stats_report_interval->set_nanos(456);
const grpc::string encoded_response = response.SerializeAsString();
- gpr_slice encoded_slice =
- gpr_slice_from_copied_string(encoded_response.c_str());
+ grpc_slice encoded_slice =
+ grpc_slice_from_copied_string(encoded_response.c_str());
grpc_grpclb_initial_response* c_initial_response =
grpc_grpclb_initial_response_parse(encoded_slice);
EXPECT_FALSE(c_initial_response->has_load_balancer_delegate);
EXPECT_EQ(c_initial_response->client_stats_report_interval.seconds, 123);
EXPECT_EQ(c_initial_response->client_stats_report_interval.nanos, 456);
- gpr_slice_unref(encoded_slice);
+ grpc_slice_unref(encoded_slice);
grpc_grpclb_initial_response_destroy(c_initial_response);
}
@@ -116,7 +116,7 @@ TEST_F(GrpclbTest, ParseResponseServerList) {
expiration_interval->set_nanos(999);
const grpc::string encoded_response = response.SerializeAsString();
- const gpr_slice encoded_slice = gpr_slice_from_copied_buffer(
+ const grpc_slice encoded_slice = grpc_slice_from_copied_buffer(
encoded_response.data(), encoded_response.size());
grpc_grpclb_serverlist* c_serverlist =
grpc_grpclb_response_parse_serverlist(encoded_slice);
@@ -137,7 +137,7 @@ TEST_F(GrpclbTest, ParseResponseServerList) {
EXPECT_TRUE(c_serverlist->expiration_interval.has_nanos);
EXPECT_EQ(c_serverlist->expiration_interval.nanos, 999);
- gpr_slice_unref(encoded_slice);
+ grpc_slice_unref(encoded_slice);
grpc_grpclb_destroy_serverlist(c_serverlist);
}
diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc
index b6056f9ae4..a65e425625 100644
--- a/test/cpp/grpclb/grpclb_test.cc
+++ b/test/cpp/grpclb/grpclb_test.cc
@@ -109,7 +109,7 @@ typedef struct test_fixture {
static void *tag(intptr_t t) { return (void *)t; }
-static gpr_slice build_response_payload_slice(
+static grpc_slice build_response_payload_slice(
const char *host, int *ports, size_t nports,
int64_t expiration_interval_secs, int32_t expiration_interval_nanos) {
// server_list {
@@ -148,7 +148,7 @@ static gpr_slice build_response_payload_slice(
server->set_load_balance_token(token_data);
}
const grpc::string &enc_resp = response.SerializeAsString();
- return gpr_slice_from_copied_buffer(enc_resp.data(), enc_resp.size());
+ return grpc_slice_from_copied_buffer(enc_resp.data(), enc_resp.size());
}
static void drain_cq(grpc_completion_queue *cq) {
@@ -210,17 +210,17 @@ static void start_lb_server(server_fixture *sf, int *ports, size_t nports,
// validate initial request.
grpc_byte_buffer_reader bbr;
grpc_byte_buffer_reader_init(&bbr, request_payload_recv);
- gpr_slice request_payload_slice = grpc_byte_buffer_reader_readall(&bbr);
+ grpc_slice request_payload_slice = grpc_byte_buffer_reader_readall(&bbr);
grpc::lb::v1::LoadBalanceRequest request;
request.ParseFromArray(GPR_SLICE_START_PTR(request_payload_slice),
GPR_SLICE_LENGTH(request_payload_slice));
GPR_ASSERT(request.has_initial_request());
GPR_ASSERT(request.initial_request().name() == sf->servers_hostport);
- gpr_slice_unref(request_payload_slice);
+ grpc_slice_unref(request_payload_slice);
grpc_byte_buffer_reader_destroy(&bbr);
grpc_byte_buffer_destroy(request_payload_recv);
- gpr_slice response_payload_slice;
+ grpc_slice response_payload_slice;
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
@@ -264,7 +264,7 @@ static void start_lb_server(server_fixture *sf, int *ports, size_t nports,
sf->servers_hostport, i);
grpc_byte_buffer_destroy(response_payload);
- gpr_slice_unref(response_payload_slice);
+ grpc_slice_unref(response_payload_slice);
}
gpr_log(GPR_INFO, "LB Server[%s] shutting down", sf->servers_hostport);
@@ -355,7 +355,7 @@ static void start_backend_server(server_fixture *sf) {
gpr_log(GPR_INFO, "Server[%s] after tag 101", sf->servers_hostport);
bool exit = false;
- gpr_slice response_payload_slice = gpr_slice_from_copied_string(PAYLOAD);
+ grpc_slice response_payload_slice = grpc_slice_from_copied_string(PAYLOAD);
while (!exit) {
op = ops;
op->op = GRPC_OP_RECV_MESSAGE;
@@ -414,7 +414,7 @@ static void start_backend_server(server_fixture *sf) {
++sf->num_calls_serviced;
gpr_log(GPR_INFO, "Server[%s] OUT OF THE LOOP", sf->servers_hostport);
- gpr_slice_unref(response_payload_slice);
+ grpc_slice_unref(response_payload_slice);
op = ops;
op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
@@ -456,7 +456,7 @@ static void perform_request(client_fixture *cf) {
int i;
memset(ops, 0, sizeof(ops));
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
c = grpc_channel_create_call(cf->client, NULL, GRPC_PROPAGATE_DEFAULTS,
cf->cq, "/foo", "foo.test.google.fr:1234",
@@ -515,7 +515,7 @@ static void perform_request(client_fixture *cf) {
grpc_byte_buffer_destroy(response_payload_recv);
}
- gpr_slice_unref(request_payload_slice);
+ grpc_slice_unref(request_payload_slice);
op = ops;
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h
index 9983c8a7b0..d63346a582 100644
--- a/test/cpp/qps/client.h
+++ b/test/cpp/qps/client.h
@@ -103,7 +103,7 @@ class ClientRequestCreator<ByteBuffer> {
if (payload_config.has_bytebuf_params()) {
std::unique_ptr<char[]> buf(
new char[payload_config.bytebuf_params().req_size()]);
- gpr_slice s = gpr_slice_from_copied_buffer(
+ grpc_slice s = grpc_slice_from_copied_buffer(
buf.get(), payload_config.bytebuf_params().req_size());
Slice slice(s, Slice::STEAL_REF);
*req = ByteBuffer(&slice, 1);
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index bc4c896d83..4fcdb4f083 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -380,7 +380,7 @@ static Status ProcessGenericRPC(const PayloadConfig &payload_config,
ByteBuffer *response) {
int resp_size = payload_config.bytebuf_params().resp_size();
std::unique_ptr<char[]> buf(new char[resp_size]);
- gpr_slice s = gpr_slice_from_copied_buffer(buf.get(), resp_size);
+ grpc_slice s = grpc_slice_from_copied_buffer(buf.get(), resp_size);
Slice slice(s, Slice::STEAL_REF);
*response = ByteBuffer(&slice, 1);
return Status::OK;
diff --git a/test/cpp/util/byte_buffer_proto_helper.cc b/test/cpp/util/byte_buffer_proto_helper.cc
index d625d6f3f4..ab5ca261e6 100644
--- a/test/cpp/util/byte_buffer_proto_helper.cc
+++ b/test/cpp/util/byte_buffer_proto_helper.cc
@@ -51,7 +51,7 @@ std::unique_ptr<ByteBuffer> SerializeToByteBuffer(
grpc::protobuf::Message* message) {
grpc::string buf;
message->SerializeToString(&buf);
- gpr_slice s = gpr_slice_from_copied_string(buf.c_str());
+ grpc_slice s = grpc_slice_from_copied_string(buf.c_str());
Slice slice(s, Slice::STEAL_REF);
return std::unique_ptr<ByteBuffer>(new ByteBuffer(&slice, 1));
}
diff --git a/test/cpp/util/byte_buffer_test.cc b/test/cpp/util/byte_buffer_test.cc
index 2089a62011..f66f471d7e 100644
--- a/test/cpp/util/byte_buffer_test.cc
+++ b/test/cpp/util/byte_buffer_test.cc
@@ -49,14 +49,14 @@ const char* kContent2 = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy world";
class ByteBufferTest : public ::testing::Test {};
TEST_F(ByteBufferTest, CreateFromSingleSlice) {
- gpr_slice hello = gpr_slice_from_copied_string(kContent1);
+ grpc_slice hello = grpc_slice_from_copied_string(kContent1);
Slice s(hello, Slice::STEAL_REF);
ByteBuffer buffer(&s, 1);
}
TEST_F(ByteBufferTest, CreateFromVector) {
- gpr_slice hello = gpr_slice_from_copied_string(kContent1);
- gpr_slice world = gpr_slice_from_copied_string(kContent2);
+ grpc_slice hello = grpc_slice_from_copied_string(kContent1);
+ grpc_slice world = grpc_slice_from_copied_string(kContent2);
std::vector<Slice> slices;
slices.push_back(Slice(hello, Slice::STEAL_REF));
slices.push_back(Slice(world, Slice::STEAL_REF));
@@ -64,15 +64,15 @@ TEST_F(ByteBufferTest, CreateFromVector) {
}
TEST_F(ByteBufferTest, Clear) {
- gpr_slice hello = gpr_slice_from_copied_string(kContent1);
+ grpc_slice hello = grpc_slice_from_copied_string(kContent1);
Slice s(hello, Slice::STEAL_REF);
ByteBuffer buffer(&s, 1);
buffer.Clear();
}
TEST_F(ByteBufferTest, Length) {
- gpr_slice hello = gpr_slice_from_copied_string(kContent1);
- gpr_slice world = gpr_slice_from_copied_string(kContent2);
+ grpc_slice hello = grpc_slice_from_copied_string(kContent1);
+ grpc_slice world = grpc_slice_from_copied_string(kContent2);
std::vector<Slice> slices;
slices.push_back(Slice(hello, Slice::STEAL_REF));
slices.push_back(Slice(world, Slice::STEAL_REF));
@@ -80,7 +80,7 @@ TEST_F(ByteBufferTest, Length) {
EXPECT_EQ(strlen(kContent1) + strlen(kContent2), buffer.Length());
}
-bool SliceEqual(const Slice& a, gpr_slice b) {
+bool SliceEqual(const Slice& a, grpc_slice b) {
if (a.size() != GPR_SLICE_LENGTH(b)) {
return false;
}
@@ -93,8 +93,8 @@ bool SliceEqual(const Slice& a, gpr_slice b) {
}
TEST_F(ByteBufferTest, Dump) {
- gpr_slice hello = gpr_slice_from_copied_string(kContent1);
- gpr_slice world = gpr_slice_from_copied_string(kContent2);
+ grpc_slice hello = grpc_slice_from_copied_string(kContent1);
+ grpc_slice world = grpc_slice_from_copied_string(kContent2);
std::vector<Slice> slices;
slices.push_back(Slice(hello, Slice::STEAL_REF));
slices.push_back(Slice(world, Slice::STEAL_REF));
@@ -106,8 +106,8 @@ TEST_F(ByteBufferTest, Dump) {
}
TEST_F(ByteBufferTest, SerializationMakesCopy) {
- gpr_slice hello = gpr_slice_from_copied_string(kContent1);
- gpr_slice world = gpr_slice_from_copied_string(kContent2);
+ grpc_slice hello = grpc_slice_from_copied_string(kContent1);
+ grpc_slice world = grpc_slice_from_copied_string(kContent2);
std::vector<Slice> slices;
slices.push_back(Slice(hello, Slice::STEAL_REF));
slices.push_back(Slice(world, Slice::STEAL_REF));
diff --git a/test/cpp/util/cli_call.cc b/test/cpp/util/cli_call.cc
index 1edffbe08e..e36475bc9e 100644
--- a/test/cpp/util/cli_call.cc
+++ b/test/cpp/util/cli_call.cc
@@ -72,7 +72,7 @@ Status CliCall::Call(std::shared_ptr<grpc::Channel> channel,
cq.Next(&got_tag, &ok);
GPR_ASSERT(ok);
- gpr_slice s = gpr_slice_from_copied_string(request.c_str());
+ grpc_slice s = grpc_slice_from_copied_string(request.c_str());
grpc::Slice req_slice(s, grpc::Slice::STEAL_REF);
grpc::ByteBuffer send_buffer(&req_slice, 1);
call->Write(send_buffer, tag(2));
diff --git a/test/cpp/util/slice_test.cc b/test/cpp/util/slice_test.cc
index 45799ae157..3e50700303 100644
--- a/test/cpp/util/slice_test.cc
+++ b/test/cpp/util/slice_test.cc
@@ -51,15 +51,15 @@ class SliceTest : public ::testing::Test {
};
TEST_F(SliceTest, Steal) {
- gpr_slice s = gpr_slice_from_copied_string(kContent);
+ grpc_slice s = grpc_slice_from_copied_string(kContent);
Slice spp(s, Slice::STEAL_REF);
CheckSlice(spp, kContent);
}
TEST_F(SliceTest, Add) {
- gpr_slice s = gpr_slice_from_copied_string(kContent);
+ grpc_slice s = grpc_slice_from_copied_string(kContent);
Slice spp(s, Slice::ADD_REF);
- gpr_slice_unref(s);
+ grpc_slice_unref(s);
CheckSlice(spp, kContent);
}
@@ -69,13 +69,13 @@ TEST_F(SliceTest, Empty) {
}
TEST_F(SliceTest, Cslice) {
- gpr_slice s = gpr_slice_from_copied_string(kContent);
+ grpc_slice s = grpc_slice_from_copied_string(kContent);
Slice spp(s, Slice::STEAL_REF);
CheckSlice(spp, kContent);
- gpr_slice c_slice = spp.c_slice();
+ grpc_slice c_slice = spp.c_slice();
EXPECT_EQ(GPR_SLICE_START_PTR(s), GPR_SLICE_START_PTR(c_slice));
EXPECT_EQ(GPR_SLICE_END_PTR(s), GPR_SLICE_END_PTR(c_slice));
- gpr_slice_unref(c_slice);
+ grpc_slice_unref(c_slice);
}
} // namespace
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json
index 9a49c61480..9ae5627a77 100644
--- a/tools/run_tests/sources_and_headers.json
+++ b/tools/run_tests/sources_and_headers.json
@@ -754,7 +754,7 @@
"headers": [],
"is_filegroup": false,
"language": "c",
- "name": "gpr_slice_buffer_test",
+ "name": "grpc_slice_buffer_test",
"src": [
"test/core/support/slice_buffer_test.c"
],
@@ -769,7 +769,7 @@
"headers": [],
"is_filegroup": false,
"language": "c",
- "name": "gpr_slice_test",
+ "name": "grpc_slice_test",
"src": [
"test/core/support/slice_test.c"
],
diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json
index a1d59c0053..8713578f4a 100644
--- a/tools/run_tests/tests.json
+++ b/tools/run_tests/tests.json
@@ -815,7 +815,7 @@
"flaky": false,
"gtest": false,
"language": "c",
- "name": "gpr_slice_buffer_test",
+ "name": "grpc_slice_buffer_test",
"platforms": [
"linux",
"mac",
@@ -836,7 +836,7 @@
"flaky": false,
"gtest": false,
"language": "c",
- "name": "gpr_slice_test",
+ "name": "grpc_slice_test",
"platforms": [
"linux",
"mac",
diff --git a/vsprojects/buildtests_c.sln b/vsprojects/buildtests_c.sln
index b1918809bf..08feb72861 100644
--- a/vsprojects/buildtests_c.sln
+++ b/vsprojects/buildtests_c.sln
@@ -433,7 +433,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gpr_percent_encoding_test",
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gpr_slice_buffer_test", "vcxproj\test\gpr_slice_buffer_test\gpr_slice_buffer_test.vcxproj", "{E679773D-DE89-AEBB-9787-59019989B825}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_slice_buffer_test", "vcxproj\test\grpc_slice_buffer_test\grpc_slice_buffer_test.vcxproj", "{E679773D-DE89-AEBB-9787-59019989B825}"
ProjectSection(myProperties) = preProject
lib = "False"
EndProjectSection
@@ -442,7 +442,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gpr_slice_buffer_test", "vc
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gpr_slice_test", "vcxproj\test\gpr_slice_test\gpr_slice_test.vcxproj", "{7F2D1623-AF04-DD98-BCE6-61ADB9A52366}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_slice_test", "vcxproj\test\grpc_slice_test\grpc_slice_test.vcxproj", "{7F2D1623-AF04-DD98-BCE6-61ADB9A52366}"
ProjectSection(myProperties) = preProject
lib = "False"
EndProjectSection
diff --git a/vsprojects/vcxproj/test/gpr_slice_buffer_test/gpr_slice_buffer_test.vcxproj b/vsprojects/vcxproj/test/gpr_slice_buffer_test/gpr_slice_buffer_test.vcxproj
index 33926ff116..6343575915 100644
--- a/vsprojects/vcxproj/test/gpr_slice_buffer_test/gpr_slice_buffer_test.vcxproj
+++ b/vsprojects/vcxproj/test/gpr_slice_buffer_test/gpr_slice_buffer_test.vcxproj
@@ -60,14 +60,14 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
- <TargetName>gpr_slice_buffer_test</TargetName>
+ <TargetName>grpc_slice_buffer_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
- <TargetName>gpr_slice_buffer_test</TargetName>
+ <TargetName>grpc_slice_buffer_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
diff --git a/vsprojects/vcxproj/test/gpr_slice_test/gpr_slice_test.vcxproj b/vsprojects/vcxproj/test/gpr_slice_test/gpr_slice_test.vcxproj
index bb2badc35c..bfd3468ff9 100644
--- a/vsprojects/vcxproj/test/gpr_slice_test/gpr_slice_test.vcxproj
+++ b/vsprojects/vcxproj/test/gpr_slice_test/gpr_slice_test.vcxproj
@@ -60,14 +60,14 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
- <TargetName>gpr_slice_test</TargetName>
+ <TargetName>grpc_slice_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
- <TargetName>gpr_slice_test</TargetName>
+ <TargetName>grpc_slice_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>