From db57c4f574850819642f4702bbbec069ad46be0c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 24 Feb 2015 10:34:47 -0800 Subject: [PATCH 01/75] First pass user-facing anonymous stub&service API --- include/grpc++/anonymous_service.h | 72 ++++++++++++++++++++++++++++++ include/grpc++/anonymous_stub.h | 58 ++++++++++++++++++++++++ include/grpc++/byte_buffer.h | 51 +++++++++++++++++++++ include/grpc++/server_builder.h | 4 ++ include/grpc++/slice.h | 69 ++++++++++++++++++++++++++++ 5 files changed, 254 insertions(+) create mode 100644 include/grpc++/anonymous_service.h create mode 100644 include/grpc++/anonymous_stub.h create mode 100644 include/grpc++/byte_buffer.h create mode 100644 include/grpc++/slice.h diff --git a/include/grpc++/anonymous_service.h b/include/grpc++/anonymous_service.h new file mode 100644 index 00000000000..81b18ea5872 --- /dev/null +++ b/include/grpc++/anonymous_service.h @@ -0,0 +1,72 @@ +/* + * + * 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 __GRPCPP_ANONYMOUS_SERVICE_H_ +#define __GRPCPP_ANONYMOUS_SERVICE_H_ + +#include + +namespace grpc { + +typedef ServerReaderWriter GenericServerReaderWriter; + +class AnonymousServerContext : public ServerContext { + public: + const grpc::string& method() const { return method_; } + const grpc::string& host() const { return host_; } + + private: + grpc::string method_; + grpc::string host_; +}; + +// Anonymous stubs provide a type-unsafe interface to call gRPC methods +// by name. +class AnonymousService { + public: + explicit AnonymousService(CompletionQueue* cq) : cq_(cq) {} + + struct CallDetails { + grpc::string method; + grpc::string host; + }; + + void RequestCall(AnonymousServerContext* ctx, GenericServerReaderWriter* reader_writer, CompletionQueue* cq, void* tag); + + private: + CompletionQueue* const cq_; +}; + +} // namespace + +#endif diff --git a/include/grpc++/anonymous_stub.h b/include/grpc++/anonymous_stub.h new file mode 100644 index 00000000000..4a7543c7600 --- /dev/null +++ b/include/grpc++/anonymous_stub.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 __GRPCPP_ANONYMOUS_STUB_H_ +#define __GRPCPP_ANONYMOUS_STUB_H_ + +#include + +namespace grpc { + +typedef ClientReaderWriter GenericClientReaderWriter; + +// Anonymous stubs provide a type-unsafe interface to call gRPC methods +// by name. +class AnonymousStub { + public: + explicit AnonymousStub(std::shared_ptr channel) : channel_(channel) {} + + // begin a call to a named method + std::unique_ptr Call(ClientContext* context, const grpc::string& method); + + private: + std::shared_ptr channel_; +}; + +} // namespace + +#endif diff --git a/include/grpc++/byte_buffer.h b/include/grpc++/byte_buffer.h new file mode 100644 index 00000000000..a69fce00015 --- /dev/null +++ b/include/grpc++/byte_buffer.h @@ -0,0 +1,51 @@ +/* + * + * 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 __GRPCPP_BYTE_BUFFER_H_ +#define __GRPCPP_BYTE_BUFFER_H_ + +#include + +namespace grpc { + +class ByteBuffer { + public: + // Some interface with operations that make sense. + + private: + grpc_byte_buffer* byte_buffer_; +}; + +} // namespace + +#endif diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index 4545c413d25..faa9c17c58b 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -41,6 +41,7 @@ namespace grpc { +class AnonymousService; class AsynchronousService; class CompletionQueue; class RpcService; @@ -64,6 +65,9 @@ class ServerBuilder { // instance returned by BuildAndStart(). void RegisterAsyncService(AsynchronousService* service); + // Register an anonymous service. + void RegisterAnonymousService(AnonymousService* service); + // Add a listening port. Can be called multiple times. void AddPort(const grpc::string& addr); diff --git a/include/grpc++/slice.h b/include/grpc++/slice.h new file mode 100644 index 00000000000..f1cb76ca80b --- /dev/null +++ b/include/grpc++/slice.h @@ -0,0 +1,69 @@ +/* + * + * 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 __GRPCPP_SLICE_H_ +#define __GRPCPP_SLICE_H_ + +#include +#include + +namespace grpc { + +class Slice { + public: + // construct empty slice + Slice(); + // destructor - drops one ref + ~Slice(); + // construct slice from grpc slice, adding a ref + enum AddRef { ADD_REF }; + Slice(gpr_slice slice, AddRef); + // construct slice from grpc slice, stealing a ref + enum StealRef { STEAL_REF }; + Slice(gpr_slice slice, StealRef); + // copy constructor - adds a ref + Slice(const Slice& other); + // assignment + Slice& operator=(Slice other) { std::swap(slice_, other.slice_); } + + size_t size() const { return GPR_SLICE_LENGTH(slice_); } + const gpr_uint8* begin() const { return GPR_SLICE_START_PTR(slice_); } + const gpr_uint8* end() const { return GPR_SLICE_END_PTR(slice_); } + + private: + gpr_slice slice_; +}; + +} // namespace grpc + +#endif From 25770b02d634ba69dfef6bc2d68fbce167acfcef Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Fri, 27 Feb 2015 15:30:58 -0800 Subject: [PATCH 02/75] add jwt token creds test_case --- test/cpp/interop/client.cc | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index f7537c2d7b2..73a6ad107d9 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -73,6 +73,7 @@ DEFINE_string(test_case, "large_unary", "ping_pong : full-duplex streaming; " "service_account_creds : large_unary with service_account auth; " "compute_engine_creds: large_unary with compute engine auth; " + "jwt_token_creds: large_unary with JWT token auth; " "all : all of above."); DEFINE_string(default_service_account, "", "Email of GCE default service account"); @@ -145,6 +146,13 @@ std::shared_ptr CreateChannelForTestCase( creds = CredentialsFactory::ComputeEngineCredentials(); return CreateTestChannel(host_port, FLAGS_server_host_override, FLAGS_enable_ssl, FLAGS_use_prod_roots, creds); + } else if (test_case == "jwt_token_creds") { + std::unique_ptr creds; + GPR_ASSERT(FLAGS_enable_ssl); + grpc::string json_key = GetServiceAccountJsonKey(); + creds = CredentialsFactory::JWTCredentials(json_key, std::chrono::hours(1)); + return CreateTestChannel(host_port, FLAGS_server_host_override, + FLAGS_enable_ssl, FLAGS_use_prod_roots, creds); } else { return CreateTestChannel(host_port, FLAGS_server_host_override, FLAGS_enable_ssl, FLAGS_use_prod_roots); @@ -226,6 +234,21 @@ void DoServiceAccountCreds() { gpr_log(GPR_INFO, "Large unary with service account creds done."); } +void DoJwtTokenCreds() { + gpr_log(GPR_INFO, + "Sending a large unary rpc with JWT token credentials ..."); + std::shared_ptr channel = + CreateChannelForTestCase("jwt_token_creds"); + SimpleRequest request; + SimpleResponse response; + request.set_fill_username(true); + PerformLargeUnary(channel, &request, &response); + GPR_ASSERT(!response.username().empty()); + grpc::string json_key = GetServiceAccountJsonKey(); + GPR_ASSERT(json_key.find(response.username()) != grpc::string::npos); + gpr_log(GPR_INFO, "Large unary with JWT token creds done."); +} + void DoLargeUnary() { gpr_log(GPR_INFO, "Sending a large unary rpc..."); std::shared_ptr channel = @@ -414,6 +437,8 @@ int main(int argc, char** argv) { DoServiceAccountCreds(); } else if (FLAGS_test_case == "compute_engine_creds") { DoComputeEngineCreds(); + } else if (FLAGS_test_case == "jwt_token_creds") { + DoJwtTokenCreds(); } else if (FLAGS_test_case == "all") { DoEmpty(); DoLargeUnary(); @@ -421,9 +446,10 @@ int main(int argc, char** argv) { DoResponseStreaming(); DoHalfDuplex(); DoPingPong(); - // service_account_creds can only run with ssl. + // service_account_creds and jwt_token_creds can only run with ssl. if (FLAGS_enable_ssl) { DoServiceAccountCreds(); + DoJwtTokenCreds(); } // compute_engine_creds only runs in GCE. } else { @@ -431,7 +457,7 @@ int main(int argc, char** argv) { GPR_ERROR, "Unsupported test case %s. Valid options are all|empty_unary|" "large_unary|client_streaming|server_streaming|half_duplex|ping_pong|" - "service_account_creds|compute_engine_creds", + "service_account_creds|compute_engine_creds|jwt_token_creds", FLAGS_test_case.c_str()); } From 7b1bb8b69d7a9b37fc547d5dfd9b5b2740238860 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Mon, 2 Mar 2015 17:19:40 -0800 Subject: [PATCH 03/75] Makes cpu_posix.c portable by removing thread-local storage. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thread-local variables aren’t supported on iOS. --- src/core/support/cpu_posix.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/core/support/cpu_posix.c b/src/core/support/cpu_posix.c index 5f45fb0bc36..1844e9a6221 100644 --- a/src/core/support/cpu_posix.c +++ b/src/core/support/cpu_posix.c @@ -42,8 +42,6 @@ #include #include -static __thread char magic_thread_local; - static int ncpus = 0; static void init_ncpus() { @@ -60,18 +58,10 @@ unsigned gpr_cpu_num_cores(void) { return ncpus; } -/* This is a cheap, but good enough, pointer hash for sharding things: */ -static size_t shard_ptr(const void *info) { - size_t x = (size_t)info; - return ((x >> 4) ^ (x >> 9) ^ (x >> 14)) % gpr_cpu_num_cores(); -} - unsigned gpr_cpu_current_cpu(void) { /* NOTE: there's no way I know to return the actual cpu index portably... - most code that's using this is using it to shard across work queues though, - so here we use thread identity instead to achieve a similar though not - identical effect */ - return shard_ptr(&magic_thread_local); + most code that's using this is using it to shard across work queues though */ + return 0; } #endif /* GPR_CPU_LINUX */ From 1c40233814db12cca53857241c7314b8ef14ea54 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Thu, 5 Mar 2015 16:39:25 -0800 Subject: [PATCH 04/75] first sets of changes, it builds --- Makefile | 8 +++++ build.json | 4 +++ include/grpc++/anonymous_service.h | 32 +++++++++--------- include/grpc++/anonymous_stub.h | 11 ++++--- include/grpc++/server.h | 8 +++++ include/grpc++/server_builder.h | 1 + include/grpc++/server_context.h | 2 +- src/cpp/server/anonymous_service.cc | 47 +++++++++++++++++++++++++++ src/cpp/server/server.cc | 50 +++++++++++++++++++++++++---- src/cpp/server/server_builder.cc | 13 ++++++++ src/cpp/util/byte_buffer.cc | 2 ++ 11 files changed, 149 insertions(+), 29 deletions(-) create mode 100644 src/cpp/server/anonymous_service.cc create mode 100644 src/cpp/util/byte_buffer.cc diff --git a/Makefile b/Makefile index 186aec6b82b..f68228f29c7 100644 --- a/Makefile +++ b/Makefile @@ -3085,16 +3085,20 @@ LIBGRPC++_SRC = \ src/cpp/common/completion_queue.cc \ src/cpp/common/rpc_method.cc \ src/cpp/proto/proto_utils.cc \ + src/cpp/server/anonymous_service.cc \ src/cpp/server/server.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_context.cc \ src/cpp/server/server_credentials.cc \ src/cpp/server/thread_pool.cc \ + src/cpp/util/byte_buffer.cc \ src/cpp/util/status.cc \ src/cpp/util/time.cc \ PUBLIC_HEADERS_CXX += \ + include/grpc++/anonymous_service.h \ include/grpc++/async_unary_call.h \ + include/grpc++/byte_buffer.h \ include/grpc++/channel_arguments.h \ include/grpc++/channel_interface.h \ include/grpc++/client_context.h \ @@ -3162,11 +3166,13 @@ src/cpp/common/call.cc: $(OPENSSL_DEP) src/cpp/common/completion_queue.cc: $(OPENSSL_DEP) src/cpp/common/rpc_method.cc: $(OPENSSL_DEP) src/cpp/proto/proto_utils.cc: $(OPENSSL_DEP) +src/cpp/server/anonymous_service.cc: $(OPENSSL_DEP) src/cpp/server/server.cc: $(OPENSSL_DEP) src/cpp/server/server_builder.cc: $(OPENSSL_DEP) src/cpp/server/server_context.cc: $(OPENSSL_DEP) src/cpp/server/server_credentials.cc: $(OPENSSL_DEP) src/cpp/server/thread_pool.cc: $(OPENSSL_DEP) +src/cpp/util/byte_buffer.cc: $(OPENSSL_DEP) src/cpp/util/status.cc: $(OPENSSL_DEP) src/cpp/util/time.cc: $(OPENSSL_DEP) endif @@ -3221,11 +3227,13 @@ $(OBJDIR)/$(CONFIG)/src/cpp/common/call.o: $(OBJDIR)/$(CONFIG)/src/cpp/common/completion_queue.o: $(OBJDIR)/$(CONFIG)/src/cpp/common/rpc_method.o: $(OBJDIR)/$(CONFIG)/src/cpp/proto/proto_utils.o: +$(OBJDIR)/$(CONFIG)/src/cpp/server/anonymous_service.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server_builder.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server_context.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server_credentials.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/thread_pool.o: +$(OBJDIR)/$(CONFIG)/src/cpp/util/byte_buffer.o: $(OBJDIR)/$(CONFIG)/src/cpp/util/status.o: $(OBJDIR)/$(CONFIG)/src/cpp/util/time.o: diff --git a/build.json b/build.json index fdf87f311d9..7dc792b258a 100644 --- a/build.json +++ b/build.json @@ -393,7 +393,9 @@ "build": "all", "language": "c++", "public_headers": [ + "include/grpc++/anonymous_service.h", "include/grpc++/async_unary_call.h", + "include/grpc++/byte_buffer.h", "include/grpc++/channel_arguments.h", "include/grpc++/channel_interface.h", "include/grpc++/client_context.h", @@ -434,11 +436,13 @@ "src/cpp/common/completion_queue.cc", "src/cpp/common/rpc_method.cc", "src/cpp/proto/proto_utils.cc", + "src/cpp/server/anonymous_service.cc", "src/cpp/server/server.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_context.cc", "src/cpp/server/server_credentials.cc", "src/cpp/server/thread_pool.cc", + "src/cpp/util/byte_buffer.cc", "src/cpp/util/status.cc", "src/cpp/util/time.cc" ], diff --git a/include/grpc++/anonymous_service.h b/include/grpc++/anonymous_service.h index 81b18ea5872..456fb8bcb77 100644 --- a/include/grpc++/anonymous_service.h +++ b/include/grpc++/anonymous_service.h @@ -31,14 +31,17 @@ * */ -#ifndef __GRPCPP_ANONYMOUS_SERVICE_H_ -#define __GRPCPP_ANONYMOUS_SERVICE_H_ +#ifndef GRPCXX_ANONYMOUS_SERVICE_H +#define GRPCXX_ANONYMOUS_SERVICE_H +#include #include +struct grpc_server; + namespace grpc { -typedef ServerReaderWriter GenericServerReaderWriter; +typedef ServerAsyncReaderWriter GenericServerReaderWriter; class AnonymousServerContext : public ServerContext { public: @@ -50,23 +53,20 @@ class AnonymousServerContext : public ServerContext { grpc::string host_; }; -// Anonymous stubs provide a type-unsafe interface to call gRPC methods -// by name. class AnonymousService { public: - explicit AnonymousService(CompletionQueue* cq) : cq_(cq) {} - - struct CallDetails { - grpc::string method; - grpc::string host; - }; - - void RequestCall(AnonymousServerContext* ctx, GenericServerReaderWriter* reader_writer, CompletionQueue* cq, void* tag); + // TODO(yangg) Once we can add multiple completion queues to the server + // in c core, add a CompletionQueue* argument to the ctor here. + AnonymousService() : server_(nullptr) {} + void RequestCall(AnonymousServerContext* ctx, + GenericServerReaderWriter* reader_writer, + CompletionQueue* cq, void* tag); private: - CompletionQueue* const cq_; + friend class Server; + Server* server_; }; -} // namespace +} // namespace grpc -#endif +#endif // GRPCXX_ANONYMOUS_SERVICE_H diff --git a/include/grpc++/anonymous_stub.h b/include/grpc++/anonymous_stub.h index 4a7543c7600..ccb474e21bb 100644 --- a/include/grpc++/anonymous_stub.h +++ b/include/grpc++/anonymous_stub.h @@ -31,14 +31,15 @@ * */ -#ifndef __GRPCPP_ANONYMOUS_STUB_H_ -#define __GRPCPP_ANONYMOUS_STUB_H_ +#ifndef GRPCXX_ANONYMOUS_STUB_H +#define GRPCXX_ANONYMOUS_STUB_H +#include #include namespace grpc { -typedef ClientReaderWriter GenericClientReaderWriter; +typedef ClientAsyncReaderWriter GenericClientReaderWriter; // Anonymous stubs provide a type-unsafe interface to call gRPC methods // by name. @@ -53,6 +54,6 @@ class AnonymousStub { std::shared_ptr channel_; }; -} // namespace +} // namespace grpc -#endif +#endif // GRPCXX_ANONYMOUS_STUB_H diff --git a/include/grpc++/server.h b/include/grpc++/server.h index e3ba93e4877..7e8f6d48b5c 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -48,6 +48,8 @@ struct grpc_server; namespace grpc { +class AnonymousServerContext; +class AnonymousService; class AsynchronousService; class RpcService; class RpcServiceMethod; @@ -69,6 +71,7 @@ class Server GRPC_FINAL : private CallHook, void Wait(); private: + friend class AnonymousService; friend class ServerBuilder; class SyncRequest; @@ -82,6 +85,7 @@ class Server GRPC_FINAL : private CallHook, // The service must exist for the lifetime of the Server instance. bool RegisterService(RpcService* service); bool RegisterAsyncService(AsynchronousService* service); + void RegisterAnonymousService(AnonymousService* service); // Add a listening port. Can be called multiple times. int AddPort(const grpc::string& addr); // Start the server. @@ -99,6 +103,10 @@ class Server GRPC_FINAL : private CallHook, ServerAsyncStreamingInterface* stream, CompletionQueue* cq, void* tag); + void RequestAsyncAnonymousCall(AnonymousServerContext* context, + ServerAsyncStreamingInterface* stream, + CompletionQueue* cq, void* tag); + // Completion queue. CompletionQueue cq_; diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index 60c891ce81f..514a6687dcb 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -87,6 +87,7 @@ class ServerBuilder { std::vector async_services_; std::vector ports_; std::shared_ptr creds_; + AnonymousService* anonymous_service_; ThreadPoolInterface* thread_pool_; }; diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h index a986fff46bf..9e3b80c6411 100644 --- a/include/grpc++/server_context.h +++ b/include/grpc++/server_context.h @@ -66,7 +66,7 @@ class CompletionQueue; class Server; // Interface of server side rpc context. -class ServerContext GRPC_FINAL { +class ServerContext { public: ServerContext(); // for async calls ~ServerContext(); diff --git a/src/cpp/server/anonymous_service.cc b/src/cpp/server/anonymous_service.cc new file mode 100644 index 00000000000..ef20cade341 --- /dev/null +++ b/src/cpp/server/anonymous_service.cc @@ -0,0 +1,47 @@ +/* + * + * 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 + +#include + +namespace grpc { + +void AnonymousService::RequestCall(AnonymousServerContext* ctx, + GenericServerReaderWriter* reader_writer, + CompletionQueue* cq, void* tag) { + server_->RequestAsyncAnonymousCall(ctx, reader_writer, cq, tag); +} + +} // namespace grpc + diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 2a5a7fe5ebd..4de1ad290ec 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -239,6 +240,12 @@ bool Server::RegisterAsyncService(AsynchronousService* service) { return true; } +void Server::RegisterAnonymousService(AnonymousService* service) { + GPR_ASSERT(service->server_ == nullptr && + "Can only register an anonymous service against one server."); + service->server_ = this; +} + int Server::AddPort(const grpc::string& addr) { GPR_ASSERT(!started_); if (secure_) { @@ -306,15 +313,36 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { stream_(stream), cq_(cq), ctx_(ctx), + anonymous_ctx_(nullptr), server_(server), call_(nullptr), payload_(nullptr) { memset(&array_, 0, sizeof(array_)); + grpc_call_details_init(&call_details_); grpc_server_request_registered_call( - server->server_, registered_method, &call_, &deadline_, &array_, - request ? &payload_ : nullptr, cq->cq(), this); + server->server_, registered_method, &call_, &call_details_.deadline, + &array_, request ? &payload_ : nullptr, cq->cq(), this); + } + + AsyncRequest(Server* server, AnonymousServerContext* ctx, + ServerAsyncStreamingInterface* stream, CompletionQueue* cq, + void* tag) + : tag_(tag), + request_(nullptr), + stream_(stream), + cq_(cq), + ctx_(nullptr), + anonymous_ctx_(ctx), + server_(server), + call_(nullptr), + payload_(nullptr) { + memset(&array_, 0, sizeof(array_)); + grpc_call_details_init(&call_details_); + grpc_server_request_call( + server->server_, &call_, &call_details_, &array_, cq->cq(), this); } + ~AsyncRequest() { if (payload_) { grpc_byte_buffer_destroy(payload_); @@ -332,20 +360,22 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { *status = false; } } + ServerContext* ctx = ctx_ ? ctx_ : anonymous_ctx_; + GPR_ASSERT(ctx); if (*status) { - ctx_->deadline_ = Timespec2Timepoint(deadline_); + ctx->deadline_ = Timespec2Timepoint(call_details_.deadline); for (size_t i = 0; i < array_.count; i++) { - ctx_->client_metadata_.insert(std::make_pair( + ctx->client_metadata_.insert(std::make_pair( grpc::string(array_.metadata[i].key), grpc::string( array_.metadata[i].value, array_.metadata[i].value + array_.metadata[i].value_length))); } } - ctx_->call_ = call_; + ctx->call_ = call_; Call call(call_, server_, cq_); if (orig_status && call_) { - ctx_->BeginCompletionOp(&call); + ctx->BeginCompletionOp(&call); } // just the pointers inside call are copied here stream_->BindCall(&call); @@ -359,9 +389,10 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { ServerAsyncStreamingInterface* const stream_; CompletionQueue* const cq_; ServerContext* const ctx_; + AnonymousServerContext* const anonymous_ctx_; Server* const server_; grpc_call* call_; - gpr_timespec deadline_; + grpc_call_details call_details_; grpc_metadata_array array_; grpc_byte_buffer* payload_; }; @@ -372,6 +403,11 @@ void Server::RequestAsyncCall(void* registered_method, ServerContext* context, CompletionQueue* cq, void* tag) { new AsyncRequest(this, registered_method, context, request, stream, cq, tag); } +void Server::RequestAsyncAnonymousCall(AnonymousServerContext* context, + ServerAsyncStreamingInterface* stream, + CompletionQueue* cq, void* tag) { + new AsyncRequest(this, context, stream, cq, tag); +} void Server::ScheduleCallback() { { diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index ae60f3d8b67..cc6f8ca9e52 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -51,6 +51,16 @@ void ServerBuilder::RegisterAsyncService(AsynchronousService* service) { async_services_.push_back(service); } +void ServerBuilder::RegisterAnonymousService(AnonymousService* service) { + if (anonymous_service_) { + gpr_log(GPR_ERROR, + "Adding multiple AnonymousService is unsupported for now. " + "Dropping the service %p", service); + return; + } + anonymous_service_ = service; +} + void ServerBuilder::AddPort(const grpc::string& addr) { ports_.push_back(addr); } @@ -89,6 +99,9 @@ std::unique_ptr ServerBuilder::BuildAndStart() { return nullptr; } } + if (anonymous_service_) { + server->RegisterAnonymousService(anonymous_service_); + } for (auto& port : ports_) { if (!server->AddPort(port)) { return nullptr; diff --git a/src/cpp/util/byte_buffer.cc b/src/cpp/util/byte_buffer.cc new file mode 100644 index 00000000000..3846156ae38 --- /dev/null +++ b/src/cpp/util/byte_buffer.cc @@ -0,0 +1,2 @@ + +#include From 5f4539f4e8be43c477bad8fba84c6ce6c125a120 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Fri, 6 Mar 2015 16:11:16 -0800 Subject: [PATCH 05/75] Service side should be done, it builds and existing tests pass --- include/grpc++/anonymous_service.h | 3 ++ include/grpc++/byte_buffer.h | 29 ++++++++-- include/grpc++/impl/call.h | 11 ++-- src/cpp/common/call.cc | 86 +++++++++++++++++++----------- src/cpp/server/server.cc | 7 +++ src/cpp/server/server_builder.cc | 3 +- 6 files changed, 100 insertions(+), 39 deletions(-) diff --git a/include/grpc++/anonymous_service.h b/include/grpc++/anonymous_service.h index 456fb8bcb77..78903dbc3b3 100644 --- a/include/grpc++/anonymous_service.h +++ b/include/grpc++/anonymous_service.h @@ -49,6 +49,8 @@ class AnonymousServerContext : public ServerContext { const grpc::string& host() const { return host_; } private: + friend class Server; + grpc::string method_; grpc::string host_; }; @@ -62,6 +64,7 @@ class AnonymousService { void RequestCall(AnonymousServerContext* ctx, GenericServerReaderWriter* reader_writer, CompletionQueue* cq, void* tag); + private: friend class Server; Server* server_; diff --git a/include/grpc++/byte_buffer.h b/include/grpc++/byte_buffer.h index a69fce00015..36b301fd9db 100644 --- a/include/grpc++/byte_buffer.h +++ b/include/grpc++/byte_buffer.h @@ -34,16 +34,37 @@ #ifndef __GRPCPP_BYTE_BUFFER_H_ #define __GRPCPP_BYTE_BUFFER_H_ -#include +#include +#include +#include namespace grpc { -class ByteBuffer { +class ByteBuffer GRPC_FINAL { public: - // Some interface with operations that make sense. + ByteBuffer() : buffer_(nullptr) {} + + ~ByteBuffer() { + if (buffer_) { + grpc_byte_buffer_destroy(buffer_); + } + } private: - grpc_byte_buffer* byte_buffer_; + friend class CallOpBuffer; + + // takes ownership + void set_buffer(grpc_byte_buffer* buf) { + GPR_ASSERT(!buffer_); + buffer_ = buf; + } + + grpc_byte_buffer* buffer() const { + GPR_ASSERT(buffer_); + return buffer_; + } + + grpc_byte_buffer* buffer_; }; } // namespace diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index 5de56629735..a8551ad4595 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -35,9 +35,9 @@ #define GRPCXX_IMPL_CALL_H #include +#include #include #include -#include #include #include @@ -47,6 +47,7 @@ struct grpc_op; namespace grpc { +class ByteBuffer; class Call; class CallOpBuffer : public CompletionQueueTag { @@ -62,7 +63,9 @@ class CallOpBuffer : public CompletionQueueTag { void AddSendInitialMetadata(ClientContext *ctx); void AddRecvInitialMetadata(ClientContext *ctx); void AddSendMessage(const grpc::protobuf::Message &message); + void AddSendMessage(const ByteBuffer& message); void AddRecvMessage(grpc::protobuf::Message *message); + void AddRecvMessage(ByteBuffer *message); void AddClientSendClose(); void AddClientRecvStatus(ClientContext *ctx, Status *status); void AddServerSendStatus(std::multimap *metadata, @@ -90,10 +93,12 @@ class CallOpBuffer : public CompletionQueueTag { grpc_metadata_array recv_initial_metadata_arr_; // Send message const grpc::protobuf::Message *send_message_; - grpc_byte_buffer *send_message_buf_; + const ByteBuffer *send_message_buffer_; + grpc_byte_buffer *send_buf_; // Recv message grpc::protobuf::Message *recv_message_; - grpc_byte_buffer *recv_message_buf_; + ByteBuffer *recv_message_buffer_; + grpc_byte_buffer *recv_buf_; // Client send close bool client_send_close_; // Client recv status diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index 6ce1e8a7d58..ebe7deec702 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -31,8 +31,10 @@ * */ -#include #include + +#include +#include #include #include @@ -48,9 +50,11 @@ CallOpBuffer::CallOpBuffer() recv_initial_metadata_(nullptr), recv_initial_metadata_arr_{0, 0, nullptr}, send_message_(nullptr), - send_message_buf_(nullptr), + send_message_buffer_(nullptr), + send_buf_(nullptr), recv_message_(nullptr), - recv_message_buf_(nullptr), + recv_message_buffer_(nullptr), + recv_buf_(nullptr), client_send_close_(false), recv_trailing_metadata_(nullptr), recv_status_(nullptr), @@ -74,18 +78,20 @@ void CallOpBuffer::Reset(void* next_return_tag) { recv_initial_metadata_ = nullptr; recv_initial_metadata_arr_.count = 0; - send_message_ = nullptr; - if (send_message_buf_) { - grpc_byte_buffer_destroy(send_message_buf_); - send_message_buf_ = nullptr; + if (send_buf_ && send_message_) { + grpc_byte_buffer_destroy(send_buf_); } + send_message_ = nullptr; + send_message_buffer_ = nullptr; + send_buf_ = nullptr; - recv_message_ = nullptr; got_message = false; - if (recv_message_buf_) { - grpc_byte_buffer_destroy(recv_message_buf_); - recv_message_buf_ = nullptr; + if (recv_buf_ && recv_message_) { + grpc_byte_buffer_destroy(recv_buf_); } + recv_message_ = nullptr; + recv_message_buffer_ = nullptr; + recv_buf_ = nullptr; client_send_close_ = false; @@ -106,11 +112,11 @@ CallOpBuffer::~CallOpBuffer() { gpr_free(status_details_); gpr_free(recv_initial_metadata_arr_.metadata); gpr_free(recv_trailing_metadata_arr_.metadata); - if (recv_message_buf_) { - grpc_byte_buffer_destroy(recv_message_buf_); + if (recv_buf_ && recv_message_) { + grpc_byte_buffer_destroy(recv_buf_); } - if (send_message_buf_) { - grpc_byte_buffer_destroy(send_message_buf_); + if (send_buf_ && send_message_) { + grpc_byte_buffer_destroy(send_buf_); } } @@ -166,11 +172,19 @@ void CallOpBuffer::AddSendMessage(const grpc::protobuf::Message& message) { send_message_ = &message; } +void CallOpBuffer::AddSendMessage(const ByteBuffer& message) { + send_message_buffer_ = &message; +} + void CallOpBuffer::AddRecvMessage(grpc::protobuf::Message* message) { recv_message_ = message; recv_message_->Clear(); } +void CallOpBuffer::AddRecvMessage(ByteBuffer* message) { + recv_message_buffer_ = message; +} + void CallOpBuffer::AddClientSendClose() { client_send_close_ = true; } void CallOpBuffer::AddServerRecvClose(bool* cancelled) { @@ -206,19 +220,23 @@ void CallOpBuffer::FillOps(grpc_op* ops, size_t* nops) { ops[*nops].data.recv_initial_metadata = &recv_initial_metadata_arr_; (*nops)++; } - if (send_message_) { - bool success = SerializeProto(*send_message_, &send_message_buf_); - if (!success) { - abort(); - // TODO handle parse failure + if (send_message_ || send_message_buffer_) { + if (send_message_) { + bool success = SerializeProto(*send_message_, &send_buf_); + if (!success) { + abort(); + // TODO handle parse failure + } + } else { + send_buf_ = send_message_buffer_->buffer(); } ops[*nops].op = GRPC_OP_SEND_MESSAGE; - ops[*nops].data.send_message = send_message_buf_; + ops[*nops].data.send_message = send_buf_; (*nops)++; } - if (recv_message_) { + if (recv_message_ || recv_message_buffer_) { ops[*nops].op = GRPC_OP_RECV_MESSAGE; - ops[*nops].data.recv_message = &recv_message_buf_; + ops[*nops].data.recv_message = &recv_buf_; (*nops)++; } if (client_send_close_) { @@ -256,9 +274,11 @@ void CallOpBuffer::FillOps(grpc_op* ops, size_t* nops) { bool CallOpBuffer::FinalizeResult(void** tag, bool* status) { // Release send buffers. - if (send_message_buf_) { - grpc_byte_buffer_destroy(send_message_buf_); - send_message_buf_ = nullptr; + if (send_buf_ && send_message_) { + if (send_message_) { + grpc_byte_buffer_destroy(send_buf_); + } + send_buf_ = nullptr; } if (initial_metadata_) { gpr_free(initial_metadata_); @@ -275,12 +295,16 @@ bool CallOpBuffer::FinalizeResult(void** tag, bool* status) { FillMetadataMap(&recv_initial_metadata_arr_, recv_initial_metadata_); } // Parse received message if any. - if (recv_message_) { - if (recv_message_buf_) { + if (recv_message_ || recv_message_buffer_) { + if (recv_buf_) { got_message = *status; - *status = *status && DeserializeProto(recv_message_buf_, recv_message_); - grpc_byte_buffer_destroy(recv_message_buf_); - recv_message_buf_ = nullptr; + if (recv_message_) { + *status = *status && DeserializeProto(recv_buf_, recv_message_); + grpc_byte_buffer_destroy(recv_buf_); + } else { + recv_message_buffer_->set_buffer(recv_buf_); + } + recv_buf_ = nullptr; } else { // Read failed got_message = false; diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 4de1ad290ec..6e66cd476c9 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -371,6 +371,12 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { array_.metadata[i].value, array_.metadata[i].value + array_.metadata[i].value_length))); } + if (anonymous_ctx_) { + anonymous_ctx_->method_.assign(call_details_.method, + call_details_.method_capacity); + anonymous_ctx_->host_.assign(call_details_.host, + call_details_.host_capacity); + } } ctx->call_ = call_; Call call(call_, server_, cq_); @@ -403,6 +409,7 @@ void Server::RequestAsyncCall(void* registered_method, ServerContext* context, CompletionQueue* cq, void* tag) { new AsyncRequest(this, registered_method, context, request, stream, cq, tag); } + void Server::RequestAsyncAnonymousCall(AnonymousServerContext* context, ServerAsyncStreamingInterface* stream, CompletionQueue* cq, void* tag) { diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index cc6f8ca9e52..b7e5c84ef6d 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -41,7 +41,8 @@ namespace grpc { -ServerBuilder::ServerBuilder() : thread_pool_(nullptr) {} +ServerBuilder::ServerBuilder() + : anonymous_service_(nullptr), thread_pool_(nullptr) {} void ServerBuilder::RegisterService(SynchronousService* service) { services_.push_back(service->service()); From 61c413182dafc3d58874a62256b130d8df7bd77d Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 10 Mar 2015 12:42:18 -0700 Subject: [PATCH 06/75] initial imple of byte buffer and slice --- Makefile | 4 ++ build.json | 2 + include/grpc++/byte_buffer.h | 24 +++++++++--- include/grpc++/slice.h | 21 +++++++---- src/cpp/util/byte_buffer.cc | 73 ++++++++++++++++++++++++++++++++++++ src/cpp/util/slice.cc | 50 ++++++++++++++++++++++++ 6 files changed, 160 insertions(+), 14 deletions(-) create mode 100644 src/cpp/util/slice.cc diff --git a/Makefile b/Makefile index f68228f29c7..b332ead145d 100644 --- a/Makefile +++ b/Makefile @@ -3092,6 +3092,7 @@ LIBGRPC++_SRC = \ src/cpp/server/server_credentials.cc \ src/cpp/server/thread_pool.cc \ src/cpp/util/byte_buffer.cc \ + src/cpp/util/slice.cc \ src/cpp/util/status.cc \ src/cpp/util/time.cc \ @@ -3116,6 +3117,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/server_builder.h \ include/grpc++/server_context.h \ include/grpc++/server_credentials.h \ + include/grpc++/slice.h \ include/grpc++/status.h \ include/grpc++/status_code_enum.h \ include/grpc++/stream.h \ @@ -3173,6 +3175,7 @@ src/cpp/server/server_context.cc: $(OPENSSL_DEP) src/cpp/server/server_credentials.cc: $(OPENSSL_DEP) src/cpp/server/thread_pool.cc: $(OPENSSL_DEP) src/cpp/util/byte_buffer.cc: $(OPENSSL_DEP) +src/cpp/util/slice.cc: $(OPENSSL_DEP) src/cpp/util/status.cc: $(OPENSSL_DEP) src/cpp/util/time.cc: $(OPENSSL_DEP) endif @@ -3234,6 +3237,7 @@ $(OBJDIR)/$(CONFIG)/src/cpp/server/server_context.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server_credentials.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/thread_pool.o: $(OBJDIR)/$(CONFIG)/src/cpp/util/byte_buffer.o: +$(OBJDIR)/$(CONFIG)/src/cpp/util/slice.o: $(OBJDIR)/$(CONFIG)/src/cpp/util/status.o: $(OBJDIR)/$(CONFIG)/src/cpp/util/time.o: diff --git a/build.json b/build.json index 7dc792b258a..15b03c18ac5 100644 --- a/build.json +++ b/build.json @@ -413,6 +413,7 @@ "include/grpc++/server_builder.h", "include/grpc++/server_context.h", "include/grpc++/server_credentials.h", + "include/grpc++/slice.h", "include/grpc++/status.h", "include/grpc++/status_code_enum.h", "include/grpc++/stream.h", @@ -443,6 +444,7 @@ "src/cpp/server/server_credentials.cc", "src/cpp/server/thread_pool.cc", "src/cpp/util/byte_buffer.cc", + "src/cpp/util/slice.cc", "src/cpp/util/status.cc", "src/cpp/util/time.cc" ], diff --git a/include/grpc++/byte_buffer.h b/include/grpc++/byte_buffer.h index 36b301fd9db..e864ca3bba2 100644 --- a/include/grpc++/byte_buffer.h +++ b/include/grpc++/byte_buffer.h @@ -31,12 +31,15 @@ * */ -#ifndef __GRPCPP_BYTE_BUFFER_H_ -#define __GRPCPP_BYTE_BUFFER_H_ +#ifndef GRPCXX_BYTE_BUFFER_H +#define GRPCXX_BYTE_BUFFER_H #include #include #include +#include + +#include namespace grpc { @@ -44,29 +47,38 @@ class ByteBuffer GRPC_FINAL { public: ByteBuffer() : buffer_(nullptr) {} + ByteBuffer(Slice* slices, size_t nslices); + ~ByteBuffer() { if (buffer_) { grpc_byte_buffer_destroy(buffer_); } } + void Dump(std::vector* slices); + + void Clear(); + size_t Length(); + private: friend class CallOpBuffer; // takes ownership void set_buffer(grpc_byte_buffer* buf) { - GPR_ASSERT(!buffer_); + if (buffer_) { + gpr_log(GPR_ERROR, "Overriding existing buffer"); + Clear(); + } buffer_ = buf; } grpc_byte_buffer* buffer() const { - GPR_ASSERT(buffer_); return buffer_; } grpc_byte_buffer* buffer_; }; -} // namespace +} // namespace grpc -#endif +#endif // GRPCXX_BYTE_BUFFER_H diff --git a/include/grpc++/slice.h b/include/grpc++/slice.h index f1cb76ca80b..11b6a28d4f2 100644 --- a/include/grpc++/slice.h +++ b/include/grpc++/slice.h @@ -31,15 +31,15 @@ * */ -#ifndef __GRPCPP_SLICE_H_ -#define __GRPCPP_SLICE_H_ +#ifndef GRPCXX_SLICE_H +#define GRPCXX_SLICE_H -#include -#include +#include +#include namespace grpc { -class Slice { +class Slice GRPC_FINAL { public: // construct empty slice Slice(); @@ -54,16 +54,21 @@ class Slice { // copy constructor - adds a ref Slice(const Slice& other); // assignment - Slice& operator=(Slice other) { std::swap(slice_, other.slice_); } + Slice& operator=(Slice other) { + std::swap(slice_, other.slice_); + return *this; + } size_t size() const { return GPR_SLICE_LENGTH(slice_); } const gpr_uint8* begin() const { return GPR_SLICE_START_PTR(slice_); } const gpr_uint8* end() const { return GPR_SLICE_END_PTR(slice_); } private: + friend class ByteBuffer; + gpr_slice slice_; }; -} // namespace grpc +} // namespace grpc -#endif +#endif // GRPCXX_SLICE_H diff --git a/src/cpp/util/byte_buffer.cc b/src/cpp/util/byte_buffer.cc index 3846156ae38..ac2657472cf 100644 --- a/src/cpp/util/byte_buffer.cc +++ b/src/cpp/util/byte_buffer.cc @@ -1,2 +1,75 @@ +/* + * + * 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 + +namespace grpc { + +ByteBuffer::ByteBuffer(Slice* slices, size_t nslices) { + // TODO(yangg) maybe expose some core API to simplify this + std::vector c_slices(nslices); + for (size_t i = 0; i < nslices; i++) { + c_slices[i] = slices[i].slice_; + } + buffer_ = grpc_byte_buffer_create(c_slices.data(), nslices); +} + +void ByteBuffer::Clear() { + if (buffer_) { + grpc_byte_buffer_destroy(buffer_); + buffer_ = nullptr; + } +} + +void ByteBuffer::Dump(std::vector* slices) { + slices->clear(); + if (!buffer_) { + return; + } + grpc_byte_buffer_reader* reader = grpc_byte_buffer_reader_create(buffer_); + gpr_slice s; + while (grpc_byte_buffer_reader_next(reader, &s)) { + slices->push_back(Slice(s, Slice::STEAL_REF)); + } + grpc_byte_buffer_reader_destroy(reader); +} + +size_t ByteBuffer::Length() { + if (buffer_) { + return grpc_byte_buffer_length(buffer_); + } else { + return 0; + } +} + +} // namespace grpc diff --git a/src/cpp/util/slice.cc b/src/cpp/util/slice.cc new file mode 100644 index 00000000000..a549c5008df --- /dev/null +++ b/src/cpp/util/slice.cc @@ -0,0 +1,50 @@ +/* + * + * 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 + +namespace grpc { + +Slice::Slice() : slice_(gpr_empty_slice()) {} + +Slice::~Slice() { + gpr_slice_unref(slice_); +} + +Slice::Slice(gpr_slice slice, AddRef) : slice_(gpr_slice_ref(slice)) {} + +Slice::Slice(gpr_slice slice, StealRef) : slice_(slice) {} + +Slice::Slice(const Slice& other) : slice_(gpr_slice_ref(other.slice_)) {} + +} // namespace grpc From 086cd1108c2a4bbf247aaefab9959996aec0d33b Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 10 Mar 2015 12:51:05 -0700 Subject: [PATCH 07/75] read and copy add two ref's, unref one --- src/cpp/util/byte_buffer.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cpp/util/byte_buffer.cc b/src/cpp/util/byte_buffer.cc index ac2657472cf..f8d8eec0655 100644 --- a/src/cpp/util/byte_buffer.cc +++ b/src/cpp/util/byte_buffer.cc @@ -60,6 +60,7 @@ void ByteBuffer::Dump(std::vector* slices) { gpr_slice s; while (grpc_byte_buffer_reader_next(reader, &s)) { slices->push_back(Slice(s, Slice::STEAL_REF)); + gpr_slice_unref(s); } grpc_byte_buffer_reader_destroy(reader); } From b072a4ff754abb4b5077a5a110b7a01b6f828ed2 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Tue, 10 Mar 2015 21:13:15 +0100 Subject: [PATCH 08/75] Adding MSVC's grpc++ project file. --- .../vs2013/grpc++.vcxproj.filters.template | 2 + .../vsprojects/vs2013/grpc++.vcxproj.template | 2 + tools/buildgen/plugins/generate_vsprojects.py | 3 +- vsprojects/vs2013/grpc++.vcxproj | 167 ++++++++++++++++ vsprojects/vs2013/grpc++.vcxproj.filters | 187 ++++++++++++++++++ vsprojects/vs2013/grpc.sln | 10 + 6 files changed, 369 insertions(+), 2 deletions(-) create mode 100644 templates/vsprojects/vs2013/grpc++.vcxproj.filters.template create mode 100644 templates/vsprojects/vs2013/grpc++.vcxproj.template create mode 100644 vsprojects/vs2013/grpc++.vcxproj create mode 100644 vsprojects/vs2013/grpc++.vcxproj.filters diff --git a/templates/vsprojects/vs2013/grpc++.vcxproj.filters.template b/templates/vsprojects/vs2013/grpc++.vcxproj.filters.template new file mode 100644 index 00000000000..d74cce8c78f --- /dev/null +++ b/templates/vsprojects/vs2013/grpc++.vcxproj.filters.template @@ -0,0 +1,2 @@ +<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\ +${gen_filters('grpc++', libs, targets)} diff --git a/templates/vsprojects/vs2013/grpc++.vcxproj.template b/templates/vsprojects/vs2013/grpc++.vcxproj.template new file mode 100644 index 00000000000..93994bb392e --- /dev/null +++ b/templates/vsprojects/vs2013/grpc++.vcxproj.template @@ -0,0 +1,2 @@ +<%namespace file="vcxproj_defs.include" import="gen_project"/>\ +${gen_project('grpc++', libs, targets)} \ No newline at end of file diff --git a/tools/buildgen/plugins/generate_vsprojects.py b/tools/buildgen/plugins/generate_vsprojects.py index 6cbd74df667..f00c1762149 100755 --- a/tools/buildgen/plugins/generate_vsprojects.py +++ b/tools/buildgen/plugins/generate_vsprojects.py @@ -57,9 +57,8 @@ def mako_plugin(dictionary): projects = [project for project in projects if project.get('vs_project_guid', None)] - # Exclude C++ projects for now projects = [project for project in projects - if not project['language'] == 'c++'] + if project['language'] != 'c++' or project['build'] == 'all'] project_dict = dict([(p['name'], p) for p in projects]) diff --git a/vsprojects/vs2013/grpc++.vcxproj b/vsprojects/vs2013/grpc++.vcxproj new file mode 100644 index 00000000000..f0a623b79f8 --- /dev/null +++ b/vsprojects/vs2013/grpc++.vcxproj @@ -0,0 +1,167 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} + + + + StaticLibrary + true + v120 + Unicode + $(Configuration)\$(ProjectName)\ + + + StaticLibrary + false + v120 + true + Unicode + $(Configuration)\$(ProjectName)\ + + + + + + + + + + + + + + + grpc++ + + + grpc++ + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + + + + + + diff --git a/vsprojects/vs2013/grpc++.vcxproj.filters b/vsprojects/vs2013/grpc++.vcxproj.filters new file mode 100644 index 00000000000..34ebb170ffd --- /dev/null +++ b/vsprojects/vs2013/grpc++.vcxproj.filters @@ -0,0 +1,187 @@ + + + + + src\cpp\client + + + src\cpp\server + + + src\cpp\client + + + src\cpp\client + + + src\cpp\client + + + src\cpp\client + + + src\cpp\client + + + src\cpp\client + + + src\cpp\client + + + src\cpp\client + + + src\cpp\common + + + src\cpp\common + + + src\cpp\common + + + src\cpp\proto + + + src\cpp\server + + + src\cpp\server + + + src\cpp\server + + + src\cpp\server + + + src\cpp\server + + + src\cpp\server + + + src\cpp\util + + + src\cpp\util + + + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++\impl + + + include\grpc++\impl + + + include\grpc++\impl + + + include\grpc++\impl + + + include\grpc++\impl + + + include\grpc++\impl + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + include\grpc++ + + + + + src\cpp\client + + + src\cpp\proto + + + src\cpp\server + + + src\cpp\util + + + + + + {82445414-24cd-8198-1fe1-4267c3f3df00} + + + {784a0281-f547-aeb0-9f55-b26b7de9c769} + + + {0da8cd95-314f-da1b-5ce7-7791a5be1f1a} + + + {328ff211-2886-406e-56f9-18ba1686f363} + + + {2420a905-e4f1-a5aa-a364-6a112878a39e} + + + {7febf32a-d7a6-76fa-9e17-f189f591c062} + + + {2336e396-7e0b-8bf9-3b09-adc6ad1f0e5b} + + + {c22e8b9b-d2eb-a2e8-0cb8-3f7e3c902a7b} + + + {321b0980-74ad-e8ca-f23b-deffa5d6bb8f} + + + {f842537a-2bf1-1ec3-b495-7d62c64a1c06} + + + + diff --git a/vsprojects/vs2013/grpc.sln b/vsprojects/vs2013/grpc.sln index fd21ea782ea..a3915b3591b 100644 --- a/vsprojects/vs2013/grpc.sln +++ b/vsprojects/vs2013/grpc.sln @@ -26,6 +26,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_unsecure", "grpc_unsec {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc++", "grpc++.vcxproj", "{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}" + ProjectSection(ProjectDependencies) = postProject + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_csharp_ext", "grpc_csharp_ext.vcxproj", "{D64C6D63-4458-4A88-AB38-35678384A7E4}" ProjectSection(ProjectDependencies) = postProject {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} @@ -68,6 +74,10 @@ Global {46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}.Debug|Win32.Build.0 = Debug|Win32 {46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}.Release|Win32.ActiveCfg = Release|Win32 {46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}.Release|Win32.Build.0 = Release|Win32 + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Debug|Win32.ActiveCfg = Debug|Win32 + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Debug|Win32.Build.0 = Debug|Win32 + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release|Win32.ActiveCfg = Release|Win32 + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release|Win32.Build.0 = Release|Win32 {D64C6D63-4458-4A88-AB38-35678384A7E4}.Debug|Win32.ActiveCfg = Debug|Win32 {D64C6D63-4458-4A88-AB38-35678384A7E4}.Debug|Win32.Build.0 = Debug|Win32 {D64C6D63-4458-4A88-AB38-35678384A7E4}.Release|Win32.ActiveCfg = Release|Win32 From 0fd94409a0d5cb557b88d8c6038b57fa41d01b8b Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 11 Mar 2015 00:10:10 -0700 Subject: [PATCH 09/75] Expose server cq for polling incoming anonymous rpcs --- include/grpc++/server.h | 2 ++ src/cpp/server/server.cc | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/grpc++/server.h b/include/grpc++/server.h index a580a246328..b8083511816 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -70,6 +70,8 @@ class Server GRPC_FINAL : private CallHook, // function to ever return) void Wait(); + CompletionQueue* cq() { return &cq_; } + private: friend class AnonymousService; friend class ServerBuilder; diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index d8425f1dfcb..4328b2c0750 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -355,10 +355,8 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { array_.metadata[i].value + array_.metadata[i].value_length))); } if (anonymous_ctx_) { - anonymous_ctx_->method_.assign(call_details_.method, - call_details_.method_capacity); - anonymous_ctx_->host_.assign(call_details_.host, - call_details_.host_capacity); + anonymous_ctx_->method_ = call_details_.method; + anonymous_ctx_->host_ = call_details_.host; } } ctx->call_ = call_; From 0cb6c25e711ea32b4f2be1126cf0270837e0bc5f Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 11 Mar 2015 00:30:57 -0700 Subject: [PATCH 10/75] A first test with typed async client and untyped service for a simple rpc --- Makefile | 47 +- build.json | 16 + test/cpp/end2end/anonymous_end2end_test.cc | 563 +++++++++++++++++++++ tools/run_tests/tests.json | 5 + 4 files changed, 630 insertions(+), 1 deletion(-) create mode 100644 test/cpp/end2end/anonymous_end2end_test.cc diff --git a/Makefile b/Makefile index d228adcd7be..1b8161e846e 100644 --- a/Makefile +++ b/Makefile @@ -531,6 +531,7 @@ time_test: $(BINDIR)/$(CONFIG)/time_test timeout_encoding_test: $(BINDIR)/$(CONFIG)/timeout_encoding_test transport_metadata_test: $(BINDIR)/$(CONFIG)/transport_metadata_test transport_security_test: $(BINDIR)/$(CONFIG)/transport_security_test +anonymous_end2end_test: $(BINDIR)/$(CONFIG)/anonymous_end2end_test async_end2end_test: $(BINDIR)/$(CONFIG)/async_end2end_test channel_arguments_test: $(BINDIR)/$(CONFIG)/channel_arguments_test credentials_test: $(BINDIR)/$(CONFIG)/credentials_test @@ -965,7 +966,7 @@ buildtests: buildtests_c buildtests_cxx buildtests_c: privatelibs_c $(BINDIR)/$(CONFIG)/alarm_heap_test $(BINDIR)/$(CONFIG)/alarm_list_test $(BINDIR)/$(CONFIG)/alarm_test $(BINDIR)/$(CONFIG)/alpn_test $(BINDIR)/$(CONFIG)/bin_encoder_test $(BINDIR)/$(CONFIG)/census_hash_table_test $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_circular_buffer_test $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_test $(BINDIR)/$(CONFIG)/census_statistics_performance_test $(BINDIR)/$(CONFIG)/census_statistics_quick_test $(BINDIR)/$(CONFIG)/census_statistics_small_log_test $(BINDIR)/$(CONFIG)/census_stub_test $(BINDIR)/$(CONFIG)/census_window_stats_test $(BINDIR)/$(CONFIG)/chttp2_status_conversion_test $(BINDIR)/$(CONFIG)/chttp2_stream_encoder_test $(BINDIR)/$(CONFIG)/chttp2_stream_map_test $(BINDIR)/$(CONFIG)/chttp2_transport_end2end_test $(BINDIR)/$(CONFIG)/dualstack_socket_test $(BINDIR)/$(CONFIG)/echo_client $(BINDIR)/$(CONFIG)/echo_server $(BINDIR)/$(CONFIG)/echo_test $(BINDIR)/$(CONFIG)/fd_posix_test $(BINDIR)/$(CONFIG)/fling_client $(BINDIR)/$(CONFIG)/fling_server $(BINDIR)/$(CONFIG)/fling_stream_test $(BINDIR)/$(CONFIG)/fling_test $(BINDIR)/$(CONFIG)/gpr_cancellable_test $(BINDIR)/$(CONFIG)/gpr_cmdline_test $(BINDIR)/$(CONFIG)/gpr_env_test $(BINDIR)/$(CONFIG)/gpr_file_test $(BINDIR)/$(CONFIG)/gpr_histogram_test $(BINDIR)/$(CONFIG)/gpr_host_port_test $(BINDIR)/$(CONFIG)/gpr_log_test $(BINDIR)/$(CONFIG)/gpr_slice_buffer_test $(BINDIR)/$(CONFIG)/gpr_slice_test $(BINDIR)/$(CONFIG)/gpr_string_test $(BINDIR)/$(CONFIG)/gpr_sync_test $(BINDIR)/$(CONFIG)/gpr_thd_test $(BINDIR)/$(CONFIG)/gpr_time_test $(BINDIR)/$(CONFIG)/gpr_useful_test $(BINDIR)/$(CONFIG)/grpc_base64_test $(BINDIR)/$(CONFIG)/grpc_byte_buffer_reader_test $(BINDIR)/$(CONFIG)/grpc_channel_stack_test $(BINDIR)/$(CONFIG)/grpc_completion_queue_test $(BINDIR)/$(CONFIG)/grpc_credentials_test $(BINDIR)/$(CONFIG)/grpc_json_token_test $(BINDIR)/$(CONFIG)/grpc_stream_op_test $(BINDIR)/$(CONFIG)/hpack_parser_test $(BINDIR)/$(CONFIG)/hpack_table_test $(BINDIR)/$(CONFIG)/httpcli_format_request_test $(BINDIR)/$(CONFIG)/httpcli_parser_test $(BINDIR)/$(CONFIG)/httpcli_test $(BINDIR)/$(CONFIG)/json_rewrite $(BINDIR)/$(CONFIG)/json_rewrite_test $(BINDIR)/$(CONFIG)/json_test $(BINDIR)/$(CONFIG)/lame_client_test $(BINDIR)/$(CONFIG)/message_compress_test $(BINDIR)/$(CONFIG)/metadata_buffer_test $(BINDIR)/$(CONFIG)/multi_init_test $(BINDIR)/$(CONFIG)/murmur_hash_test $(BINDIR)/$(CONFIG)/no_server_test $(BINDIR)/$(CONFIG)/poll_kick_posix_test $(BINDIR)/$(CONFIG)/resolve_address_test $(BINDIR)/$(CONFIG)/secure_endpoint_test $(BINDIR)/$(CONFIG)/sockaddr_utils_test $(BINDIR)/$(CONFIG)/tcp_client_posix_test $(BINDIR)/$(CONFIG)/tcp_posix_test $(BINDIR)/$(CONFIG)/tcp_server_posix_test $(BINDIR)/$(CONFIG)/time_averaged_stats_test $(BINDIR)/$(CONFIG)/time_test $(BINDIR)/$(CONFIG)/timeout_encoding_test $(BINDIR)/$(CONFIG)/transport_metadata_test $(BINDIR)/$(CONFIG)/transport_security_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pending_read_legacy_test -buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR)/$(CONFIG)/channel_arguments_test $(BINDIR)/$(CONFIG)/credentials_test $(BINDIR)/$(CONFIG)/end2end_test $(BINDIR)/$(CONFIG)/interop_client $(BINDIR)/$(CONFIG)/interop_server $(BINDIR)/$(CONFIG)/interop_test $(BINDIR)/$(CONFIG)/pubsub_client $(BINDIR)/$(CONFIG)/pubsub_publisher_test $(BINDIR)/$(CONFIG)/pubsub_subscriber_test $(BINDIR)/$(CONFIG)/qps_driver $(BINDIR)/$(CONFIG)/qps_worker $(BINDIR)/$(CONFIG)/status_test $(BINDIR)/$(CONFIG)/thread_pool_test +buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/anonymous_end2end_test $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR)/$(CONFIG)/channel_arguments_test $(BINDIR)/$(CONFIG)/credentials_test $(BINDIR)/$(CONFIG)/end2end_test $(BINDIR)/$(CONFIG)/interop_client $(BINDIR)/$(CONFIG)/interop_server $(BINDIR)/$(CONFIG)/interop_test $(BINDIR)/$(CONFIG)/pubsub_client $(BINDIR)/$(CONFIG)/pubsub_publisher_test $(BINDIR)/$(CONFIG)/pubsub_subscriber_test $(BINDIR)/$(CONFIG)/qps_driver $(BINDIR)/$(CONFIG)/qps_worker $(BINDIR)/$(CONFIG)/status_test $(BINDIR)/$(CONFIG)/thread_pool_test test: test_c test_cxx @@ -1793,6 +1794,8 @@ test_c: buildtests_c test_cxx: buildtests_cxx + $(E) "[RUN] Testing anonymous_end2end_test" + $(Q) $(BINDIR)/$(CONFIG)/anonymous_end2end_test || ( echo test anonymous_end2end_test failed ; exit 1 ) $(E) "[RUN] Testing async_end2end_test" $(Q) $(BINDIR)/$(CONFIG)/async_end2end_test || ( echo test async_end2end_test failed ; exit 1 ) $(E) "[RUN] Testing channel_arguments_test" @@ -7776,6 +7779,48 @@ endif endif +ANONYMOUS_END2END_TEST_SRC = \ + test/cpp/end2end/anonymous_end2end_test.cc \ + +ANONYMOUS_END2END_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ANONYMOUS_END2END_TEST_SRC)))) + +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL with ALPN. + +$(BINDIR)/$(CONFIG)/anonymous_end2end_test: openssl_dep_error + +else + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. + +$(BINDIR)/$(CONFIG)/anonymous_end2end_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/anonymous_end2end_test: $(PROTOBUF_DEP) $(ANONYMOUS_END2END_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(ANONYMOUS_END2END_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/anonymous_end2end_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/test/cpp/end2end/anonymous_end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_anonymous_end2end_test: $(ANONYMOUS_END2END_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(ANONYMOUS_END2END_TEST_OBJS:.o=.dep) +endif +endif + + ASYNC_END2END_TEST_SRC = \ test/cpp/end2end/async_end2end_test.cc \ diff --git a/build.json b/build.json index eeb0755f4b9..9b217dc909e 100644 --- a/build.json +++ b/build.json @@ -1646,6 +1646,22 @@ "gpr" ] }, + { + "name": "anonymous_end2end_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/end2end/anonymous_end2end_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, { "name": "async_end2end_test", "build": "test", diff --git a/test/cpp/end2end/anonymous_end2end_test.cc b/test/cpp/end2end/anonymous_end2end_test.cc new file mode 100644 index 00000000000..362c0cd4a47 --- /dev/null +++ b/test/cpp/end2end/anonymous_end2end_test.cc @@ -0,0 +1,563 @@ +/* + * + * 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 +#include + +#include "test/core/util/test_config.h" +#include "test/cpp/util/echo.pb.h" +#include "src/cpp/util/time.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "test/core/util/port.h" +#include + +#include +#include +#include + +using grpc::cpp::test::util::EchoRequest; +using grpc::cpp::test::util::EchoResponse; +using std::chrono::system_clock; + +namespace grpc { +namespace testing { +namespace { + +void* tag(int i) { return (void*)(gpr_intptr)i; } + +void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { + bool ok; + void* got_tag; + EXPECT_TRUE(cq->Next(&got_tag, &ok)); + EXPECT_EQ(expect_ok, ok); + EXPECT_EQ(tag(i), got_tag); +} + +class AnonymousEnd2endTest : public ::testing::Test { + protected: + AnonymousEnd2endTest() {} + + void SetUp() GRPC_OVERRIDE { + int port = grpc_pick_unused_port_or_die(); + server_address_ << "localhost:" << port; + // Setup server + ServerBuilder builder; + builder.AddPort(server_address_.str(), InsecureServerCredentials()); + builder.RegisterAnonymousService(&anonymous_service_); + server_ = builder.BuildAndStart(); + } + + void TearDown() GRPC_OVERRIDE { + server_->Shutdown(); + void* ignored_tag; + bool ignored_ok; + cli_cq_.Shutdown(); + srv_cq_.Shutdown(); + while (cli_cq_.Next(&ignored_tag, &ignored_ok)) + ; + while (srv_cq_.Next(&ignored_tag, &ignored_ok)) + ; + } + + void ResetStub() { + std::shared_ptr channel = + CreateChannel(server_address_.str(), InsecureCredentials(), ChannelArguments()); + stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel)); + } + + void server_ok(int i) { verify_ok(&srv_cq_, i, true); } + void client_ok(int i) { verify_ok(&cli_cq_, i, true); } + void server_fail(int i) { verify_ok(&srv_cq_, i, false); } + void client_fail(int i) { verify_ok(&cli_cq_, i, false); } + + void SendRpc(int num_rpcs) { + for (int i = 0; i < num_rpcs; i++) { + EchoRequest send_request; + EchoRequest recv_request; + EchoResponse send_response; + EchoResponse recv_response; + Status recv_status; + + ClientContext cli_ctx; + AnonymousServerContext srv_ctx; + GenericServerReaderWriter stream(&srv_ctx); + + send_request.set_message("Hello"); + std::unique_ptr > response_reader( + stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); + client_ok(1); + + anonymous_service_.RequestCall(&srv_ctx, &stream, &srv_cq_, tag(2)); + + verify_ok(server_->cq(), 2, true); + EXPECT_EQ(server_address_.str(), srv_ctx.host()); + EXPECT_EQ("/grpc.cpp.test.util.TestService/Echo", srv_ctx.method()); + ByteBuffer recv_buffer; + stream.Read(&recv_buffer, tag(3)); + server_ok(3); + std::vector slices; + recv_buffer.Dump(&slices); + EXPECT_EQ(1, slices.size()); // FIXME(yangg) handle real vector + grpc::string buf(reinterpret_cast(slices[0].begin()), + slices[0].size()); + EXPECT_TRUE(recv_request.ParseFromString(buf)); + EXPECT_EQ(send_request.message(), recv_request.message()); + + send_response.set_message(recv_request.message()); + buf.clear(); + send_response.SerializeToString(&buf); + gpr_slice s = gpr_slice_from_copied_string(buf.c_str()); + Slice slice(s, Slice::STEAL_REF); + ByteBuffer send_buffer(&slice, 1); + stream.Write(send_buffer, tag(4)); + server_ok(4); + + stream.Finish(Status::OK, tag(5)); + server_ok(5); + + response_reader->Finish(&recv_response, &recv_status, tag(4)); + client_ok(4); + + EXPECT_EQ(send_response.message(), recv_response.message()); + EXPECT_TRUE(recv_status.IsOk()); + } + } + + CompletionQueue cli_cq_; + CompletionQueue srv_cq_; + std::unique_ptr stub_; + std::unique_ptr server_; + AnonymousService anonymous_service_; + std::ostringstream server_address_; +}; + +TEST_F(AnonymousEnd2endTest, SimpleRpc) { + ResetStub(); + SendRpc(1); +} + +TEST_F(AnonymousEnd2endTest, SequentialRpcs) { + ResetStub(); + SendRpc(10); +} + +// // Two pings and a final pong. +// TEST_F(AnonymousEnd2endTest, SimpleClientStreaming) { +// ResetStub(); +// +// EchoRequest send_request; +// EchoRequest recv_request; +// EchoResponse send_response; +// EchoResponse recv_response; +// Status recv_status; +// ClientContext cli_ctx; +// ServerContext srv_ctx; +// ServerAsyncReader srv_stream(&srv_ctx); +// +// send_request.set_message("Hello"); +// std::unique_ptr > cli_stream( +// stub_->AsyncRequestStream(&cli_ctx, &recv_response, &cli_cq_, tag(1))); +// +// service_.RequestRequestStream(&srv_ctx, &srv_stream, &srv_cq_, tag(2)); +// +// server_ok(2); +// client_ok(1); +// +// cli_stream->Write(send_request, tag(3)); +// client_ok(3); +// +// srv_stream.Read(&recv_request, tag(4)); +// server_ok(4); +// EXPECT_EQ(send_request.message(), recv_request.message()); +// +// cli_stream->Write(send_request, tag(5)); +// client_ok(5); +// +// srv_stream.Read(&recv_request, tag(6)); +// server_ok(6); +// +// EXPECT_EQ(send_request.message(), recv_request.message()); +// cli_stream->WritesDone(tag(7)); +// client_ok(7); +// +// srv_stream.Read(&recv_request, tag(8)); +// server_fail(8); +// +// send_response.set_message(recv_request.message()); +// srv_stream.Finish(send_response, Status::OK, tag(9)); +// server_ok(9); +// +// cli_stream->Finish(&recv_status, tag(10)); +// client_ok(10); +// +// EXPECT_EQ(send_response.message(), recv_response.message()); +// EXPECT_TRUE(recv_status.IsOk()); +// } +// +// // One ping, two pongs. +// TEST_F(AnonymousEnd2endTest, SimpleServerStreaming) { +// ResetStub(); +// +// EchoRequest send_request; +// EchoRequest recv_request; +// EchoResponse send_response; +// EchoResponse recv_response; +// Status recv_status; +// ClientContext cli_ctx; +// ServerContext srv_ctx; +// ServerAsyncWriter srv_stream(&srv_ctx); +// +// send_request.set_message("Hello"); +// std::unique_ptr > cli_stream( +// stub_->AsyncResponseStream(&cli_ctx, send_request, &cli_cq_, tag(1))); +// +// service_.RequestResponseStream(&srv_ctx, &recv_request, &srv_stream, &srv_cq_, +// tag(2)); +// +// server_ok(2); +// client_ok(1); +// EXPECT_EQ(send_request.message(), recv_request.message()); +// +// send_response.set_message(recv_request.message()); +// srv_stream.Write(send_response, tag(3)); +// server_ok(3); +// +// cli_stream->Read(&recv_response, tag(4)); +// client_ok(4); +// EXPECT_EQ(send_response.message(), recv_response.message()); +// +// srv_stream.Write(send_response, tag(5)); +// server_ok(5); +// +// cli_stream->Read(&recv_response, tag(6)); +// client_ok(6); +// EXPECT_EQ(send_response.message(), recv_response.message()); +// +// srv_stream.Finish(Status::OK, tag(7)); +// server_ok(7); +// +// cli_stream->Read(&recv_response, tag(8)); +// client_fail(8); +// +// cli_stream->Finish(&recv_status, tag(9)); +// client_ok(9); +// +// EXPECT_TRUE(recv_status.IsOk()); +// } +// +// // One ping, one pong. +// TEST_F(AnonymousEnd2endTest, SimpleBidiStreaming) { +// ResetStub(); +// +// EchoRequest send_request; +// EchoRequest recv_request; +// EchoResponse send_response; +// EchoResponse recv_response; +// Status recv_status; +// ClientContext cli_ctx; +// ServerContext srv_ctx; +// ServerAsyncReaderWriter srv_stream(&srv_ctx); +// +// send_request.set_message("Hello"); +// std::unique_ptr > +// cli_stream(stub_->AsyncBidiStream(&cli_ctx, &cli_cq_, tag(1))); +// +// service_.RequestBidiStream(&srv_ctx, &srv_stream, &srv_cq_, tag(2)); +// +// server_ok(2); +// client_ok(1); +// +// cli_stream->Write(send_request, tag(3)); +// client_ok(3); +// +// srv_stream.Read(&recv_request, tag(4)); +// server_ok(4); +// EXPECT_EQ(send_request.message(), recv_request.message()); +// +// send_response.set_message(recv_request.message()); +// srv_stream.Write(send_response, tag(5)); +// server_ok(5); +// +// cli_stream->Read(&recv_response, tag(6)); +// client_ok(6); +// EXPECT_EQ(send_response.message(), recv_response.message()); +// +// cli_stream->WritesDone(tag(7)); +// client_ok(7); +// +// srv_stream.Read(&recv_request, tag(8)); +// server_fail(8); +// +// srv_stream.Finish(Status::OK, tag(9)); +// server_ok(9); +// +// cli_stream->Finish(&recv_status, tag(10)); +// client_ok(10); +// +// EXPECT_TRUE(recv_status.IsOk()); +// } +// +// // Metadata tests +// TEST_F(AnonymousEnd2endTest, ClientInitialMetadataRpc) { +// ResetStub(); +// +// EchoRequest send_request; +// EchoRequest recv_request; +// EchoResponse send_response; +// EchoResponse recv_response; +// Status recv_status; +// +// ClientContext cli_ctx; +// ServerContext srv_ctx; +// grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); +// +// send_request.set_message("Hello"); +// std::pair meta1("key1", "val1"); +// std::pair meta2("key2", "val2"); +// cli_ctx.AddMetadata(meta1.first, meta1.second); +// cli_ctx.AddMetadata(meta2.first, meta2.second); +// +// std::unique_ptr > response_reader( +// stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); +// +// service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, +// tag(2)); +// server_ok(2); +// EXPECT_EQ(send_request.message(), recv_request.message()); +// auto client_initial_metadata = srv_ctx.client_metadata(); +// EXPECT_EQ(meta1.second, client_initial_metadata.find(meta1.first)->second); +// EXPECT_EQ(meta2.second, client_initial_metadata.find(meta2.first)->second); +// EXPECT_EQ(static_cast(2), client_initial_metadata.size()); +// client_ok(1); +// +// send_response.set_message(recv_request.message()); +// response_writer.Finish(send_response, Status::OK, tag(3)); +// +// server_ok(3); +// +// response_reader->Finish(&recv_response, &recv_status, tag(4)); +// client_ok(4); +// +// EXPECT_EQ(send_response.message(), recv_response.message()); +// EXPECT_TRUE(recv_status.IsOk()); +// } +// +// TEST_F(AnonymousEnd2endTest, ServerInitialMetadataRpc) { +// ResetStub(); +// +// EchoRequest send_request; +// EchoRequest recv_request; +// EchoResponse send_response; +// EchoResponse recv_response; +// Status recv_status; +// +// ClientContext cli_ctx; +// ServerContext srv_ctx; +// grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); +// +// send_request.set_message("Hello"); +// std::pair meta1("key1", "val1"); +// std::pair meta2("key2", "val2"); +// +// std::unique_ptr > response_reader( +// stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); +// +// service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, +// tag(2)); +// server_ok(2); +// EXPECT_EQ(send_request.message(), recv_request.message()); +// srv_ctx.AddInitialMetadata(meta1.first, meta1.second); +// srv_ctx.AddInitialMetadata(meta2.first, meta2.second); +// client_ok(1); +// response_writer.SendInitialMetadata(tag(3)); +// server_ok(3); +// +// response_reader->ReadInitialMetadata(tag(4)); +// client_ok(4); +// auto server_initial_metadata = cli_ctx.GetServerInitialMetadata(); +// EXPECT_EQ(meta1.second, server_initial_metadata.find(meta1.first)->second); +// EXPECT_EQ(meta2.second, server_initial_metadata.find(meta2.first)->second); +// EXPECT_EQ(static_cast(2), server_initial_metadata.size()); +// +// send_response.set_message(recv_request.message()); +// response_writer.Finish(send_response, Status::OK, tag(5)); +// server_ok(5); +// +// response_reader->Finish(&recv_response, &recv_status, tag(6)); +// client_ok(6); +// +// EXPECT_EQ(send_response.message(), recv_response.message()); +// EXPECT_TRUE(recv_status.IsOk()); +// } +// +// TEST_F(AnonymousEnd2endTest, ServerTrailingMetadataRpc) { +// ResetStub(); +// +// EchoRequest send_request; +// EchoRequest recv_request; +// EchoResponse send_response; +// EchoResponse recv_response; +// Status recv_status; +// +// ClientContext cli_ctx; +// ServerContext srv_ctx; +// grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); +// +// send_request.set_message("Hello"); +// std::pair meta1("key1", "val1"); +// std::pair meta2("key2", "val2"); +// +// std::unique_ptr > response_reader( +// stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); +// +// service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, +// tag(2)); +// server_ok(2); +// EXPECT_EQ(send_request.message(), recv_request.message()); +// response_writer.SendInitialMetadata(tag(3)); +// server_ok(3); +// client_ok(1); +// +// send_response.set_message(recv_request.message()); +// srv_ctx.AddTrailingMetadata(meta1.first, meta1.second); +// srv_ctx.AddTrailingMetadata(meta2.first, meta2.second); +// response_writer.Finish(send_response, Status::OK, tag(4)); +// +// server_ok(4); +// +// response_reader->Finish(&recv_response, &recv_status, tag(5)); +// client_ok(5); +// EXPECT_EQ(send_response.message(), recv_response.message()); +// EXPECT_TRUE(recv_status.IsOk()); +// auto server_trailing_metadata = cli_ctx.GetServerTrailingMetadata(); +// EXPECT_EQ(meta1.second, server_trailing_metadata.find(meta1.first)->second); +// EXPECT_EQ(meta2.second, server_trailing_metadata.find(meta2.first)->second); +// EXPECT_EQ(static_cast(2), server_trailing_metadata.size()); +// } +// +// TEST_F(AnonymousEnd2endTest, MetadataRpc) { +// ResetStub(); +// +// EchoRequest send_request; +// EchoRequest recv_request; +// EchoResponse send_response; +// EchoResponse recv_response; +// Status recv_status; +// +// ClientContext cli_ctx; +// ServerContext srv_ctx; +// grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); +// +// send_request.set_message("Hello"); +// std::pair meta1("key1", "val1"); +// std::pair meta2( +// "key2-bin", {"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc", 13}); +// std::pair meta3("key3", "val3"); +// std::pair meta6( +// "key4-bin", +// {"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d", 14}); +// std::pair meta5("key5", "val5"); +// std::pair meta4( +// "key6-bin", +// {"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee", 15}); +// +// cli_ctx.AddMetadata(meta1.first, meta1.second); +// cli_ctx.AddMetadata(meta2.first, meta2.second); +// +// std::unique_ptr > response_reader( +// stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); +// +// service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, +// tag(2)); +// server_ok(2); +// EXPECT_EQ(send_request.message(), recv_request.message()); +// auto client_initial_metadata = srv_ctx.client_metadata(); +// EXPECT_EQ(meta1.second, client_initial_metadata.find(meta1.first)->second); +// EXPECT_EQ(meta2.second, client_initial_metadata.find(meta2.first)->second); +// EXPECT_EQ(static_cast(2), client_initial_metadata.size()); +// client_ok(1); +// +// srv_ctx.AddInitialMetadata(meta3.first, meta3.second); +// srv_ctx.AddInitialMetadata(meta4.first, meta4.second); +// response_writer.SendInitialMetadata(tag(3)); +// server_ok(3); +// response_reader->ReadInitialMetadata(tag(4)); +// client_ok(4); +// auto server_initial_metadata = cli_ctx.GetServerInitialMetadata(); +// EXPECT_EQ(meta3.second, server_initial_metadata.find(meta3.first)->second); +// EXPECT_EQ(meta4.second, server_initial_metadata.find(meta4.first)->second); +// EXPECT_EQ(static_cast(2), server_initial_metadata.size()); +// +// send_response.set_message(recv_request.message()); +// srv_ctx.AddTrailingMetadata(meta5.first, meta5.second); +// srv_ctx.AddTrailingMetadata(meta6.first, meta6.second); +// response_writer.Finish(send_response, Status::OK, tag(5)); +// +// server_ok(5); +// +// response_reader->Finish(&recv_response, &recv_status, tag(6)); +// client_ok(6); +// EXPECT_EQ(send_response.message(), recv_response.message()); +// EXPECT_TRUE(recv_status.IsOk()); +// auto server_trailing_metadata = cli_ctx.GetServerTrailingMetadata(); +// EXPECT_EQ(meta5.second, server_trailing_metadata.find(meta5.first)->second); +// EXPECT_EQ(meta6.second, server_trailing_metadata.find(meta6.first)->second); +// EXPECT_EQ(static_cast(2), server_trailing_metadata.size()); +// } +} // namespace +} // namespace testing +} // namespace grpc + +int main(int argc, char** argv) { + grpc_test_init(argc, argv); + grpc_init(); + ::testing::InitGoogleTest(&argc, argv); + int result = RUN_ALL_TESTS(); + grpc_shutdown(); + google::protobuf::ShutdownProtobufLibrary(); + return result; +} diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 6f354452aa5..7d2d64f14aa 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -336,6 +336,11 @@ "language": "c", "name": "transport_security_test" }, + { + "flaky": false, + "language": "c++", + "name": "anonymous_end2end_test" + }, { "flaky": false, "language": "c++", From 0535da306887779adb79f2adcf35910664532a99 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 11 Mar 2015 14:51:03 -0700 Subject: [PATCH 11/75] The Jwt code was dropped somewhere in a merge. Put it back --- include/grpc++/credentials.h | 8 ++++++++ src/cpp/client/secure_credentials.cc | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/include/grpc++/credentials.h b/include/grpc++/credentials.h index c677cc3e0a3..d480e0819ae 100644 --- a/include/grpc++/credentials.h +++ b/include/grpc++/credentials.h @@ -105,6 +105,14 @@ std::unique_ptr ServiceAccountCredentials( const grpc::string& json_key, const grpc::string& scope, std::chrono::seconds token_lifetime); + // Builds JWT credentials. + // json_key is the JSON key string containing the client's private key. + // token_lifetime is the lifetime of each Json Web Token (JWT) created with + // this credentials. It should not exceed grpc_max_auth_token_lifetime or + // will be cropped to this value. +std::unique_ptr JWTCredentials( + const grpc::string& json_key, std::chrono::seconds token_lifetime); + // Builds IAM credentials. std::unique_ptr IAMCredentials( const grpc::string& authorization_token, diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index 47f645c1b63..795d7731c93 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -104,6 +104,15 @@ std::unique_ptr ServiceAccountCredentials( json_key.c_str(), scope.c_str(), lifetime)); } +// Builds JWT credentials. +std::unique_ptr JWTCredentials( + const grpc::string &json_key, std::chrono::seconds token_lifetime) { + gpr_timespec lifetime = gpr_time_from_seconds( + token_lifetime.count() > 0 ? token_lifetime.count() : 0); + return WrapCredentials( + grpc_jwt_credentials_create(json_key.c_str(), lifetime)); +} + // Builds IAM credentials. std::unique_ptr IAMCredentials( const grpc::string& authorization_token, From 7d6b184f57603fd047bb95776fc78e914c979d8c Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 11 Mar 2015 14:51:50 -0700 Subject: [PATCH 12/75] add a jwt test case for interop test --- test/cpp/interop/client.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index 132e6e90682..e5645e568e0 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -86,6 +86,7 @@ using grpc::ClientContext; using grpc::ComputeEngineCredentials; using grpc::CreateTestChannel; using grpc::Credentials; +using grpc::JWTCredentials; using grpc::ServiceAccountCredentials; using grpc::testing::ResponseParameters; using grpc::testing::SimpleRequest; @@ -151,7 +152,7 @@ std::shared_ptr CreateChannelForTestCase( std::unique_ptr creds; GPR_ASSERT(FLAGS_enable_ssl); grpc::string json_key = GetServiceAccountJsonKey(); - creds = CredentialsFactory::JWTCredentials(json_key, std::chrono::hours(1)); + creds = JWTCredentials(json_key, std::chrono::hours(1)); return CreateTestChannel(host_port, FLAGS_server_host_override, FLAGS_enable_ssl, FLAGS_use_prod_roots, creds); } else { From d778651c0147393eee2e41de0ac86322473c4186 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 11 Mar 2015 14:55:02 -0700 Subject: [PATCH 13/75] formatting --- include/grpc++/credentials.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/grpc++/credentials.h b/include/grpc++/credentials.h index d480e0819ae..59ad638f47d 100644 --- a/include/grpc++/credentials.h +++ b/include/grpc++/credentials.h @@ -105,11 +105,11 @@ std::unique_ptr ServiceAccountCredentials( const grpc::string& json_key, const grpc::string& scope, std::chrono::seconds token_lifetime); - // Builds JWT credentials. - // json_key is the JSON key string containing the client's private key. - // token_lifetime is the lifetime of each Json Web Token (JWT) created with - // this credentials. It should not exceed grpc_max_auth_token_lifetime or - // will be cropped to this value. +// Builds JWT credentials. +// json_key is the JSON key string containing the client's private key. +// token_lifetime is the lifetime of each Json Web Token (JWT) created with +// this credentials. It should not exceed grpc_max_auth_token_lifetime or +// will be cropped to this value. std::unique_ptr JWTCredentials( const grpc::string& json_key, std::chrono::seconds token_lifetime); From ee705f6d6681fb22e0b364999763cf84a2cb1197 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 11 Mar 2015 15:52:43 -0700 Subject: [PATCH 14/75] Add support for deadline on CompletionQueue::Next If the deadline elapses, return true but have a null tag. --- include/grpc++/completion_queue.h | 9 +++++---- src/cpp/common/completion_queue.cc | 9 +++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index f741e3c36bb..db6e6d41f31 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -34,6 +34,7 @@ #ifndef GRPCXX_COMPLETION_QUEUE_H #define GRPCXX_COMPLETION_QUEUE_H +#include #include struct grpc_completion_queue; @@ -75,10 +76,10 @@ class CompletionQueue { explicit CompletionQueue(grpc_completion_queue *take); ~CompletionQueue(); - // Blocking read from queue. - // Returns true if an event was received, false if the queue is ready - // for destruction. - bool Next(void **tag, bool *ok); + // Blocking (until deadline) read from queue. + // Returns false if the queue is ready for destruction, true otherwise + // If the deadline passed, *tag will be null + bool Next(void **tag, bool *ok, gpr_timespec deadline=gpr_inf_future); // Shutdown has to be called, and the CompletionQueue can only be // destructed when false is returned from Next(). diff --git a/src/cpp/common/completion_queue.cc b/src/cpp/common/completion_queue.cc index 414966c1cdf..c37e97909b8 100644 --- a/src/cpp/common/completion_queue.cc +++ b/src/cpp/common/completion_queue.cc @@ -57,11 +57,16 @@ class EventDeleter { } }; -bool CompletionQueue::Next(void** tag, bool* ok) { +bool CompletionQueue::Next(void** tag, bool* ok, gpr_timespec deadline) { std::unique_ptr ev; for (;;) { - ev.reset(grpc_completion_queue_next(cq_, gpr_inf_future)); + ev.reset(grpc_completion_queue_next(cq_, deadline)); + if (!ev) { /* got a NULL back because deadline passed */ + *ok = true; + *tag = nullptr; + return true; + } if (ev->type == GRPC_QUEUE_SHUTDOWN) { return false; } From 005eb88c45a849ed73d02e9cfbdce939ea34540e Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 11 Mar 2015 22:17:13 -0700 Subject: [PATCH 15/75] Rename anonymous to generic globally --- Makefile | 106 +++++++++--------- build.json | 30 ++--- ...{anonymous_service.h => generic_service.h} | 14 +-- .../{anonymous_stub.h => generic_stub.h} | 12 +- include/grpc++/server.h | 14 +-- include/grpc++/server_builder.h | 8 +- ...nonymous_service.cc => generic_service.cc} | 10 +- src/cpp/server/server.cc | 28 ++--- src/cpp/server/server_builder.cc | 14 +-- ...nd2end_test.cc => generic_end2end_test.cc} | 32 +++--- tools/run_tests/tests.json | 10 +- 11 files changed, 139 insertions(+), 139 deletions(-) rename include/grpc++/{anonymous_service.h => generic_service.h} (89%) rename include/grpc++/{anonymous_stub.h => generic_stub.h} (87%) rename src/cpp/server/{anonymous_service.cc => generic_service.cc} (84%) rename test/cpp/end2end/{anonymous_end2end_test.cc => generic_end2end_test.cc} (95%) diff --git a/Makefile b/Makefile index 1b8161e846e..853a8a3f4dc 100644 --- a/Makefile +++ b/Makefile @@ -531,11 +531,11 @@ time_test: $(BINDIR)/$(CONFIG)/time_test timeout_encoding_test: $(BINDIR)/$(CONFIG)/timeout_encoding_test transport_metadata_test: $(BINDIR)/$(CONFIG)/transport_metadata_test transport_security_test: $(BINDIR)/$(CONFIG)/transport_security_test -anonymous_end2end_test: $(BINDIR)/$(CONFIG)/anonymous_end2end_test async_end2end_test: $(BINDIR)/$(CONFIG)/async_end2end_test channel_arguments_test: $(BINDIR)/$(CONFIG)/channel_arguments_test credentials_test: $(BINDIR)/$(CONFIG)/credentials_test end2end_test: $(BINDIR)/$(CONFIG)/end2end_test +generic_end2end_test: $(BINDIR)/$(CONFIG)/generic_end2end_test grpc_cpp_plugin: $(BINDIR)/$(CONFIG)/grpc_cpp_plugin grpc_python_plugin: $(BINDIR)/$(CONFIG)/grpc_python_plugin grpc_ruby_plugin: $(BINDIR)/$(CONFIG)/grpc_ruby_plugin @@ -966,7 +966,7 @@ buildtests: buildtests_c buildtests_cxx buildtests_c: privatelibs_c $(BINDIR)/$(CONFIG)/alarm_heap_test $(BINDIR)/$(CONFIG)/alarm_list_test $(BINDIR)/$(CONFIG)/alarm_test $(BINDIR)/$(CONFIG)/alpn_test $(BINDIR)/$(CONFIG)/bin_encoder_test $(BINDIR)/$(CONFIG)/census_hash_table_test $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_circular_buffer_test $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_test $(BINDIR)/$(CONFIG)/census_statistics_performance_test $(BINDIR)/$(CONFIG)/census_statistics_quick_test $(BINDIR)/$(CONFIG)/census_statistics_small_log_test $(BINDIR)/$(CONFIG)/census_stub_test $(BINDIR)/$(CONFIG)/census_window_stats_test $(BINDIR)/$(CONFIG)/chttp2_status_conversion_test $(BINDIR)/$(CONFIG)/chttp2_stream_encoder_test $(BINDIR)/$(CONFIG)/chttp2_stream_map_test $(BINDIR)/$(CONFIG)/chttp2_transport_end2end_test $(BINDIR)/$(CONFIG)/dualstack_socket_test $(BINDIR)/$(CONFIG)/echo_client $(BINDIR)/$(CONFIG)/echo_server $(BINDIR)/$(CONFIG)/echo_test $(BINDIR)/$(CONFIG)/fd_posix_test $(BINDIR)/$(CONFIG)/fling_client $(BINDIR)/$(CONFIG)/fling_server $(BINDIR)/$(CONFIG)/fling_stream_test $(BINDIR)/$(CONFIG)/fling_test $(BINDIR)/$(CONFIG)/gpr_cancellable_test $(BINDIR)/$(CONFIG)/gpr_cmdline_test $(BINDIR)/$(CONFIG)/gpr_env_test $(BINDIR)/$(CONFIG)/gpr_file_test $(BINDIR)/$(CONFIG)/gpr_histogram_test $(BINDIR)/$(CONFIG)/gpr_host_port_test $(BINDIR)/$(CONFIG)/gpr_log_test $(BINDIR)/$(CONFIG)/gpr_slice_buffer_test $(BINDIR)/$(CONFIG)/gpr_slice_test $(BINDIR)/$(CONFIG)/gpr_string_test $(BINDIR)/$(CONFIG)/gpr_sync_test $(BINDIR)/$(CONFIG)/gpr_thd_test $(BINDIR)/$(CONFIG)/gpr_time_test $(BINDIR)/$(CONFIG)/gpr_useful_test $(BINDIR)/$(CONFIG)/grpc_base64_test $(BINDIR)/$(CONFIG)/grpc_byte_buffer_reader_test $(BINDIR)/$(CONFIG)/grpc_channel_stack_test $(BINDIR)/$(CONFIG)/grpc_completion_queue_test $(BINDIR)/$(CONFIG)/grpc_credentials_test $(BINDIR)/$(CONFIG)/grpc_json_token_test $(BINDIR)/$(CONFIG)/grpc_stream_op_test $(BINDIR)/$(CONFIG)/hpack_parser_test $(BINDIR)/$(CONFIG)/hpack_table_test $(BINDIR)/$(CONFIG)/httpcli_format_request_test $(BINDIR)/$(CONFIG)/httpcli_parser_test $(BINDIR)/$(CONFIG)/httpcli_test $(BINDIR)/$(CONFIG)/json_rewrite $(BINDIR)/$(CONFIG)/json_rewrite_test $(BINDIR)/$(CONFIG)/json_test $(BINDIR)/$(CONFIG)/lame_client_test $(BINDIR)/$(CONFIG)/message_compress_test $(BINDIR)/$(CONFIG)/metadata_buffer_test $(BINDIR)/$(CONFIG)/multi_init_test $(BINDIR)/$(CONFIG)/murmur_hash_test $(BINDIR)/$(CONFIG)/no_server_test $(BINDIR)/$(CONFIG)/poll_kick_posix_test $(BINDIR)/$(CONFIG)/resolve_address_test $(BINDIR)/$(CONFIG)/secure_endpoint_test $(BINDIR)/$(CONFIG)/sockaddr_utils_test $(BINDIR)/$(CONFIG)/tcp_client_posix_test $(BINDIR)/$(CONFIG)/tcp_posix_test $(BINDIR)/$(CONFIG)/tcp_server_posix_test $(BINDIR)/$(CONFIG)/time_averaged_stats_test $(BINDIR)/$(CONFIG)/time_test $(BINDIR)/$(CONFIG)/timeout_encoding_test $(BINDIR)/$(CONFIG)/transport_metadata_test $(BINDIR)/$(CONFIG)/transport_security_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pending_read_legacy_test -buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/anonymous_end2end_test $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR)/$(CONFIG)/channel_arguments_test $(BINDIR)/$(CONFIG)/credentials_test $(BINDIR)/$(CONFIG)/end2end_test $(BINDIR)/$(CONFIG)/interop_client $(BINDIR)/$(CONFIG)/interop_server $(BINDIR)/$(CONFIG)/interop_test $(BINDIR)/$(CONFIG)/pubsub_client $(BINDIR)/$(CONFIG)/pubsub_publisher_test $(BINDIR)/$(CONFIG)/pubsub_subscriber_test $(BINDIR)/$(CONFIG)/qps_driver $(BINDIR)/$(CONFIG)/qps_worker $(BINDIR)/$(CONFIG)/status_test $(BINDIR)/$(CONFIG)/thread_pool_test +buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR)/$(CONFIG)/channel_arguments_test $(BINDIR)/$(CONFIG)/credentials_test $(BINDIR)/$(CONFIG)/end2end_test $(BINDIR)/$(CONFIG)/generic_end2end_test $(BINDIR)/$(CONFIG)/interop_client $(BINDIR)/$(CONFIG)/interop_server $(BINDIR)/$(CONFIG)/interop_test $(BINDIR)/$(CONFIG)/pubsub_client $(BINDIR)/$(CONFIG)/pubsub_publisher_test $(BINDIR)/$(CONFIG)/pubsub_subscriber_test $(BINDIR)/$(CONFIG)/qps_driver $(BINDIR)/$(CONFIG)/qps_worker $(BINDIR)/$(CONFIG)/status_test $(BINDIR)/$(CONFIG)/thread_pool_test test: test_c test_cxx @@ -1794,8 +1794,6 @@ test_c: buildtests_c test_cxx: buildtests_cxx - $(E) "[RUN] Testing anonymous_end2end_test" - $(Q) $(BINDIR)/$(CONFIG)/anonymous_end2end_test || ( echo test anonymous_end2end_test failed ; exit 1 ) $(E) "[RUN] Testing async_end2end_test" $(Q) $(BINDIR)/$(CONFIG)/async_end2end_test || ( echo test async_end2end_test failed ; exit 1 ) $(E) "[RUN] Testing channel_arguments_test" @@ -1804,6 +1802,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/credentials_test || ( echo test credentials_test failed ; exit 1 ) $(E) "[RUN] Testing end2end_test" $(Q) $(BINDIR)/$(CONFIG)/end2end_test || ( echo test end2end_test failed ; exit 1 ) + $(E) "[RUN] Testing generic_end2end_test" + $(Q) $(BINDIR)/$(CONFIG)/generic_end2end_test || ( echo test generic_end2end_test failed ; exit 1 ) $(E) "[RUN] Testing interop_test" $(Q) $(BINDIR)/$(CONFIG)/interop_test || ( echo test interop_test failed ; exit 1 ) $(E) "[RUN] Testing pubsub_publisher_test" @@ -3108,7 +3108,7 @@ LIBGRPC++_SRC = \ src/cpp/common/completion_queue.cc \ src/cpp/common/rpc_method.cc \ src/cpp/proto/proto_utils.cc \ - src/cpp/server/anonymous_service.cc \ + src/cpp/server/generic_service.cc \ src/cpp/server/insecure_server_credentials.cc \ src/cpp/server/server.cc \ src/cpp/server/server_builder.cc \ @@ -3121,7 +3121,6 @@ LIBGRPC++_SRC = \ src/cpp/util/time.cc \ PUBLIC_HEADERS_CXX += \ - include/grpc++/anonymous_service.h \ include/grpc++/async_unary_call.h \ include/grpc++/byte_buffer.h \ include/grpc++/channel_arguments.h \ @@ -3131,6 +3130,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/config.h \ include/grpc++/create_channel.h \ include/grpc++/credentials.h \ + include/grpc++/generic_service.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/internal_stub.h \ @@ -3195,7 +3195,7 @@ src/cpp/common/call.cc: $(OPENSSL_DEP) src/cpp/common/completion_queue.cc: $(OPENSSL_DEP) src/cpp/common/rpc_method.cc: $(OPENSSL_DEP) src/cpp/proto/proto_utils.cc: $(OPENSSL_DEP) -src/cpp/server/anonymous_service.cc: $(OPENSSL_DEP) +src/cpp/server/generic_service.cc: $(OPENSSL_DEP) src/cpp/server/insecure_server_credentials.cc: $(OPENSSL_DEP) src/cpp/server/server.cc: $(OPENSSL_DEP) src/cpp/server/server_builder.cc: $(OPENSSL_DEP) @@ -3261,7 +3261,7 @@ $(OBJDIR)/$(CONFIG)/src/cpp/common/call.o: $(OBJDIR)/$(CONFIG)/src/cpp/common/completion_queue.o: $(OBJDIR)/$(CONFIG)/src/cpp/common/rpc_method.o: $(OBJDIR)/$(CONFIG)/src/cpp/proto/proto_utils.o: -$(OBJDIR)/$(CONFIG)/src/cpp/server/anonymous_service.o: +$(OBJDIR)/$(CONFIG)/src/cpp/server/generic_service.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/insecure_server_credentials.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server_builder.o: @@ -3352,7 +3352,7 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/common/completion_queue.cc \ src/cpp/common/rpc_method.cc \ src/cpp/proto/proto_utils.cc \ - src/cpp/server/anonymous_service.cc \ + src/cpp/server/generic_service.cc \ src/cpp/server/insecure_server_credentials.cc \ src/cpp/server/server.cc \ src/cpp/server/server_builder.cc \ @@ -3365,7 +3365,6 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/util/time.cc \ PUBLIC_HEADERS_CXX += \ - include/grpc++/anonymous_service.h \ include/grpc++/async_unary_call.h \ include/grpc++/byte_buffer.h \ include/grpc++/channel_arguments.h \ @@ -3375,6 +3374,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/config.h \ include/grpc++/create_channel.h \ include/grpc++/credentials.h \ + include/grpc++/generic_service.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/internal_stub.h \ @@ -3454,7 +3454,7 @@ $(OBJDIR)/$(CONFIG)/src/cpp/common/call.o: $(OBJDIR)/$(CONFIG)/src/cpp/common/completion_queue.o: $(OBJDIR)/$(CONFIG)/src/cpp/common/rpc_method.o: $(OBJDIR)/$(CONFIG)/src/cpp/proto/proto_utils.o: -$(OBJDIR)/$(CONFIG)/src/cpp/server/anonymous_service.o: +$(OBJDIR)/$(CONFIG)/src/cpp/server/generic_service.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/insecure_server_credentials.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server_builder.o: @@ -7779,48 +7779,6 @@ endif endif -ANONYMOUS_END2END_TEST_SRC = \ - test/cpp/end2end/anonymous_end2end_test.cc \ - -ANONYMOUS_END2END_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ANONYMOUS_END2END_TEST_SRC)))) - -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL with ALPN. - -$(BINDIR)/$(CONFIG)/anonymous_end2end_test: openssl_dep_error - -else - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. - -$(BINDIR)/$(CONFIG)/anonymous_end2end_test: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/anonymous_end2end_test: $(PROTOBUF_DEP) $(ANONYMOUS_END2END_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(ANONYMOUS_END2END_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/anonymous_end2end_test - -endif - -endif - -$(OBJDIR)/$(CONFIG)/test/cpp/end2end/anonymous_end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - -deps_anonymous_end2end_test: $(ANONYMOUS_END2END_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(ANONYMOUS_END2END_TEST_OBJS:.o=.dep) -endif -endif - - ASYNC_END2END_TEST_SRC = \ test/cpp/end2end/async_end2end_test.cc \ @@ -7989,6 +7947,48 @@ endif endif +GENERIC_END2END_TEST_SRC = \ + test/cpp/end2end/generic_end2end_test.cc \ + +GENERIC_END2END_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GENERIC_END2END_TEST_SRC)))) + +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL with ALPN. + +$(BINDIR)/$(CONFIG)/generic_end2end_test: openssl_dep_error + +else + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. + +$(BINDIR)/$(CONFIG)/generic_end2end_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/generic_end2end_test: $(PROTOBUF_DEP) $(GENERIC_END2END_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(GENERIC_END2END_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/generic_end2end_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/test/cpp/end2end/generic_end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_generic_end2end_test: $(GENERIC_END2END_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GENERIC_END2END_TEST_OBJS:.o=.dep) +endif +endif + + GRPC_CPP_PLUGIN_SRC = \ src/compiler/cpp_generator.cc \ src/compiler/cpp_plugin.cc \ diff --git a/build.json b/build.json index 9b217dc909e..4ec74b8bc8b 100644 --- a/build.json +++ b/build.json @@ -12,7 +12,6 @@ { "name": "grpc++_base", "public_headers": [ - "include/grpc++/anonymous_service.h", "include/grpc++/async_unary_call.h", "include/grpc++/byte_buffer.h", "include/grpc++/channel_arguments.h", @@ -22,6 +21,7 @@ "include/grpc++/config.h", "include/grpc++/create_channel.h", "include/grpc++/credentials.h", + "include/grpc++/generic_service.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/internal_stub.h", @@ -57,7 +57,7 @@ "src/cpp/common/completion_queue.cc", "src/cpp/common/rpc_method.cc", "src/cpp/proto/proto_utils.cc", - "src/cpp/server/anonymous_service.cc", + "src/cpp/server/generic_service.cc", "src/cpp/server/insecure_server_credentials.cc", "src/cpp/server/server.cc", "src/cpp/server/server_builder.cc", @@ -1647,11 +1647,11 @@ ] }, { - "name": "anonymous_end2end_test", + "name": "async_end2end_test", "build": "test", "language": "c++", "src": [ - "test/cpp/end2end/anonymous_end2end_test.cc" + "test/cpp/end2end/async_end2end_test.cc" ], "deps": [ "grpc++_test_util", @@ -1663,27 +1663,24 @@ ] }, { - "name": "async_end2end_test", + "name": "channel_arguments_test", "build": "test", "language": "c++", "src": [ - "test/cpp/end2end/async_end2end_test.cc" + "test/cpp/client/channel_arguments_test.cc" ], "deps": [ - "grpc++_test_util", - "grpc_test_util", "grpc++", "grpc", - "gpr_test_util", "gpr" ] }, { - "name": "channel_arguments_test", + "name": "credentials_test", "build": "test", "language": "c++", "src": [ - "test/cpp/client/channel_arguments_test.cc" + "test/cpp/client/credentials_test.cc" ], "deps": [ "grpc++", @@ -1692,24 +1689,27 @@ ] }, { - "name": "credentials_test", + "name": "end2end_test", "build": "test", "language": "c++", "src": [ - "test/cpp/client/credentials_test.cc" + "test/cpp/end2end/end2end_test.cc" ], "deps": [ + "grpc++_test_util", + "grpc_test_util", "grpc++", "grpc", + "gpr_test_util", "gpr" ] }, { - "name": "end2end_test", + "name": "generic_end2end_test", "build": "test", "language": "c++", "src": [ - "test/cpp/end2end/end2end_test.cc" + "test/cpp/end2end/generic_end2end_test.cc" ], "deps": [ "grpc++_test_util", diff --git a/include/grpc++/anonymous_service.h b/include/grpc++/generic_service.h similarity index 89% rename from include/grpc++/anonymous_service.h rename to include/grpc++/generic_service.h index 78903dbc3b3..50a36465de7 100644 --- a/include/grpc++/anonymous_service.h +++ b/include/grpc++/generic_service.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPCXX_ANONYMOUS_SERVICE_H -#define GRPCXX_ANONYMOUS_SERVICE_H +#ifndef GRPCXX_GENERIC_SERVICE_H +#define GRPCXX_GENERIC_SERVICE_H #include #include @@ -43,7 +43,7 @@ namespace grpc { typedef ServerAsyncReaderWriter GenericServerReaderWriter; -class AnonymousServerContext : public ServerContext { +class GenericServerContext : public ServerContext { public: const grpc::string& method() const { return method_; } const grpc::string& host() const { return host_; } @@ -55,13 +55,13 @@ class AnonymousServerContext : public ServerContext { grpc::string host_; }; -class AnonymousService { +class GenericService { public: // TODO(yangg) Once we can add multiple completion queues to the server // in c core, add a CompletionQueue* argument to the ctor here. - AnonymousService() : server_(nullptr) {} + GenericService() : server_(nullptr) {} - void RequestCall(AnonymousServerContext* ctx, + void RequestCall(GenericServerContext* ctx, GenericServerReaderWriter* reader_writer, CompletionQueue* cq, void* tag); @@ -72,4 +72,4 @@ class AnonymousService { } // namespace grpc -#endif // GRPCXX_ANONYMOUS_SERVICE_H +#endif // GRPCXX_GENERIC_SERVICE_H diff --git a/include/grpc++/anonymous_stub.h b/include/grpc++/generic_stub.h similarity index 87% rename from include/grpc++/anonymous_stub.h rename to include/grpc++/generic_stub.h index ccb474e21bb..87396f0337d 100644 --- a/include/grpc++/anonymous_stub.h +++ b/include/grpc++/generic_stub.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPCXX_ANONYMOUS_STUB_H -#define GRPCXX_ANONYMOUS_STUB_H +#ifndef GRPCXX_GENERIC_STUB_H +#define GRPCXX_GENERIC_STUB_H #include #include @@ -41,11 +41,11 @@ namespace grpc { typedef ClientAsyncReaderWriter GenericClientReaderWriter; -// Anonymous stubs provide a type-unsafe interface to call gRPC methods +// Generic stubs provide a type-unsafe interface to call gRPC methods // by name. -class AnonymousStub { +class GenericStub { public: - explicit AnonymousStub(std::shared_ptr channel) : channel_(channel) {} + explicit GenericStub(std::shared_ptr channel) : channel_(channel) {} // begin a call to a named method std::unique_ptr Call(ClientContext* context, const grpc::string& method); @@ -56,4 +56,4 @@ class AnonymousStub { } // namespace grpc -#endif // GRPCXX_ANONYMOUS_STUB_H +#endif // GRPCXX_GENERIC_STUB_H diff --git a/include/grpc++/server.h b/include/grpc++/server.h index b8083511816..a3306277477 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -48,9 +48,9 @@ struct grpc_server; namespace grpc { -class AnonymousServerContext; -class AnonymousService; class AsynchronousService; +class GenericServerContext; +class GenericService; class RpcService; class RpcServiceMethod; class ServerCredentials; @@ -73,7 +73,7 @@ class Server GRPC_FINAL : private CallHook, CompletionQueue* cq() { return &cq_; } private: - friend class AnonymousService; + friend class GenericService; friend class ServerBuilder; class SyncRequest; @@ -86,7 +86,7 @@ class Server GRPC_FINAL : private CallHook, // The service must exist for the lifetime of the Server instance. bool RegisterService(RpcService* service); bool RegisterAsyncService(AsynchronousService* service); - void RegisterAnonymousService(AnonymousService* service); + void RegisterGenericService(GenericService* service); // Add a listening port. Can be called multiple times. int AddPort(const grpc::string& addr, ServerCredentials* creds); // Start the server. @@ -104,9 +104,9 @@ class Server GRPC_FINAL : private CallHook, ServerAsyncStreamingInterface* stream, CompletionQueue* cq, void* tag) GRPC_OVERRIDE; - void RequestAsyncAnonymousCall(AnonymousServerContext* context, - ServerAsyncStreamingInterface* stream, - CompletionQueue* cq, void* tag); + void RequestGenericCall(GenericServerContext* context, + ServerAsyncStreamingInterface* stream, + CompletionQueue* cq, void* tag); // Completion queue. CompletionQueue cq_; diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index cb961bf2bad..dbd9871d380 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -41,9 +41,9 @@ namespace grpc { -class AnonymousService; class AsynchronousService; class CompletionQueue; +class GenericService; class RpcService; class Server; class ServerCredentials; @@ -65,8 +65,8 @@ class ServerBuilder { // instance returned by BuildAndStart(). void RegisterAsyncService(AsynchronousService* service); - // Register an anonymous service. - void RegisterAnonymousService(AnonymousService* service); + // Register a generic service. + void RegisterGenericService(GenericService* service); // Add a listening port. Can be called multiple times. void AddPort(const grpc::string& addr, @@ -91,7 +91,7 @@ class ServerBuilder { std::vector async_services_; std::vector ports_; std::shared_ptr creds_; - AnonymousService* anonymous_service_; + GenericService* generic_service_; ThreadPoolInterface* thread_pool_; }; diff --git a/src/cpp/server/anonymous_service.cc b/src/cpp/server/generic_service.cc similarity index 84% rename from src/cpp/server/anonymous_service.cc rename to src/cpp/server/generic_service.cc index ef20cade341..8ced775a67d 100644 --- a/src/cpp/server/anonymous_service.cc +++ b/src/cpp/server/generic_service.cc @@ -31,16 +31,16 @@ * */ -#include +#include #include namespace grpc { -void AnonymousService::RequestCall(AnonymousServerContext* ctx, - GenericServerReaderWriter* reader_writer, - CompletionQueue* cq, void* tag) { - server_->RequestAsyncAnonymousCall(ctx, reader_writer, cq, tag); +void GenericService::RequestCall(GenericServerContext* ctx, + GenericServerReaderWriter* reader_writer, + CompletionQueue* cq, void* tag) { + server_->RequestGenericCall(ctx, reader_writer, cq, tag); } } // namespace grpc diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 4328b2c0750..44c8a768d2c 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -37,8 +37,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -227,9 +227,9 @@ bool Server::RegisterAsyncService(AsynchronousService* service) { return true; } -void Server::RegisterAnonymousService(AnonymousService* service) { +void Server::RegisterGenericService(GenericService* service) { GPR_ASSERT(service->server_ == nullptr && - "Can only register an anonymous service against one server."); + "Can only register an generic service against one server."); service->server_ = this; } @@ -296,7 +296,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { stream_(stream), cq_(cq), ctx_(ctx), - anonymous_ctx_(nullptr), + generic_ctx_(nullptr), server_(server), call_(nullptr), payload_(nullptr) { @@ -307,7 +307,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { &array_, request ? &payload_ : nullptr, cq->cq(), this); } - AsyncRequest(Server* server, AnonymousServerContext* ctx, + AsyncRequest(Server* server, GenericServerContext* ctx, ServerAsyncStreamingInterface* stream, CompletionQueue* cq, void* tag) : tag_(tag), @@ -315,7 +315,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { stream_(stream), cq_(cq), ctx_(nullptr), - anonymous_ctx_(ctx), + generic_ctx_(ctx), server_(server), call_(nullptr), payload_(nullptr) { @@ -343,7 +343,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { *status = false; } } - ServerContext* ctx = ctx_ ? ctx_ : anonymous_ctx_; + ServerContext* ctx = ctx_ ? ctx_ : generic_ctx_; GPR_ASSERT(ctx); if (*status) { ctx->deadline_ = Timespec2Timepoint(call_details_.deadline); @@ -354,9 +354,9 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { array_.metadata[i].value, array_.metadata[i].value + array_.metadata[i].value_length))); } - if (anonymous_ctx_) { - anonymous_ctx_->method_ = call_details_.method; - anonymous_ctx_->host_ = call_details_.host; + if (generic_ctx_) { + generic_ctx_->method_ = call_details_.method; + generic_ctx_->host_ = call_details_.host; } } ctx->call_ = call_; @@ -376,7 +376,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { ServerAsyncStreamingInterface* const stream_; CompletionQueue* const cq_; ServerContext* const ctx_; - AnonymousServerContext* const anonymous_ctx_; + GenericServerContext* const generic_ctx_; Server* const server_; grpc_call* call_; grpc_call_details call_details_; @@ -391,9 +391,9 @@ void Server::RequestAsyncCall(void* registered_method, ServerContext* context, new AsyncRequest(this, registered_method, context, request, stream, cq, tag); } -void Server::RequestAsyncAnonymousCall(AnonymousServerContext* context, - ServerAsyncStreamingInterface* stream, - CompletionQueue* cq, void* tag) { +void Server::RequestGenericCall(GenericServerContext* context, + ServerAsyncStreamingInterface* stream, + CompletionQueue* cq, void* tag) { new AsyncRequest(this, context, stream, cq, tag); } diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index e3b9cdfd7f0..083509e797c 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -42,7 +42,7 @@ namespace grpc { ServerBuilder::ServerBuilder() - : anonymous_service_(nullptr), thread_pool_(nullptr) {} + : generic_service_(nullptr), thread_pool_(nullptr) {} void ServerBuilder::RegisterService(SynchronousService* service) { services_.push_back(service->service()); @@ -52,14 +52,14 @@ void ServerBuilder::RegisterAsyncService(AsynchronousService* service) { async_services_.push_back(service); } -void ServerBuilder::RegisterAnonymousService(AnonymousService* service) { - if (anonymous_service_) { +void ServerBuilder::RegisterGenericService(GenericService* service) { + if (generic_service_) { gpr_log(GPR_ERROR, - "Adding multiple AnonymousService is unsupported for now. " + "Adding multiple GenericService is unsupported for now. " "Dropping the service %p", service); return; } - anonymous_service_ = service; + generic_service_ = service; } void ServerBuilder::AddPort(const grpc::string& addr, @@ -95,8 +95,8 @@ std::unique_ptr ServerBuilder::BuildAndStart() { return nullptr; } } - if (anonymous_service_) { - server->RegisterAnonymousService(anonymous_service_); + if (generic_service_) { + server->RegisterGenericService(generic_service_); } for (auto& port : ports_) { int r = server->AddPort(port.addr, port.creds.get()); diff --git a/test/cpp/end2end/anonymous_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc similarity index 95% rename from test/cpp/end2end/anonymous_end2end_test.cc rename to test/cpp/end2end/generic_end2end_test.cc index 362c0cd4a47..0dd64007fd2 100644 --- a/test/cpp/end2end/anonymous_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -37,7 +37,7 @@ #include "test/core/util/test_config.h" #include "test/cpp/util/echo.pb.h" #include "src/cpp/util/time.h" -#include +#include #include #include #include @@ -77,9 +77,9 @@ void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { EXPECT_EQ(tag(i), got_tag); } -class AnonymousEnd2endTest : public ::testing::Test { +class GenericEnd2endTest : public ::testing::Test { protected: - AnonymousEnd2endTest() {} + GenericEnd2endTest() {} void SetUp() GRPC_OVERRIDE { int port = grpc_pick_unused_port_or_die(); @@ -87,7 +87,7 @@ class AnonymousEnd2endTest : public ::testing::Test { // Setup server ServerBuilder builder; builder.AddPort(server_address_.str(), InsecureServerCredentials()); - builder.RegisterAnonymousService(&anonymous_service_); + builder.RegisterGenericService(&generic_service_); server_ = builder.BuildAndStart(); } @@ -123,7 +123,7 @@ class AnonymousEnd2endTest : public ::testing::Test { Status recv_status; ClientContext cli_ctx; - AnonymousServerContext srv_ctx; + GenericServerContext srv_ctx; GenericServerReaderWriter stream(&srv_ctx); send_request.set_message("Hello"); @@ -131,7 +131,7 @@ class AnonymousEnd2endTest : public ::testing::Test { stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); client_ok(1); - anonymous_service_.RequestCall(&srv_ctx, &stream, &srv_cq_, tag(2)); + generic_service_.RequestCall(&srv_ctx, &stream, &srv_cq_, tag(2)); verify_ok(server_->cq(), 2, true); EXPECT_EQ(server_address_.str(), srv_ctx.host()); @@ -171,22 +171,22 @@ class AnonymousEnd2endTest : public ::testing::Test { CompletionQueue srv_cq_; std::unique_ptr stub_; std::unique_ptr server_; - AnonymousService anonymous_service_; + GenericService generic_service_; std::ostringstream server_address_; }; -TEST_F(AnonymousEnd2endTest, SimpleRpc) { +TEST_F(GenericEnd2endTest, SimpleRpc) { ResetStub(); SendRpc(1); } -TEST_F(AnonymousEnd2endTest, SequentialRpcs) { +TEST_F(GenericEnd2endTest, SequentialRpcs) { ResetStub(); SendRpc(10); } // // Two pings and a final pong. -// TEST_F(AnonymousEnd2endTest, SimpleClientStreaming) { +// TEST_F(GenericEnd2endTest, SimpleClientStreaming) { // ResetStub(); // // EchoRequest send_request; @@ -239,7 +239,7 @@ TEST_F(AnonymousEnd2endTest, SequentialRpcs) { // } // // // One ping, two pongs. -// TEST_F(AnonymousEnd2endTest, SimpleServerStreaming) { +// TEST_F(GenericEnd2endTest, SimpleServerStreaming) { // ResetStub(); // // EchoRequest send_request; @@ -290,7 +290,7 @@ TEST_F(AnonymousEnd2endTest, SequentialRpcs) { // } // // // One ping, one pong. -// TEST_F(AnonymousEnd2endTest, SimpleBidiStreaming) { +// TEST_F(GenericEnd2endTest, SimpleBidiStreaming) { // ResetStub(); // // EchoRequest send_request; @@ -342,7 +342,7 @@ TEST_F(AnonymousEnd2endTest, SequentialRpcs) { // } // // // Metadata tests -// TEST_F(AnonymousEnd2endTest, ClientInitialMetadataRpc) { +// TEST_F(GenericEnd2endTest, ClientInitialMetadataRpc) { // ResetStub(); // // EchoRequest send_request; @@ -386,7 +386,7 @@ TEST_F(AnonymousEnd2endTest, SequentialRpcs) { // EXPECT_TRUE(recv_status.IsOk()); // } // -// TEST_F(AnonymousEnd2endTest, ServerInitialMetadataRpc) { +// TEST_F(GenericEnd2endTest, ServerInitialMetadataRpc) { // ResetStub(); // // EchoRequest send_request; @@ -434,7 +434,7 @@ TEST_F(AnonymousEnd2endTest, SequentialRpcs) { // EXPECT_TRUE(recv_status.IsOk()); // } // -// TEST_F(AnonymousEnd2endTest, ServerTrailingMetadataRpc) { +// TEST_F(GenericEnd2endTest, ServerTrailingMetadataRpc) { // ResetStub(); // // EchoRequest send_request; @@ -479,7 +479,7 @@ TEST_F(AnonymousEnd2endTest, SequentialRpcs) { // EXPECT_EQ(static_cast(2), server_trailing_metadata.size()); // } // -// TEST_F(AnonymousEnd2endTest, MetadataRpc) { +// TEST_F(GenericEnd2endTest, MetadataRpc) { // ResetStub(); // // EchoRequest send_request; diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 7d2d64f14aa..355d5735cdc 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -336,11 +336,6 @@ "language": "c", "name": "transport_security_test" }, - { - "flaky": false, - "language": "c++", - "name": "anonymous_end2end_test" - }, { "flaky": false, "language": "c++", @@ -361,6 +356,11 @@ "language": "c++", "name": "end2end_test" }, + { + "flaky": false, + "language": "c++", + "name": "generic_end2end_test" + }, { "flaky": false, "language": "c++", From 2a3c96a8693f054353732bd1def5aaa780ea256e Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 11 Mar 2015 23:32:40 -0700 Subject: [PATCH 16/75] resolve leak, now asan clean --- src/cpp/server/server.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 44c8a768d2c..f72b8a30a64 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -355,8 +356,11 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { array_.metadata[i].value + array_.metadata[i].value_length))); } if (generic_ctx_) { + // TODO(yangg) remove the copy here. generic_ctx_->method_ = call_details_.method; generic_ctx_->host_ = call_details_.host; + gpr_free(call_details_.method); + gpr_free(call_details_.host); } } ctx->call_ = call_; From 3e0a46a1c4297b2d8fd0f05162bf551f3bae78b5 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 12 Mar 2015 05:16:31 -0700 Subject: [PATCH 17/75] Change behavior to properly account for possibility of NULL tag. This can happen if the tag is actually an integer being typecast to void* To avoid breaking the API of existing Next calls, I've made a new AsyncNext method with a tri-state return that indicates whether there is a shutdown, an actual event, or a timeout. Still needs proper testing for the AsyncNext method specifically. --- include/grpc++/completion_queue.h | 15 ++++++++++++--- src/cpp/common/completion_queue.cc | 11 +++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index db6e6d41f31..ffa53698bbc 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -76,10 +76,19 @@ class CompletionQueue { explicit CompletionQueue(grpc_completion_queue *take); ~CompletionQueue(); + // Tri-state return for Next: SHUTDOWN, GOT_EVENT, TIMEOUT + enum NextStatus {SHUTDOWN, GOT_EVENT, TIMEOUT}; + // Blocking (until deadline) read from queue. - // Returns false if the queue is ready for destruction, true otherwise - // If the deadline passed, *tag will be null - bool Next(void **tag, bool *ok, gpr_timespec deadline=gpr_inf_future); + // Returns false if the queue is ready for destruction, true if event + + bool Next(void **tag, bool *ok) { + return (AsyncNext(tag,ok,gpr_inf_future) != SHUTDOWN); + } + + // Nonblocking (until deadline) read from queue. + // Cannot rely on result of tag or ok if return is TIMEOUT + NextStatus AsyncNext(void **tag, bool *ok, gpr_timespec deadline); // Shutdown has to be called, and the CompletionQueue can only be // destructed when false is returned from Next(). diff --git a/src/cpp/common/completion_queue.cc b/src/cpp/common/completion_queue.cc index c37e97909b8..2913298afed 100644 --- a/src/cpp/common/completion_queue.cc +++ b/src/cpp/common/completion_queue.cc @@ -57,24 +57,23 @@ class EventDeleter { } }; -bool CompletionQueue::Next(void** tag, bool* ok, gpr_timespec deadline) { +CompletionQueue::NextStatus CompletionQueue::AsyncNext(void** tag, bool* ok, + gpr_timespec deadline) { std::unique_ptr ev; for (;;) { ev.reset(grpc_completion_queue_next(cq_, deadline)); if (!ev) { /* got a NULL back because deadline passed */ - *ok = true; - *tag = nullptr; - return true; + return TIMEOUT; } if (ev->type == GRPC_QUEUE_SHUTDOWN) { - return false; + return SHUTDOWN; } auto cq_tag = static_cast(ev->tag); *ok = ev->data.op_complete == GRPC_OP_OK; *tag = cq_tag; if (cq_tag->FinalizeResult(tag, ok)) { - return true; + return GOT_EVENT; } } } From c41bf3cb5a497ee2a6ab9a9b959587a4e56328ed Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 12 Mar 2015 05:19:34 -0700 Subject: [PATCH 18/75] More sane ordering of methods --- include/grpc++/completion_queue.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index ffa53698bbc..4181911b58a 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -76,20 +76,19 @@ class CompletionQueue { explicit CompletionQueue(grpc_completion_queue *take); ~CompletionQueue(); - // Tri-state return for Next: SHUTDOWN, GOT_EVENT, TIMEOUT + // Tri-state return for AsyncNext: SHUTDOWN, GOT_EVENT, TIMEOUT enum NextStatus {SHUTDOWN, GOT_EVENT, TIMEOUT}; + // Nonblocking (until deadline) read from queue. + // Cannot rely on result of tag or ok if return is TIMEOUT + NextStatus AsyncNext(void **tag, bool *ok, gpr_timespec deadline); + // Blocking (until deadline) read from queue. // Returns false if the queue is ready for destruction, true if event - bool Next(void **tag, bool *ok) { return (AsyncNext(tag,ok,gpr_inf_future) != SHUTDOWN); } - // Nonblocking (until deadline) read from queue. - // Cannot rely on result of tag or ok if return is TIMEOUT - NextStatus AsyncNext(void **tag, bool *ok, gpr_timespec deadline); - // Shutdown has to be called, and the CompletionQueue can only be // destructed when false is returned from Next(). void Shutdown(); From 179f8684dc87bfccf9b74968afe96fc371eb170e Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Thu, 12 Mar 2015 14:36:58 -0700 Subject: [PATCH 19/75] add missing GRPC_FINAL --- include/grpc++/generic_service.h | 4 ++-- include/grpc++/generic_stub.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/grpc++/generic_service.h b/include/grpc++/generic_service.h index 50a36465de7..724982e944c 100644 --- a/include/grpc++/generic_service.h +++ b/include/grpc++/generic_service.h @@ -43,7 +43,7 @@ namespace grpc { typedef ServerAsyncReaderWriter GenericServerReaderWriter; -class GenericServerContext : public ServerContext { +class GenericServerContext GRPC_FINAL : public ServerContext { public: const grpc::string& method() const { return method_; } const grpc::string& host() const { return host_; } @@ -55,7 +55,7 @@ class GenericServerContext : public ServerContext { grpc::string host_; }; -class GenericService { +class GenericService GRPC_FINAL { public: // TODO(yangg) Once we can add multiple completion queues to the server // in c core, add a CompletionQueue* argument to the ctor here. diff --git a/include/grpc++/generic_stub.h b/include/grpc++/generic_stub.h index 87396f0337d..92c4df1eb10 100644 --- a/include/grpc++/generic_stub.h +++ b/include/grpc++/generic_stub.h @@ -43,7 +43,7 @@ typedef ClientAsyncReaderWriter GenericClientReaderWrite // Generic stubs provide a type-unsafe interface to call gRPC methods // by name. -class GenericStub { +class GenericStub GRPC_FINAL { public: explicit GenericStub(std::shared_ptr channel) : channel_(channel) {} From 4999649653b9262d661eb833724ee28cefedb2bd Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Thu, 12 Mar 2015 16:40:19 -0700 Subject: [PATCH 20/75] Rename to AsyncGeneric* --- Makefile | 14 +++++++------- build.json | 4 ++-- .../{generic_service.h => async_generic_service.h} | 14 +++++++------- include/grpc++/generic_stub.h | 9 ++++++--- include/grpc++/server.h | 12 ++++++------ include/grpc++/server_builder.h | 6 +++--- ...generic_service.cc => async_generic_service.cc} | 10 +++++----- src/cpp/server/server.cc | 10 +++++----- src/cpp/server/server_builder.cc | 6 +++--- test/cpp/end2end/generic_end2end_test.cc | 8 ++++---- 10 files changed, 48 insertions(+), 45 deletions(-) rename include/grpc++/{generic_service.h => async_generic_service.h} (88%) rename src/cpp/server/{generic_service.cc => async_generic_service.cc} (84%) diff --git a/Makefile b/Makefile index 853a8a3f4dc..e6b29750570 100644 --- a/Makefile +++ b/Makefile @@ -3108,7 +3108,7 @@ LIBGRPC++_SRC = \ src/cpp/common/completion_queue.cc \ src/cpp/common/rpc_method.cc \ src/cpp/proto/proto_utils.cc \ - src/cpp/server/generic_service.cc \ + src/cpp/server/async_generic_service.cc \ src/cpp/server/insecure_server_credentials.cc \ src/cpp/server/server.cc \ src/cpp/server/server_builder.cc \ @@ -3121,6 +3121,7 @@ LIBGRPC++_SRC = \ src/cpp/util/time.cc \ PUBLIC_HEADERS_CXX += \ + include/grpc++/async_generic_service.h \ include/grpc++/async_unary_call.h \ include/grpc++/byte_buffer.h \ include/grpc++/channel_arguments.h \ @@ -3130,7 +3131,6 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/config.h \ include/grpc++/create_channel.h \ include/grpc++/credentials.h \ - include/grpc++/generic_service.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/internal_stub.h \ @@ -3195,7 +3195,7 @@ src/cpp/common/call.cc: $(OPENSSL_DEP) src/cpp/common/completion_queue.cc: $(OPENSSL_DEP) src/cpp/common/rpc_method.cc: $(OPENSSL_DEP) src/cpp/proto/proto_utils.cc: $(OPENSSL_DEP) -src/cpp/server/generic_service.cc: $(OPENSSL_DEP) +src/cpp/server/async_generic_service.cc: $(OPENSSL_DEP) src/cpp/server/insecure_server_credentials.cc: $(OPENSSL_DEP) src/cpp/server/server.cc: $(OPENSSL_DEP) src/cpp/server/server_builder.cc: $(OPENSSL_DEP) @@ -3261,7 +3261,7 @@ $(OBJDIR)/$(CONFIG)/src/cpp/common/call.o: $(OBJDIR)/$(CONFIG)/src/cpp/common/completion_queue.o: $(OBJDIR)/$(CONFIG)/src/cpp/common/rpc_method.o: $(OBJDIR)/$(CONFIG)/src/cpp/proto/proto_utils.o: -$(OBJDIR)/$(CONFIG)/src/cpp/server/generic_service.o: +$(OBJDIR)/$(CONFIG)/src/cpp/server/async_generic_service.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/insecure_server_credentials.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server_builder.o: @@ -3352,7 +3352,7 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/common/completion_queue.cc \ src/cpp/common/rpc_method.cc \ src/cpp/proto/proto_utils.cc \ - src/cpp/server/generic_service.cc \ + src/cpp/server/async_generic_service.cc \ src/cpp/server/insecure_server_credentials.cc \ src/cpp/server/server.cc \ src/cpp/server/server_builder.cc \ @@ -3365,6 +3365,7 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/util/time.cc \ PUBLIC_HEADERS_CXX += \ + include/grpc++/async_generic_service.h \ include/grpc++/async_unary_call.h \ include/grpc++/byte_buffer.h \ include/grpc++/channel_arguments.h \ @@ -3374,7 +3375,6 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/config.h \ include/grpc++/create_channel.h \ include/grpc++/credentials.h \ - include/grpc++/generic_service.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/internal_stub.h \ @@ -3454,7 +3454,7 @@ $(OBJDIR)/$(CONFIG)/src/cpp/common/call.o: $(OBJDIR)/$(CONFIG)/src/cpp/common/completion_queue.o: $(OBJDIR)/$(CONFIG)/src/cpp/common/rpc_method.o: $(OBJDIR)/$(CONFIG)/src/cpp/proto/proto_utils.o: -$(OBJDIR)/$(CONFIG)/src/cpp/server/generic_service.o: +$(OBJDIR)/$(CONFIG)/src/cpp/server/async_generic_service.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/insecure_server_credentials.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server.o: $(OBJDIR)/$(CONFIG)/src/cpp/server/server_builder.o: diff --git a/build.json b/build.json index 4ec74b8bc8b..999e140c5a1 100644 --- a/build.json +++ b/build.json @@ -12,6 +12,7 @@ { "name": "grpc++_base", "public_headers": [ + "include/grpc++/async_generic_service.h", "include/grpc++/async_unary_call.h", "include/grpc++/byte_buffer.h", "include/grpc++/channel_arguments.h", @@ -21,7 +22,6 @@ "include/grpc++/config.h", "include/grpc++/create_channel.h", "include/grpc++/credentials.h", - "include/grpc++/generic_service.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/internal_stub.h", @@ -57,7 +57,7 @@ "src/cpp/common/completion_queue.cc", "src/cpp/common/rpc_method.cc", "src/cpp/proto/proto_utils.cc", - "src/cpp/server/generic_service.cc", + "src/cpp/server/async_generic_service.cc", "src/cpp/server/insecure_server_credentials.cc", "src/cpp/server/server.cc", "src/cpp/server/server_builder.cc", diff --git a/include/grpc++/generic_service.h b/include/grpc++/async_generic_service.h similarity index 88% rename from include/grpc++/generic_service.h rename to include/grpc++/async_generic_service.h index 724982e944c..05fa76149e8 100644 --- a/include/grpc++/generic_service.h +++ b/include/grpc++/async_generic_service.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPCXX_GENERIC_SERVICE_H -#define GRPCXX_GENERIC_SERVICE_H +#ifndef GRPCXX_ASYNC_GENERIC_SERVICE_H +#define GRPCXX_ASYNC_GENERIC_SERVICE_H #include #include @@ -41,7 +41,7 @@ struct grpc_server; namespace grpc { -typedef ServerAsyncReaderWriter GenericServerReaderWriter; +typedef ServerAsyncReaderWriter GenericServerAsyncReaderWriter; class GenericServerContext GRPC_FINAL : public ServerContext { public: @@ -55,14 +55,14 @@ class GenericServerContext GRPC_FINAL : public ServerContext { grpc::string host_; }; -class GenericService GRPC_FINAL { +class AsyncGenericService GRPC_FINAL { public: // TODO(yangg) Once we can add multiple completion queues to the server // in c core, add a CompletionQueue* argument to the ctor here. - GenericService() : server_(nullptr) {} + AsyncGenericService() : server_(nullptr) {} void RequestCall(GenericServerContext* ctx, - GenericServerReaderWriter* reader_writer, + GenericServerAsyncReaderWriter* reader_writer, CompletionQueue* cq, void* tag); private: @@ -72,4 +72,4 @@ class GenericService GRPC_FINAL { } // namespace grpc -#endif // GRPCXX_GENERIC_SERVICE_H +#endif // GRPCXX_ASYNC_GENERIC_SERVICE_H diff --git a/include/grpc++/generic_stub.h b/include/grpc++/generic_stub.h index 92c4df1eb10..6038d7c66cc 100644 --- a/include/grpc++/generic_stub.h +++ b/include/grpc++/generic_stub.h @@ -39,16 +39,19 @@ namespace grpc { -typedef ClientAsyncReaderWriter GenericClientReaderWriter; +typedef ClientAsyncReaderWriter + GenericClientAsyncReaderWriter; // Generic stubs provide a type-unsafe interface to call gRPC methods // by name. class GenericStub GRPC_FINAL { public: - explicit GenericStub(std::shared_ptr channel) : channel_(channel) {} + explicit GenericStub(std::shared_ptr channel) + : channel_(channel) {} // begin a call to a named method - std::unique_ptr Call(ClientContext* context, const grpc::string& method); + std::unique_ptr Call( + ClientContext* context, const grpc::string& method); private: std::shared_ptr channel_; diff --git a/include/grpc++/server.h b/include/grpc++/server.h index a3306277477..e05bde73495 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -50,7 +50,7 @@ struct grpc_server; namespace grpc { class AsynchronousService; class GenericServerContext; -class GenericService; +class AsyncGenericService; class RpcService; class RpcServiceMethod; class ServerCredentials; @@ -73,7 +73,7 @@ class Server GRPC_FINAL : private CallHook, CompletionQueue* cq() { return &cq_; } private: - friend class GenericService; + friend class AsyncGenericService; friend class ServerBuilder; class SyncRequest; @@ -86,7 +86,7 @@ class Server GRPC_FINAL : private CallHook, // The service must exist for the lifetime of the Server instance. bool RegisterService(RpcService* service); bool RegisterAsyncService(AsynchronousService* service); - void RegisterGenericService(GenericService* service); + void RegisterAsyncGenericService(AsyncGenericService* service); // Add a listening port. Can be called multiple times. int AddPort(const grpc::string& addr, ServerCredentials* creds); // Start the server. @@ -104,9 +104,9 @@ class Server GRPC_FINAL : private CallHook, ServerAsyncStreamingInterface* stream, CompletionQueue* cq, void* tag) GRPC_OVERRIDE; - void RequestGenericCall(GenericServerContext* context, - ServerAsyncStreamingInterface* stream, - CompletionQueue* cq, void* tag); + void RequestAsyncGenericCall(GenericServerContext* context, + ServerAsyncStreamingInterface* stream, + CompletionQueue* cq, void* tag); // Completion queue. CompletionQueue cq_; diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index dbd9871d380..c09c8fee52c 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -41,9 +41,9 @@ namespace grpc { +class AsyncGenericService; class AsynchronousService; class CompletionQueue; -class GenericService; class RpcService; class Server; class ServerCredentials; @@ -66,7 +66,7 @@ class ServerBuilder { void RegisterAsyncService(AsynchronousService* service); // Register a generic service. - void RegisterGenericService(GenericService* service); + void RegisterAsyncGenericService(AsyncGenericService* service); // Add a listening port. Can be called multiple times. void AddPort(const grpc::string& addr, @@ -91,7 +91,7 @@ class ServerBuilder { std::vector async_services_; std::vector ports_; std::shared_ptr creds_; - GenericService* generic_service_; + AsyncGenericService* generic_service_; ThreadPoolInterface* thread_pool_; }; diff --git a/src/cpp/server/generic_service.cc b/src/cpp/server/async_generic_service.cc similarity index 84% rename from src/cpp/server/generic_service.cc rename to src/cpp/server/async_generic_service.cc index 8ced775a67d..67241fee7e9 100644 --- a/src/cpp/server/generic_service.cc +++ b/src/cpp/server/async_generic_service.cc @@ -31,16 +31,16 @@ * */ -#include +#include #include namespace grpc { -void GenericService::RequestCall(GenericServerContext* ctx, - GenericServerReaderWriter* reader_writer, - CompletionQueue* cq, void* tag) { - server_->RequestGenericCall(ctx, reader_writer, cq, tag); +void AsyncGenericService::RequestCall( + GenericServerContext* ctx, GenericServerAsyncReaderWriter* reader_writer, + CompletionQueue* cq, void* tag) { + server_->RequestAsyncGenericCall(ctx, reader_writer, cq, tag); } } // namespace grpc diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index f72b8a30a64..cc632a71924 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include @@ -228,7 +228,7 @@ bool Server::RegisterAsyncService(AsynchronousService* service) { return true; } -void Server::RegisterGenericService(GenericService* service) { +void Server::RegisterAsyncGenericService(AsyncGenericService* service) { GPR_ASSERT(service->server_ == nullptr && "Can only register an generic service against one server."); service->server_ = this; @@ -395,9 +395,9 @@ void Server::RequestAsyncCall(void* registered_method, ServerContext* context, new AsyncRequest(this, registered_method, context, request, stream, cq, tag); } -void Server::RequestGenericCall(GenericServerContext* context, - ServerAsyncStreamingInterface* stream, - CompletionQueue* cq, void* tag) { +void Server::RequestAsyncGenericCall(GenericServerContext* context, + ServerAsyncStreamingInterface* stream, + CompletionQueue* cq, void* tag) { new AsyncRequest(this, context, stream, cq, tag); } diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index 083509e797c..835596d393a 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -52,10 +52,10 @@ void ServerBuilder::RegisterAsyncService(AsynchronousService* service) { async_services_.push_back(service); } -void ServerBuilder::RegisterGenericService(GenericService* service) { +void ServerBuilder::RegisterAsyncGenericService(AsyncGenericService* service) { if (generic_service_) { gpr_log(GPR_ERROR, - "Adding multiple GenericService is unsupported for now. " + "Adding multiple AsyncGenericService is unsupported for now. " "Dropping the service %p", service); return; } @@ -96,7 +96,7 @@ std::unique_ptr ServerBuilder::BuildAndStart() { } } if (generic_service_) { - server->RegisterGenericService(generic_service_); + server->RegisterAsyncGenericService(generic_service_); } for (auto& port : ports_) { int r = server->AddPort(port.addr, port.creds.get()); diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index 0dd64007fd2..b165eaeb8c4 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -37,7 +37,7 @@ #include "test/core/util/test_config.h" #include "test/cpp/util/echo.pb.h" #include "src/cpp/util/time.h" -#include +#include #include #include #include @@ -87,7 +87,7 @@ class GenericEnd2endTest : public ::testing::Test { // Setup server ServerBuilder builder; builder.AddPort(server_address_.str(), InsecureServerCredentials()); - builder.RegisterGenericService(&generic_service_); + builder.RegisterAsyncGenericService(&generic_service_); server_ = builder.BuildAndStart(); } @@ -124,7 +124,7 @@ class GenericEnd2endTest : public ::testing::Test { ClientContext cli_ctx; GenericServerContext srv_ctx; - GenericServerReaderWriter stream(&srv_ctx); + GenericServerAsyncReaderWriter stream(&srv_ctx); send_request.set_message("Hello"); std::unique_ptr > response_reader( @@ -171,7 +171,7 @@ class GenericEnd2endTest : public ::testing::Test { CompletionQueue srv_cq_; std::unique_ptr stub_; std::unique_ptr server_; - GenericService generic_service_; + AsyncGenericService generic_service_; std::ostringstream server_address_; }; From 05e3eefcf853c870b5273021ca79adeadbb1683a Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Thu, 12 Mar 2015 23:41:46 -0700 Subject: [PATCH 21/75] Early return when duration is non-positive --- src/cpp/client/secure_credentials.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index 795d7731c93..fa5ce1e5d48 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -98,8 +98,10 @@ std::unique_ptr ComputeEngineCredentials() { std::unique_ptr ServiceAccountCredentials( const grpc::string& json_key, const grpc::string& scope, std::chrono::seconds token_lifetime) { - gpr_timespec lifetime = gpr_time_from_seconds( - token_lifetime.count() > 0 ? token_lifetime.count() : 0); + if (token_lifetime.count() <= 0) { + return WrapCredentials(nullptr); + } + gpr_timespec lifetime = gpr_time_from_seconds(token_lifetime.count()); return WrapCredentials(grpc_service_account_credentials_create( json_key.c_str(), scope.c_str(), lifetime)); } @@ -107,8 +109,10 @@ std::unique_ptr ServiceAccountCredentials( // Builds JWT credentials. std::unique_ptr JWTCredentials( const grpc::string &json_key, std::chrono::seconds token_lifetime) { - gpr_timespec lifetime = gpr_time_from_seconds( - token_lifetime.count() > 0 ? token_lifetime.count() : 0); + if (token_lifetime.count() <= 0) { + return WrapCredentials(nullptr); + } + gpr_timespec lifetime = gpr_time_from_seconds(token_lifetime.count()); return WrapCredentials( grpc_jwt_credentials_create(json_key.c_str(), lifetime)); } From 229000fd2b55ea426461c88bc4889297cd1baa80 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 13 Mar 2015 23:52:56 +0900 Subject: [PATCH 22/75] Use "host" header field if ":authority" is not present ":authority" is not mandatory in HTTP/2 unless request method is "CONNECT". If ":authority" is not present, server should look for "host" header field. This patch does not check method value, it is a future TODO. This is a first step for GH-1022. --- src/core/channel/http_server_filter.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/core/channel/http_server_filter.c b/src/core/channel/http_server_filter.c index d1616a3450d..f565cbf3aeb 100644 --- a/src/core/channel/http_server_filter.c +++ b/src/core/channel/http_server_filter.c @@ -66,6 +66,10 @@ typedef struct channel_data { grpc_mdelem *status_ok; grpc_mdelem *status_not_found; grpc_mdstr *path_key; + grpc_mdstr *authority_key; + grpc_mdstr *host_key; + + grpc_mdctx *mdctx; size_t gettable_count; gettable *gettables; @@ -181,6 +185,15 @@ static void call_op(grpc_call_element *elem, grpc_call_element *from_elem, } calld->path = op->data.metadata; op->done_cb(op->user_data, GRPC_OP_OK); + } else if (op->data.metadata->key == channeld->host_key) { + /* translate host to :authority since :authority may be + omitted */ + grpc_mdelem *authority = grpc_mdelem_from_metadata_strings( + channeld->mdctx, channeld->authority_key, op->data.metadata->value); + grpc_mdelem_unref(op->data.metadata); + op->data.metadata = authority; + /* pass the event up */ + grpc_call_next_op(elem, op); } else { /* pass the event up */ grpc_call_next_op(elem, op); @@ -305,9 +318,13 @@ static void init_channel_elem(grpc_channel_element *elem, channeld->https_scheme = grpc_mdelem_from_strings(mdctx, ":scheme", "https"); channeld->grpc_scheme = grpc_mdelem_from_strings(mdctx, ":scheme", "grpc"); channeld->path_key = grpc_mdstr_from_string(mdctx, ":path"); + channeld->authority_key = grpc_mdstr_from_string(mdctx, ":authority"); + channeld->host_key = grpc_mdstr_from_string(mdctx, "host"); channeld->content_type = grpc_mdelem_from_strings(mdctx, "content-type", "application/grpc"); + channeld->mdctx = mdctx; + /* initialize http download support */ channeld->gettable_count = 0; channeld->gettables = NULL; @@ -357,6 +374,8 @@ static void destroy_channel_elem(grpc_channel_element *elem) { grpc_mdelem_unref(channeld->grpc_scheme); grpc_mdelem_unref(channeld->content_type); grpc_mdstr_unref(channeld->path_key); + grpc_mdstr_unref(channeld->authority_key); + grpc_mdstr_unref(channeld->host_key); } const grpc_channel_filter grpc_http_server_filter = { From 2729fbadcf9040c0181e1b87a11ae815f7dfbe52 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Fri, 13 Mar 2015 13:28:09 -0700 Subject: [PATCH 23/75] wording change --- src/cpp/server/server.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index cc632a71924..cd6b8a554be 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -211,7 +211,7 @@ bool Server::RegisterService(RpcService* service) { bool Server::RegisterAsyncService(AsynchronousService* service) { GPR_ASSERT(service->dispatch_impl_ == nullptr && - "Can only register an asynchronous service against one server."); + "Can only register one asynchronous service against one server."); service->dispatch_impl_ = this; service->request_args_ = new void* [service->method_count_]; for (size_t i = 0; i < service->method_count_; ++i) { @@ -230,7 +230,7 @@ bool Server::RegisterAsyncService(AsynchronousService* service) { void Server::RegisterAsyncGenericService(AsyncGenericService* service) { GPR_ASSERT(service->server_ == nullptr && - "Can only register an generic service against one server."); + "Can only register one generic service against one server."); service->server_ = this; } From 30e666cae7d4f8183869869a907c689ced872867 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Fri, 13 Mar 2015 14:45:40 -0700 Subject: [PATCH 24/75] Creates cpu_iphone.c So that cpu_posix.c can be left untouched for the other platforms. --- include/grpc/support/cpu.h | 2 +- include/grpc/support/port_platform.h | 4 +++ src/core/support/cpu_iphone.c | 53 ++++++++++++++++++++++++++++ src/core/support/cpu_posix.c | 16 +++++++-- 4 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 src/core/support/cpu_iphone.c diff --git a/include/grpc/support/cpu.h b/include/grpc/support/cpu.h index 005c3c721cc..2b2a56168ac 100644 --- a/include/grpc/support/cpu.h +++ b/include/grpc/support/cpu.h @@ -41,7 +41,7 @@ extern "C" { /* Interface providing CPU information for currently running system */ /* Return the number of CPU cores on the current system. Will return 0 if - if information is not available. */ + the information is not available. */ unsigned gpr_cpu_num_cores(void); /* Return the CPU on which the current thread is executing; N.B. This should diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index f04c2e76afa..fa7ef682cec 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -117,7 +117,11 @@ #ifndef _BSD_SOURCE #define _BSD_SOURCE #endif +#ifdef TARGET_OS_IPHONE +#define GPR_CPU_IPHONE 1 +#else /* TARGET_OS_IPHONE */ #define GPR_CPU_POSIX 1 +#endif #define GPR_GCC_ATOMIC 1 #define GPR_POSIX_LOG 1 #define GPR_POSIX_MULTIPOLL_WITH_POLL 1 diff --git a/src/core/support/cpu_iphone.c b/src/core/support/cpu_iphone.c new file mode 100644 index 00000000000..d412a6d7ee6 --- /dev/null +++ b/src/core/support/cpu_iphone.c @@ -0,0 +1,53 @@ +/* + * + * 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 + +#ifdef GPR_CPU_IPHONE + +/* Probably 2 instead of 1, but see comment on gpr_cpu_current_cpu. */ +unsigned gpr_cpu_num_cores(void) { + return 1; +} + +/* Most code that's using this is using it to shard across work queues. So + unless profiling shows it's a problem or there appears a way to detect the + currently running CPU core, let's have it shard the default way. + Note that the interface in cpu.h lets gpr_cpu_num_cores return 0, but doing + it makes it impossible for gpr_cpu_current_cpu to satisfy its stated range, + and some code might be relying on it. */ +unsigned gpr_cpu_current_cpu(void) { + return 0; +} + +#endif /* GPR_CPU_IPHONE */ diff --git a/src/core/support/cpu_posix.c b/src/core/support/cpu_posix.c index 1844e9a6221..99484e37fbc 100644 --- a/src/core/support/cpu_posix.c +++ b/src/core/support/cpu_posix.c @@ -42,6 +42,8 @@ #include #include +static __thread char magic_thread_local; + static int ncpus = 0; static void init_ncpus() { @@ -58,10 +60,18 @@ unsigned gpr_cpu_num_cores(void) { return ncpus; } +/* This is a cheap, but good enough, pointer hash for sharding things: */ +static size_t shard_ptr(const void *info) { + size_t x = (size_t)info; + return ((x >> 4) ^ (x >> 9) ^ (x >> 14)) % gpr_cpu_num_cores(); +} + unsigned gpr_cpu_current_cpu(void) { /* NOTE: there's no way I know to return the actual cpu index portably... - most code that's using this is using it to shard across work queues though */ - return 0; + most code that's using this is using it to shard across work queues though, + so here we use thread identity instead to achieve a similar though not + identical effect */ + return shard_ptr(&magic_thread_local); } -#endif /* GPR_CPU_LINUX */ +#endif /* GPR_CPU_POSIX */ From 9fbbc7bb13716a78f584fab536efbc03631010e6 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Fri, 13 Mar 2015 15:33:08 -0700 Subject: [PATCH 25/75] add one bidi test --- test/cpp/end2end/generic_end2end_test.cc | 452 ++++------------------- 1 file changed, 80 insertions(+), 372 deletions(-) diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index b165eaeb8c4..5ea2828db2e 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -34,9 +34,11 @@ #include #include +#include "src/cpp/proto/proto_utils.h" +#include "src/cpp/util/time.h" +#include "test/core/util/port.h" #include "test/core/util/test_config.h" #include "test/cpp/util/echo.pb.h" -#include "src/cpp/util/time.h" #include #include #include @@ -52,7 +54,6 @@ #include #include #include -#include "test/core/util/port.h" #include #include @@ -77,6 +78,17 @@ void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { EXPECT_EQ(tag(i), got_tag); } +bool ParseFromByteBuffer(ByteBuffer* buffer, grpc::protobuf::Message* message) { + std::vector slices; + buffer->Dump(&slices); + grpc::string buf; + buf.reserve(buffer->Length()); + for (const Slice& s : slices) { + buf.append(reinterpret_cast(s.begin()), s.size()); + } + return message->ParseFromString(buf); +} + class GenericEnd2endTest : public ::testing::Test { protected: GenericEnd2endTest() {} @@ -139,16 +151,11 @@ class GenericEnd2endTest : public ::testing::Test { ByteBuffer recv_buffer; stream.Read(&recv_buffer, tag(3)); server_ok(3); - std::vector slices; - recv_buffer.Dump(&slices); - EXPECT_EQ(1, slices.size()); // FIXME(yangg) handle real vector - grpc::string buf(reinterpret_cast(slices[0].begin()), - slices[0].size()); - EXPECT_TRUE(recv_request.ParseFromString(buf)); + EXPECT_TRUE(ParseFromByteBuffer(&recv_buffer, &recv_request)); EXPECT_EQ(send_request.message(), recv_request.message()); send_response.set_message(recv_request.message()); - buf.clear(); + grpc::string buf; send_response.SerializeToString(&buf); gpr_slice s = gpr_slice_from_copied_string(buf.c_str()); Slice slice(s, Slice::STEAL_REF); @@ -185,369 +192,70 @@ TEST_F(GenericEnd2endTest, SequentialRpcs) { SendRpc(10); } -// // Two pings and a final pong. -// TEST_F(GenericEnd2endTest, SimpleClientStreaming) { -// ResetStub(); -// -// EchoRequest send_request; -// EchoRequest recv_request; -// EchoResponse send_response; -// EchoResponse recv_response; -// Status recv_status; -// ClientContext cli_ctx; -// ServerContext srv_ctx; -// ServerAsyncReader srv_stream(&srv_ctx); -// -// send_request.set_message("Hello"); -// std::unique_ptr > cli_stream( -// stub_->AsyncRequestStream(&cli_ctx, &recv_response, &cli_cq_, tag(1))); -// -// service_.RequestRequestStream(&srv_ctx, &srv_stream, &srv_cq_, tag(2)); -// -// server_ok(2); -// client_ok(1); -// -// cli_stream->Write(send_request, tag(3)); -// client_ok(3); -// -// srv_stream.Read(&recv_request, tag(4)); -// server_ok(4); -// EXPECT_EQ(send_request.message(), recv_request.message()); -// -// cli_stream->Write(send_request, tag(5)); -// client_ok(5); -// -// srv_stream.Read(&recv_request, tag(6)); -// server_ok(6); -// -// EXPECT_EQ(send_request.message(), recv_request.message()); -// cli_stream->WritesDone(tag(7)); -// client_ok(7); -// -// srv_stream.Read(&recv_request, tag(8)); -// server_fail(8); -// -// send_response.set_message(recv_request.message()); -// srv_stream.Finish(send_response, Status::OK, tag(9)); -// server_ok(9); -// -// cli_stream->Finish(&recv_status, tag(10)); -// client_ok(10); -// -// EXPECT_EQ(send_response.message(), recv_response.message()); -// EXPECT_TRUE(recv_status.IsOk()); -// } -// -// // One ping, two pongs. -// TEST_F(GenericEnd2endTest, SimpleServerStreaming) { -// ResetStub(); -// -// EchoRequest send_request; -// EchoRequest recv_request; -// EchoResponse send_response; -// EchoResponse recv_response; -// Status recv_status; -// ClientContext cli_ctx; -// ServerContext srv_ctx; -// ServerAsyncWriter srv_stream(&srv_ctx); -// -// send_request.set_message("Hello"); -// std::unique_ptr > cli_stream( -// stub_->AsyncResponseStream(&cli_ctx, send_request, &cli_cq_, tag(1))); -// -// service_.RequestResponseStream(&srv_ctx, &recv_request, &srv_stream, &srv_cq_, -// tag(2)); -// -// server_ok(2); -// client_ok(1); -// EXPECT_EQ(send_request.message(), recv_request.message()); -// -// send_response.set_message(recv_request.message()); -// srv_stream.Write(send_response, tag(3)); -// server_ok(3); -// -// cli_stream->Read(&recv_response, tag(4)); -// client_ok(4); -// EXPECT_EQ(send_response.message(), recv_response.message()); -// -// srv_stream.Write(send_response, tag(5)); -// server_ok(5); -// -// cli_stream->Read(&recv_response, tag(6)); -// client_ok(6); -// EXPECT_EQ(send_response.message(), recv_response.message()); -// -// srv_stream.Finish(Status::OK, tag(7)); -// server_ok(7); -// -// cli_stream->Read(&recv_response, tag(8)); -// client_fail(8); -// -// cli_stream->Finish(&recv_status, tag(9)); -// client_ok(9); -// -// EXPECT_TRUE(recv_status.IsOk()); -// } -// -// // One ping, one pong. -// TEST_F(GenericEnd2endTest, SimpleBidiStreaming) { -// ResetStub(); -// -// EchoRequest send_request; -// EchoRequest recv_request; -// EchoResponse send_response; -// EchoResponse recv_response; -// Status recv_status; -// ClientContext cli_ctx; -// ServerContext srv_ctx; -// ServerAsyncReaderWriter srv_stream(&srv_ctx); -// -// send_request.set_message("Hello"); -// std::unique_ptr > -// cli_stream(stub_->AsyncBidiStream(&cli_ctx, &cli_cq_, tag(1))); -// -// service_.RequestBidiStream(&srv_ctx, &srv_stream, &srv_cq_, tag(2)); -// -// server_ok(2); -// client_ok(1); -// -// cli_stream->Write(send_request, tag(3)); -// client_ok(3); -// -// srv_stream.Read(&recv_request, tag(4)); -// server_ok(4); -// EXPECT_EQ(send_request.message(), recv_request.message()); -// -// send_response.set_message(recv_request.message()); -// srv_stream.Write(send_response, tag(5)); -// server_ok(5); -// -// cli_stream->Read(&recv_response, tag(6)); -// client_ok(6); -// EXPECT_EQ(send_response.message(), recv_response.message()); -// -// cli_stream->WritesDone(tag(7)); -// client_ok(7); -// -// srv_stream.Read(&recv_request, tag(8)); -// server_fail(8); -// -// srv_stream.Finish(Status::OK, tag(9)); -// server_ok(9); -// -// cli_stream->Finish(&recv_status, tag(10)); -// client_ok(10); -// -// EXPECT_TRUE(recv_status.IsOk()); -// } -// -// // Metadata tests -// TEST_F(GenericEnd2endTest, ClientInitialMetadataRpc) { -// ResetStub(); -// -// EchoRequest send_request; -// EchoRequest recv_request; -// EchoResponse send_response; -// EchoResponse recv_response; -// Status recv_status; -// -// ClientContext cli_ctx; -// ServerContext srv_ctx; -// grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); -// -// send_request.set_message("Hello"); -// std::pair meta1("key1", "val1"); -// std::pair meta2("key2", "val2"); -// cli_ctx.AddMetadata(meta1.first, meta1.second); -// cli_ctx.AddMetadata(meta2.first, meta2.second); -// -// std::unique_ptr > response_reader( -// stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); -// -// service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, -// tag(2)); -// server_ok(2); -// EXPECT_EQ(send_request.message(), recv_request.message()); -// auto client_initial_metadata = srv_ctx.client_metadata(); -// EXPECT_EQ(meta1.second, client_initial_metadata.find(meta1.first)->second); -// EXPECT_EQ(meta2.second, client_initial_metadata.find(meta2.first)->second); -// EXPECT_EQ(static_cast(2), client_initial_metadata.size()); -// client_ok(1); -// -// send_response.set_message(recv_request.message()); -// response_writer.Finish(send_response, Status::OK, tag(3)); -// -// server_ok(3); -// -// response_reader->Finish(&recv_response, &recv_status, tag(4)); -// client_ok(4); -// -// EXPECT_EQ(send_response.message(), recv_response.message()); -// EXPECT_TRUE(recv_status.IsOk()); -// } -// -// TEST_F(GenericEnd2endTest, ServerInitialMetadataRpc) { -// ResetStub(); -// -// EchoRequest send_request; -// EchoRequest recv_request; -// EchoResponse send_response; -// EchoResponse recv_response; -// Status recv_status; -// -// ClientContext cli_ctx; -// ServerContext srv_ctx; -// grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); -// -// send_request.set_message("Hello"); -// std::pair meta1("key1", "val1"); -// std::pair meta2("key2", "val2"); -// -// std::unique_ptr > response_reader( -// stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); -// -// service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, -// tag(2)); -// server_ok(2); -// EXPECT_EQ(send_request.message(), recv_request.message()); -// srv_ctx.AddInitialMetadata(meta1.first, meta1.second); -// srv_ctx.AddInitialMetadata(meta2.first, meta2.second); -// client_ok(1); -// response_writer.SendInitialMetadata(tag(3)); -// server_ok(3); -// -// response_reader->ReadInitialMetadata(tag(4)); -// client_ok(4); -// auto server_initial_metadata = cli_ctx.GetServerInitialMetadata(); -// EXPECT_EQ(meta1.second, server_initial_metadata.find(meta1.first)->second); -// EXPECT_EQ(meta2.second, server_initial_metadata.find(meta2.first)->second); -// EXPECT_EQ(static_cast(2), server_initial_metadata.size()); -// -// send_response.set_message(recv_request.message()); -// response_writer.Finish(send_response, Status::OK, tag(5)); -// server_ok(5); -// -// response_reader->Finish(&recv_response, &recv_status, tag(6)); -// client_ok(6); -// -// EXPECT_EQ(send_response.message(), recv_response.message()); -// EXPECT_TRUE(recv_status.IsOk()); -// } -// -// TEST_F(GenericEnd2endTest, ServerTrailingMetadataRpc) { -// ResetStub(); -// -// EchoRequest send_request; -// EchoRequest recv_request; -// EchoResponse send_response; -// EchoResponse recv_response; -// Status recv_status; -// -// ClientContext cli_ctx; -// ServerContext srv_ctx; -// grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); -// -// send_request.set_message("Hello"); -// std::pair meta1("key1", "val1"); -// std::pair meta2("key2", "val2"); -// -// std::unique_ptr > response_reader( -// stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); -// -// service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, -// tag(2)); -// server_ok(2); -// EXPECT_EQ(send_request.message(), recv_request.message()); -// response_writer.SendInitialMetadata(tag(3)); -// server_ok(3); -// client_ok(1); -// -// send_response.set_message(recv_request.message()); -// srv_ctx.AddTrailingMetadata(meta1.first, meta1.second); -// srv_ctx.AddTrailingMetadata(meta2.first, meta2.second); -// response_writer.Finish(send_response, Status::OK, tag(4)); -// -// server_ok(4); -// -// response_reader->Finish(&recv_response, &recv_status, tag(5)); -// client_ok(5); -// EXPECT_EQ(send_response.message(), recv_response.message()); -// EXPECT_TRUE(recv_status.IsOk()); -// auto server_trailing_metadata = cli_ctx.GetServerTrailingMetadata(); -// EXPECT_EQ(meta1.second, server_trailing_metadata.find(meta1.first)->second); -// EXPECT_EQ(meta2.second, server_trailing_metadata.find(meta2.first)->second); -// EXPECT_EQ(static_cast(2), server_trailing_metadata.size()); -// } -// -// TEST_F(GenericEnd2endTest, MetadataRpc) { -// ResetStub(); -// -// EchoRequest send_request; -// EchoRequest recv_request; -// EchoResponse send_response; -// EchoResponse recv_response; -// Status recv_status; -// -// ClientContext cli_ctx; -// ServerContext srv_ctx; -// grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); -// -// send_request.set_message("Hello"); -// std::pair meta1("key1", "val1"); -// std::pair meta2( -// "key2-bin", {"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc", 13}); -// std::pair meta3("key3", "val3"); -// std::pair meta6( -// "key4-bin", -// {"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d", 14}); -// std::pair meta5("key5", "val5"); -// std::pair meta4( -// "key6-bin", -// {"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee", 15}); -// -// cli_ctx.AddMetadata(meta1.first, meta1.second); -// cli_ctx.AddMetadata(meta2.first, meta2.second); -// -// std::unique_ptr > response_reader( -// stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); -// -// service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, -// tag(2)); -// server_ok(2); -// EXPECT_EQ(send_request.message(), recv_request.message()); -// auto client_initial_metadata = srv_ctx.client_metadata(); -// EXPECT_EQ(meta1.second, client_initial_metadata.find(meta1.first)->second); -// EXPECT_EQ(meta2.second, client_initial_metadata.find(meta2.first)->second); -// EXPECT_EQ(static_cast(2), client_initial_metadata.size()); -// client_ok(1); -// -// srv_ctx.AddInitialMetadata(meta3.first, meta3.second); -// srv_ctx.AddInitialMetadata(meta4.first, meta4.second); -// response_writer.SendInitialMetadata(tag(3)); -// server_ok(3); -// response_reader->ReadInitialMetadata(tag(4)); -// client_ok(4); -// auto server_initial_metadata = cli_ctx.GetServerInitialMetadata(); -// EXPECT_EQ(meta3.second, server_initial_metadata.find(meta3.first)->second); -// EXPECT_EQ(meta4.second, server_initial_metadata.find(meta4.first)->second); -// EXPECT_EQ(static_cast(2), server_initial_metadata.size()); -// -// send_response.set_message(recv_request.message()); -// srv_ctx.AddTrailingMetadata(meta5.first, meta5.second); -// srv_ctx.AddTrailingMetadata(meta6.first, meta6.second); -// response_writer.Finish(send_response, Status::OK, tag(5)); -// -// server_ok(5); -// -// response_reader->Finish(&recv_response, &recv_status, tag(6)); -// client_ok(6); -// EXPECT_EQ(send_response.message(), recv_response.message()); -// EXPECT_TRUE(recv_status.IsOk()); -// auto server_trailing_metadata = cli_ctx.GetServerTrailingMetadata(); -// EXPECT_EQ(meta5.second, server_trailing_metadata.find(meta5.first)->second); -// EXPECT_EQ(meta6.second, server_trailing_metadata.find(meta6.first)->second); -// EXPECT_EQ(static_cast(2), server_trailing_metadata.size()); -// } +// One ping, one pong. +TEST_F(GenericEnd2endTest, SimpleBidiStreaming) { + ResetStub(); + + EchoRequest send_request; + EchoRequest recv_request; + EchoResponse send_response; + EchoResponse recv_response; + Status recv_status; + ClientContext cli_ctx; + GenericServerContext srv_ctx; + GenericServerAsyncReaderWriter srv_stream(&srv_ctx); + + send_request.set_message("Hello"); + std::unique_ptr > + cli_stream(stub_->AsyncBidiStream(&cli_ctx, &cli_cq_, tag(1))); + client_ok(1); + + generic_service_.RequestCall(&srv_ctx, &srv_stream, &srv_cq_, tag(2)); + + verify_ok(server_->cq(), 2, true); + EXPECT_EQ(server_address_.str(), srv_ctx.host()); + EXPECT_EQ("/grpc.cpp.test.util.TestService/BidiStream", srv_ctx.method()); + + cli_stream->Write(send_request, tag(3)); + client_ok(3); + + ByteBuffer recv_buffer; + srv_stream.Read(&recv_buffer, tag(3)); + server_ok(3); + EXPECT_TRUE(ParseFromByteBuffer(&recv_buffer, &recv_request)); + EXPECT_EQ(send_request.message(), recv_request.message()); + + send_response.set_message(recv_request.message()); + grpc::string buf; + send_response.SerializeToString(&buf); + gpr_slice s = gpr_slice_from_copied_string(buf.c_str()); + Slice slice(s, Slice::STEAL_REF); + ByteBuffer send_buffer(&slice, 1); + srv_stream.Write(send_buffer, tag(4)); + server_ok(4); + + cli_stream->Read(&recv_response, tag(6)); + client_ok(6); + EXPECT_EQ(send_response.message(), recv_response.message()); + + + cli_stream->WritesDone(tag(7)); + client_ok(7); + + recv_buffer.Clear(); + srv_stream.Read(&recv_buffer, tag(3)); + server_fail(3); + + srv_stream.Finish(Status::OK, tag(5)); + server_ok(5); + + cli_stream->Finish(&recv_status, tag(10)); + client_ok(10); + + EXPECT_EQ(send_response.message(), recv_response.message()); + EXPECT_TRUE(recv_status.IsOk()); +} + } // namespace } // namespace testing } // namespace grpc From 45c09db87c7d57b97112a1118054c2e07bfad45a Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Fri, 13 Mar 2015 15:49:35 -0700 Subject: [PATCH 26/75] sort the tags, this is not necessary, just make it look better --- test/cpp/end2end/generic_end2end_test.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index 5ea2828db2e..102f1c758b8 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -220,8 +220,8 @@ TEST_F(GenericEnd2endTest, SimpleBidiStreaming) { client_ok(3); ByteBuffer recv_buffer; - srv_stream.Read(&recv_buffer, tag(3)); - server_ok(3); + srv_stream.Read(&recv_buffer, tag(4)); + server_ok(4); EXPECT_TRUE(ParseFromByteBuffer(&recv_buffer, &recv_request)); EXPECT_EQ(send_request.message(), recv_request.message()); @@ -231,8 +231,8 @@ TEST_F(GenericEnd2endTest, SimpleBidiStreaming) { gpr_slice s = gpr_slice_from_copied_string(buf.c_str()); Slice slice(s, Slice::STEAL_REF); ByteBuffer send_buffer(&slice, 1); - srv_stream.Write(send_buffer, tag(4)); - server_ok(4); + srv_stream.Write(send_buffer, tag(5)); + server_ok(5); cli_stream->Read(&recv_response, tag(6)); client_ok(6); @@ -243,11 +243,11 @@ TEST_F(GenericEnd2endTest, SimpleBidiStreaming) { client_ok(7); recv_buffer.Clear(); - srv_stream.Read(&recv_buffer, tag(3)); - server_fail(3); + srv_stream.Read(&recv_buffer, tag(8)); + server_fail(8); - srv_stream.Finish(Status::OK, tag(5)); - server_ok(5); + srv_stream.Finish(Status::OK, tag(9)); + server_ok(9); cli_stream->Finish(&recv_status, tag(10)); client_ok(10); From dca15a6d1e156ea06a040f0a595867de2056b789 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Fri, 13 Mar 2015 15:54:38 -0700 Subject: [PATCH 27/75] add a comment --- include/grpc++/slice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/grpc++/slice.h b/include/grpc++/slice.h index 11b6a28d4f2..3e01bcf0ad7 100644 --- a/include/grpc++/slice.h +++ b/include/grpc++/slice.h @@ -53,7 +53,7 @@ class Slice GRPC_FINAL { Slice(gpr_slice slice, StealRef); // copy constructor - adds a ref Slice(const Slice& other); - // assignment + // assignment - ref count is unchanged Slice& operator=(Slice other) { std::swap(slice_, other.slice_); return *this; From 94e296c3574180178337720dac505a6662dcd252 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Fri, 13 Mar 2015 16:06:56 -0700 Subject: [PATCH 28/75] Add error logs when credentials are created with non-positive lifetimes --- src/cpp/client/secure_credentials.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index fa5ce1e5d48..c0dfaef3a53 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -99,6 +99,8 @@ std::unique_ptr ServiceAccountCredentials( const grpc::string& json_key, const grpc::string& scope, std::chrono::seconds token_lifetime) { if (token_lifetime.count() <= 0) { + gpr_log(GPR_ERROR, + "Trying to create JWTCredentials with non-positive lifetime"); return WrapCredentials(nullptr); } gpr_timespec lifetime = gpr_time_from_seconds(token_lifetime.count()); @@ -110,6 +112,8 @@ std::unique_ptr ServiceAccountCredentials( std::unique_ptr JWTCredentials( const grpc::string &json_key, std::chrono::seconds token_lifetime) { if (token_lifetime.count() <= 0) { + gpr_log(GPR_ERROR, + "Trying to create JWTCredentials with non-positive lifetime"); return WrapCredentials(nullptr); } gpr_timespec lifetime = gpr_time_from_seconds(token_lifetime.count()); From 2fbbb9bd95cd6803afaf66e0cffb18d9189f731b Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Fri, 13 Mar 2015 16:10:14 -0700 Subject: [PATCH 29/75] copy and paste does not work --- src/cpp/client/secure_credentials.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index c0dfaef3a53..f0355031661 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -100,7 +100,8 @@ std::unique_ptr ServiceAccountCredentials( std::chrono::seconds token_lifetime) { if (token_lifetime.count() <= 0) { gpr_log(GPR_ERROR, - "Trying to create JWTCredentials with non-positive lifetime"); + "Trying to create ServiceAccountCredentials " + "with non-positive lifetime"); return WrapCredentials(nullptr); } gpr_timespec lifetime = gpr_time_from_seconds(token_lifetime.count()); From b486ba6b0d488b0331cd56d1fac6fd28935c7c46 Mon Sep 17 00:00:00 2001 From: Ruyi Wang Date: Sat, 14 Mar 2015 22:19:44 +0800 Subject: [PATCH 30/75] remove 'else' code, release lock by destructor --- src/cpp/server/server.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index e69032a657d..87296805652 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -179,12 +179,12 @@ Server::Server(ThreadPoolInterface* thread_pool, bool thread_pool_owned) thread_pool_owned_(thread_pool_owned) {} Server::~Server() { - std::unique_lock lock(mu_); - if (started_ && !shutdown_) { - lock.unlock(); - Shutdown(); - } else { - lock.unlock(); + { + std::unique_lock lock(mu_); + if (started_ && !shutdown_) { + lock.unlock(); + Shutdown(); + } } grpc_server_destroy(server_); if (thread_pool_owned_) { From f5a5943a59328ab16e19095c81feb5a3076922a6 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Sun, 15 Mar 2015 15:37:27 -0700 Subject: [PATCH 31/75] Adds GPR_CPU_IPHONE to the checks in port_platform.h --- include/grpc/support/port_platform.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index fa7ef682cec..25602900149 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -179,8 +179,8 @@ #error Must define exactly one of GPR_ARCH_32, GPR_ARCH_64 #endif -#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WIN32) != 1 -#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WIN32 +#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WIN32) + defined(GPR_CPU_IPHONE) != 1 +#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WIN32, GPR_CPU_IPHONE #endif #if defined(GPR_POSIX_MULTIPOLL_WITH_POLL) && !defined(GPR_POSIX_SOCKET) From 7c1c7e8e225557cc30aabee20388db7abadc6bbd Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Mon, 16 Mar 2015 02:35:49 +0100 Subject: [PATCH 32/75] Using cc and c++ instead of gcc and g++. Not all systems are equal, and have gcc. However, cc and c++ are more common aliases for the system's compiler. FreeBSD is an example. --- Makefile | 24 ++++++++++++------------ templates/Makefile.template | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 3e1efc7646a..3be35814f44 100644 --- a/Makefile +++ b/Makefile @@ -51,29 +51,29 @@ GENDIR = $(BUILDDIR)/gens # Configurations VALID_CONFIG_opt = 1 -CC_opt = gcc -CXX_opt = g++ -LD_opt = gcc -LDXX_opt = g++ +CC_opt = cc +CXX_opt = c++ +LD_opt = cc +LDXX_opt = c++ CPPFLAGS_opt = -O2 LDFLAGS_opt = DEFINES_opt = NDEBUG VALID_CONFIG_dbg = 1 -CC_dbg = gcc -CXX_dbg = g++ -LD_dbg = gcc -LDXX_dbg = g++ +CC_dbg = cc +CXX_dbg = c++ +LD_dbg = cc +LDXX_dbg = c++ CPPFLAGS_dbg = -O0 LDFLAGS_dbg = DEFINES_dbg = _DEBUG DEBUG VALID_CONFIG_valgrind = 1 REQUIRE_CUSTOM_LIBRARIES_valgrind = 1 -CC_valgrind = gcc -CXX_valgrind = g++ -LD_valgrind = gcc -LDXX_valgrind = g++ +CC_valgrind = cc +CXX_valgrind = c++ +LD_valgrind = cc +LDXX_valgrind = c++ CPPFLAGS_valgrind = -O0 OPENSSL_CFLAGS_valgrind = -DPURIFY LDFLAGS_valgrind = diff --git a/templates/Makefile.template b/templates/Makefile.template index a69c7a7f2f1..148fa7cd633 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -68,29 +68,29 @@ GENDIR = $(BUILDDIR)/gens # Configurations VALID_CONFIG_opt = 1 -CC_opt = gcc -CXX_opt = g++ -LD_opt = gcc -LDXX_opt = g++ +CC_opt = cc +CXX_opt = c++ +LD_opt = cc +LDXX_opt = c++ CPPFLAGS_opt = -O2 LDFLAGS_opt = DEFINES_opt = NDEBUG VALID_CONFIG_dbg = 1 -CC_dbg = gcc -CXX_dbg = g++ -LD_dbg = gcc -LDXX_dbg = g++ +CC_dbg = cc +CXX_dbg = c++ +LD_dbg = cc +LDXX_dbg = c++ CPPFLAGS_dbg = -O0 LDFLAGS_dbg = DEFINES_dbg = _DEBUG DEBUG VALID_CONFIG_valgrind = 1 REQUIRE_CUSTOM_LIBRARIES_valgrind = 1 -CC_valgrind = gcc -CXX_valgrind = g++ -LD_valgrind = gcc -LDXX_valgrind = g++ +CC_valgrind = cc +CXX_valgrind = c++ +LD_valgrind = cc +LDXX_valgrind = c++ CPPFLAGS_valgrind = -O0 OPENSSL_CFLAGS_valgrind = -DPURIFY LDFLAGS_valgrind = From 1fb5e821a456f2df4dc41444fe8f57d8d8449ee2 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Mon, 16 Mar 2015 06:20:37 +0100 Subject: [PATCH 33/75] Defaulting run_tests to just opt. --- tools/run_tests/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index aee19cdc42d..a132ef45413 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -240,7 +240,7 @@ _CONFIGS = { } -_DEFAULT = ['dbg', 'opt'] +_DEFAULT = ['opt'] _LANGUAGES = { 'c++': CLanguage('cxx', 'c++'), 'c': CLanguage('c', 'c'), From 2da7ca84fda9e7c421f894146eaa6ef026a1ef79 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 16 Mar 2015 00:22:10 -0700 Subject: [PATCH 34/75] Remove dead code --- src/core/channel/metadata_buffer.c | 51 ------------------------------ 1 file changed, 51 deletions(-) diff --git a/src/core/channel/metadata_buffer.c b/src/core/channel/metadata_buffer.c index da66a028c4d..eac852e4a4a 100644 --- a/src/core/channel/metadata_buffer.c +++ b/src/core/channel/metadata_buffer.c @@ -147,54 +147,3 @@ void grpc_metadata_buffer_flush(grpc_metadata_buffer *buffer, gpr_free(impl); *buffer = NULL; } - -size_t grpc_metadata_buffer_count(const grpc_metadata_buffer *buffer) { - return *buffer ? (*buffer)->elems : 0; -} - -typedef struct { - grpc_metadata_buffer_impl *impl; -} elems_hdr; - -grpc_metadata *grpc_metadata_buffer_extract_elements( - grpc_metadata_buffer *buffer) { - grpc_metadata_buffer_impl *impl; - elems_hdr *hdr; - qelem *src; - grpc_metadata *out; - size_t i; - - impl = *buffer; - - if (!impl) { - return NULL; - } - - hdr = gpr_malloc(sizeof(elems_hdr) + impl->elems * sizeof(grpc_metadata)); - src = ELEMS(impl); - out = (grpc_metadata *)(hdr + 1); - - hdr->impl = impl; - for (i = 0; i < impl->elems; i++) { - out[i].key = (char *)grpc_mdstr_as_c_string(src[i].md->key); - out[i].value = (char *)grpc_mdstr_as_c_string(src[i].md->value); - out[i].value_length = GPR_SLICE_LENGTH(src[i].md->value->slice); - } - - /* clear out buffer (it's not possible to extract elements twice */ - *buffer = NULL; - - return out; -} - -void grpc_metadata_buffer_cleanup_elements(void *elements, - grpc_op_error error) { - elems_hdr *hdr = ((elems_hdr *)elements) - 1; - - if (!elements) { - return; - } - - grpc_metadata_buffer_destroy(&hdr->impl, error); - gpr_free(hdr); -} From 1ad253d137c45839c40ba896506ccaa7c42643e7 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Mon, 16 Mar 2015 13:11:29 -0700 Subject: [PATCH 35/75] expose the server's cq through the generic service object --- include/grpc++/async_generic_service.h | 6 +++++- include/grpc++/server.h | 2 -- src/cpp/server/async_generic_service.cc | 4 ++++ src/cpp/server/server.cc | 4 ++-- test/cpp/end2end/generic_end2end_test.cc | 6 +++--- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/include/grpc++/async_generic_service.h b/include/grpc++/async_generic_service.h index 05fa76149e8..d10a56c7f78 100644 --- a/include/grpc++/async_generic_service.h +++ b/include/grpc++/async_generic_service.h @@ -59,12 +59,16 @@ class AsyncGenericService GRPC_FINAL { public: // TODO(yangg) Once we can add multiple completion queues to the server // in c core, add a CompletionQueue* argument to the ctor here. - AsyncGenericService() : server_(nullptr) {} + // TODO(yangg) support methods list. + AsyncGenericService(const grpc::string& methods) : server_(nullptr) {} void RequestCall(GenericServerContext* ctx, GenericServerAsyncReaderWriter* reader_writer, CompletionQueue* cq, void* tag); + // The new rpc event should be obtained from this completion queue. + CompletionQueue* completion_queue(); + private: friend class Server; Server* server_; diff --git a/include/grpc++/server.h b/include/grpc++/server.h index e05bde73495..8cd0a4f6681 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -70,8 +70,6 @@ class Server GRPC_FINAL : private CallHook, // function to ever return) void Wait(); - CompletionQueue* cq() { return &cq_; } - private: friend class AsyncGenericService; friend class ServerBuilder; diff --git a/src/cpp/server/async_generic_service.cc b/src/cpp/server/async_generic_service.cc index 67241fee7e9..2009af7cbd1 100644 --- a/src/cpp/server/async_generic_service.cc +++ b/src/cpp/server/async_generic_service.cc @@ -43,5 +43,9 @@ void AsyncGenericService::RequestCall( server_->RequestAsyncGenericCall(ctx, reader_writer, cq, tag); } +CompletionQueue* AsyncGenericService::completion_queue() { + return &server_->cq_; +} + } // namespace grpc diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index ac350df62db..4d5e77e6337 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -211,7 +211,7 @@ bool Server::RegisterService(RpcService* service) { bool Server::RegisterAsyncService(AsynchronousService* service) { GPR_ASSERT(service->dispatch_impl_ == nullptr && - "Can only register one asynchronous service against one server."); + "Can only register an asynchronous service against one server."); service->dispatch_impl_ = this; service->request_args_ = new void* [service->method_count_]; for (size_t i = 0; i < service->method_count_; ++i) { @@ -230,7 +230,7 @@ bool Server::RegisterAsyncService(AsynchronousService* service) { void Server::RegisterAsyncGenericService(AsyncGenericService* service) { GPR_ASSERT(service->server_ == nullptr && - "Can only register one generic service against one server."); + "Can only register an async generic service against one server."); service->server_ = this; } diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index 102f1c758b8..4a0d2c5c01d 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -91,7 +91,7 @@ bool ParseFromByteBuffer(ByteBuffer* buffer, grpc::protobuf::Message* message) { class GenericEnd2endTest : public ::testing::Test { protected: - GenericEnd2endTest() {} + GenericEnd2endTest() : generic_service_("*") {} void SetUp() GRPC_OVERRIDE { int port = grpc_pick_unused_port_or_die(); @@ -145,7 +145,7 @@ class GenericEnd2endTest : public ::testing::Test { generic_service_.RequestCall(&srv_ctx, &stream, &srv_cq_, tag(2)); - verify_ok(server_->cq(), 2, true); + verify_ok(generic_service_.completion_queue(), 2, true); EXPECT_EQ(server_address_.str(), srv_ctx.host()); EXPECT_EQ("/grpc.cpp.test.util.TestService/Echo", srv_ctx.method()); ByteBuffer recv_buffer; @@ -212,7 +212,7 @@ TEST_F(GenericEnd2endTest, SimpleBidiStreaming) { generic_service_.RequestCall(&srv_ctx, &srv_stream, &srv_cq_, tag(2)); - verify_ok(server_->cq(), 2, true); + verify_ok(generic_service_.completion_queue(), 2, true); EXPECT_EQ(server_address_.str(), srv_ctx.host()); EXPECT_EQ("/grpc.cpp.test.util.TestService/BidiStream", srv_ctx.method()); From c0b3721d61fed71a3528cecfa6797cdc26722d3a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 13 Mar 2015 08:35:41 -0700 Subject: [PATCH 36/75] added support for metadata --- .../Grpc.Core.Tests/ClientServerTest.cs | 14 +- .../Grpc.Core.Tests/Grpc.Core.Tests.csproj | 4 + .../Internal/MetadataArraySafeHandleTest.cs | 62 +++++++ src/csharp/Grpc.Core/Call.cs | 55 +++--- src/csharp/Grpc.Core/Calls.cs | 30 ++-- src/csharp/Grpc.Core/Grpc.Core.csproj | 7 + src/csharp/Grpc.Core/Internal/AsyncCall.cs | 37 ++-- .../Grpc.Core/Internal/CallSafeHandle.cs | 33 ++-- .../Internal/MetadataArraySafeHandle.cs | 72 ++++++++ src/csharp/Grpc.Core/Marshaller.cs | 5 +- src/csharp/Grpc.Core/Metadata.cs | 126 ++++++++++++++ .../Grpc.Core/ServerServiceDefinition.cs | 15 +- src/csharp/Grpc.Core/Stub/AbstractStub.cs | 73 ++++++++ .../Grpc.Core/Stub/StubConfiguration.cs | 64 +++++++ .../MathClientServerTests.cs | 9 +- src/csharp/Grpc.Examples/MathGrpc.cs | 36 ++-- .../Grpc.IntegrationTesting.csproj | 3 +- .../TestServiceGrpc.cs | 41 +++-- src/csharp/ext/grpc_csharp_ext.c | 162 ++++++++++++++---- 19 files changed, 694 insertions(+), 154 deletions(-) create mode 100644 src/csharp/Grpc.Core.Tests/Internal/MetadataArraySafeHandleTest.cs create mode 100644 src/csharp/Grpc.Core/Internal/MetadataArraySafeHandle.cs create mode 100644 src/csharp/Grpc.Core/Metadata.cs create mode 100644 src/csharp/Grpc.Core/Stub/AbstractStub.cs create mode 100644 src/csharp/Grpc.Core/Stub/StubConfiguration.cs diff --git a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs index e73159b3507..807f5a6ded4 100644 --- a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs @@ -46,6 +46,8 @@ namespace Grpc.Core.Tests { string host = "localhost"; + string serviceName = "/tests.Test"; + Method unaryEchoStringMethod = new Method( MethodType.Unary, "/tests.Test/UnaryEchoString", @@ -69,7 +71,7 @@ namespace Grpc.Core.Tests { Server server = new Server(); server.AddServiceDefinition( - ServerServiceDefinition.CreateBuilder("someService") + ServerServiceDefinition.CreateBuilder(serviceName) .AddMethod(unaryEchoStringMethod, HandleUnaryEchoString).Build()); int port = server.AddPort(host + ":0"); @@ -77,7 +79,7 @@ namespace Grpc.Core.Tests using (Channel channel = new Channel(host + ":" + port)) { - var call = new Call(unaryEchoStringMethod, channel); + var call = new Call(serviceName, unaryEchoStringMethod, channel, Metadata.Empty); Assert.AreEqual("ABC", Calls.BlockingUnaryCall(call, "ABC", default(CancellationToken))); @@ -92,7 +94,7 @@ namespace Grpc.Core.Tests { Server server = new Server(); server.AddServiceDefinition( - ServerServiceDefinition.CreateBuilder("someService") + ServerServiceDefinition.CreateBuilder(serviceName) .AddMethod(unaryEchoStringMethod, HandleUnaryEchoString).Build()); int port = server.AddPort(host + ":0"); @@ -100,7 +102,7 @@ namespace Grpc.Core.Tests using (Channel channel = new Channel(host + ":" + port)) { - var call = new Call(unaryEchoStringMethod, channel); + var call = new Call(serviceName, unaryEchoStringMethod, channel, Metadata.Empty); BenchmarkUtil.RunBenchmark(100, 1000, () => { Calls.BlockingUnaryCall(call, "ABC", default(CancellationToken)); }); } @@ -113,14 +115,14 @@ namespace Grpc.Core.Tests { Server server = new Server(); server.AddServiceDefinition( - ServerServiceDefinition.CreateBuilder("someService").Build()); + ServerServiceDefinition.CreateBuilder(serviceName).Build()); int port = server.AddPort(host + ":0"); server.Start(); using (Channel channel = new Channel(host + ":" + port)) { - var call = new Call(unaryEchoStringMethod, channel); + var call = new Call(serviceName, unaryEchoStringMethod, channel, Metadata.Empty); try { diff --git a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj index a365320f052..eac8d16fb15 100644 --- a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj +++ b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj @@ -42,6 +42,7 @@ + @@ -56,4 +57,7 @@ + + + \ No newline at end of file diff --git a/src/csharp/Grpc.Core.Tests/Internal/MetadataArraySafeHandleTest.cs b/src/csharp/Grpc.Core.Tests/Internal/MetadataArraySafeHandleTest.cs new file mode 100644 index 00000000000..2f6013483d9 --- /dev/null +++ b/src/csharp/Grpc.Core.Tests/Internal/MetadataArraySafeHandleTest.cs @@ -0,0 +1,62 @@ +#region Copyright notice and license + +// 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. + +#endregion + +using System; +using Grpc.Core; +using Grpc.Core.Internal; +using Grpc.Core.Utils; +using NUnit.Framework; + +namespace Grpc.Core.Internal.Tests +{ + public class MetadataArraySafeHandleTest + { + [Test] + public void CreateEmptyAndDestroy() + { + var metadata = Metadata.CreateBuilder().Build(); + var nativeMetadata = MetadataArraySafeHandle.Create(metadata); + nativeMetadata.Dispose(); + } + + [Test] + public void CreateAndDestroy() + { + var metadata = Metadata.CreateBuilder() + .Add(new Metadata.MetadataEntry("host", "somehost")) + .Add(new Metadata.MetadataEntry("header2", "header value")).Build(); + var nativeMetadata = MetadataArraySafeHandle.Create(metadata); + nativeMetadata.Dispose(); + } + } +} diff --git a/src/csharp/Grpc.Core/Call.cs b/src/csharp/Grpc.Core/Call.cs index d84d5940c28..fe5f40f5e90 100644 --- a/src/csharp/Grpc.Core/Call.cs +++ b/src/csharp/Grpc.Core/Call.cs @@ -33,65 +33,70 @@ using System; using Grpc.Core.Internal; +using Grpc.Core.Utils; namespace Grpc.Core { public class Call { - readonly string methodName; - readonly Func requestSerializer; - readonly Func responseDeserializer; + readonly string name; + readonly Marshaller requestMarshaller; + readonly Marshaller responseMarshaller; readonly Channel channel; + readonly Metadata headers; - public Call(string methodName, - Func requestSerializer, - Func responseDeserializer, - TimeSpan timeout, - Channel channel) + public Call(string serviceName, Method method, Channel channel, Metadata headers) { - this.methodName = methodName; - this.requestSerializer = requestSerializer; - this.responseDeserializer = responseDeserializer; - this.channel = channel; + this.name = Preconditions.CheckNotNull(serviceName) + "/" + method.Name; + this.requestMarshaller = method.RequestMarshaller; + this.responseMarshaller = method.ResponseMarshaller; + this.channel = Preconditions.CheckNotNull(channel); + this.headers = Preconditions.CheckNotNull(headers); } - public Call(Method method, Channel channel) + public Channel Channel { - this.methodName = method.Name; - this.requestSerializer = method.RequestMarshaller.Serializer; - this.responseDeserializer = method.ResponseMarshaller.Deserializer; - this.channel = channel; + get + { + return this.channel; + } } - public Channel Channel + /// + /// Full methods name including the service name. + /// + public string Name { get { - return this.channel; + return name; } } - public string MethodName + /// + /// Headers to send at the beginning of the call. + /// + public Metadata Headers { get { - return this.methodName; + return headers; } } - public Func RequestSerializer + public Marshaller RequestMarshaller { get { - return this.requestSerializer; + return requestMarshaller; } } - public Func ResponseDeserializer + public Marshaller ResponseMarshaller { get { - return this.responseDeserializer; + return responseMarshaller; } } } diff --git a/src/csharp/Grpc.Core/Calls.cs b/src/csharp/Grpc.Core/Calls.cs index cc1d67afcae..280387b323b 100644 --- a/src/csharp/Grpc.Core/Calls.cs +++ b/src/csharp/Grpc.Core/Calls.cs @@ -45,30 +45,29 @@ namespace Grpc.Core { public static TResponse BlockingUnaryCall(Call call, TRequest req, CancellationToken token) { - var asyncCall = new AsyncCall(call.RequestSerializer, call.ResponseDeserializer); - return asyncCall.UnaryCall(call.Channel, call.MethodName, req); + var asyncCall = new AsyncCall(call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); + return asyncCall.UnaryCall(call.Channel, call.Name, req, call.Headers); } public static async Task AsyncUnaryCall(Call call, TRequest req, CancellationToken token) { - var asyncCall = new AsyncCall(call.RequestSerializer, call.ResponseDeserializer); - asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.MethodName); - return await asyncCall.UnaryCallAsync(req); + var asyncCall = new AsyncCall(call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); + asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.Name); + return await asyncCall.UnaryCallAsync(req, call.Headers); } public static void AsyncServerStreamingCall(Call call, TRequest req, IObserver outputs, CancellationToken token) { - var asyncCall = new AsyncCall(call.RequestSerializer, call.ResponseDeserializer); - - asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.MethodName); - asyncCall.StartServerStreamingCall(req, outputs); + var asyncCall = new AsyncCall(call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); + asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.Name); + asyncCall.StartServerStreamingCall(req, outputs, call.Headers); } public static ClientStreamingAsyncResult AsyncClientStreamingCall(Call call, CancellationToken token) { - var asyncCall = new AsyncCall(call.RequestSerializer, call.ResponseDeserializer); - asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.MethodName); - var task = asyncCall.ClientStreamingCallAsync(); + var asyncCall = new AsyncCall(call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); + asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.Name); + var task = asyncCall.ClientStreamingCallAsync(call.Headers); var inputs = new ClientStreamingInputObserver(asyncCall); return new ClientStreamingAsyncResult(task, inputs); } @@ -80,10 +79,9 @@ namespace Grpc.Core public static IObserver DuplexStreamingCall(Call call, IObserver outputs, CancellationToken token) { - var asyncCall = new AsyncCall(call.RequestSerializer, call.ResponseDeserializer); - asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.MethodName); - - asyncCall.StartDuplexStreamingCall(outputs); + var asyncCall = new AsyncCall(call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); + asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.Name); + asyncCall.StartDuplexStreamingCall(outputs, call.Headers); return new ClientStreamingInputObserver(asyncCall); } diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj index 29f1a0604a2..78ba32b2776 100644 --- a/src/csharp/Grpc.Core/Grpc.Core.csproj +++ b/src/csharp/Grpc.Core/Grpc.Core.csproj @@ -79,6 +79,10 @@ + + + + @@ -96,4 +100,7 @@ + + + \ No newline at end of file diff --git a/src/csharp/Grpc.Core/Internal/AsyncCall.cs b/src/csharp/Grpc.Core/Internal/AsyncCall.cs index 04fc28d988a..bc72cb78de3 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCall.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCall.cs @@ -77,7 +77,7 @@ namespace Grpc.Core.Internal /// /// Blocking unary request - unary response call. /// - public TResponse UnaryCall(Channel channel, string methodName, TRequest msg) + public TResponse UnaryCall(Channel channel, string methodName, TRequest msg, Metadata headers) { using (CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.Create()) { @@ -92,7 +92,11 @@ namespace Grpc.Core.Internal halfcloseRequested = true; readingDone = true; } - call.BlockingUnary(cq, payload, unaryResponseHandler); + + using (var metadataArray = MetadataArraySafeHandle.Create(headers)) + { + call.BlockingUnary(cq, payload, unaryResponseHandler, metadataArray); + } try { @@ -109,7 +113,7 @@ namespace Grpc.Core.Internal /// /// Starts a unary request - unary response call. /// - public Task UnaryCallAsync(TRequest msg) + public Task UnaryCallAsync(TRequest msg, Metadata headers) { lock (myLock) { @@ -122,8 +126,10 @@ namespace Grpc.Core.Internal byte[] payload = UnsafeSerialize(msg); unaryResponseTcs = new TaskCompletionSource(); - call.StartUnary(payload, unaryResponseHandler); - + using (var metadataArray = MetadataArraySafeHandle.Create(headers)) + { + call.StartUnary(payload, unaryResponseHandler, metadataArray); + } return unaryResponseTcs.Task; } } @@ -132,7 +138,7 @@ namespace Grpc.Core.Internal /// Starts a streamed request - unary response call. /// Use StartSendMessage and StartSendCloseFromClient to stream requests. /// - public Task ClientStreamingCallAsync() + public Task ClientStreamingCallAsync(Metadata headers) { lock (myLock) { @@ -142,7 +148,10 @@ namespace Grpc.Core.Internal readingDone = true; unaryResponseTcs = new TaskCompletionSource(); - call.StartClientStreaming(unaryResponseHandler); + using (var metadataArray = MetadataArraySafeHandle.Create(headers)) + { + call.StartClientStreaming(unaryResponseHandler, metadataArray); + } return unaryResponseTcs.Task; } @@ -151,7 +160,7 @@ namespace Grpc.Core.Internal /// /// Starts a unary request - streamed response call. /// - public void StartServerStreamingCall(TRequest msg, IObserver readObserver) + public void StartServerStreamingCall(TRequest msg, IObserver readObserver, Metadata headers) { lock (myLock) { @@ -165,7 +174,10 @@ namespace Grpc.Core.Internal byte[] payload = UnsafeSerialize(msg); - call.StartServerStreaming(payload, finishedHandler); + using (var metadataArray = MetadataArraySafeHandle.Create(headers)) + { + call.StartServerStreaming(payload, finishedHandler, metadataArray); + } StartReceiveMessage(); } @@ -175,7 +187,7 @@ namespace Grpc.Core.Internal /// Starts a streaming request - streaming response call. /// Use StartSendMessage and StartSendCloseFromClient to stream requests. /// - public void StartDuplexStreamingCall(IObserver readObserver) + public void StartDuplexStreamingCall(IObserver readObserver, Metadata headers) { lock (myLock) { @@ -185,7 +197,10 @@ namespace Grpc.Core.Internal this.readObserver = readObserver; - call.StartDuplexStreaming(finishedHandler); + using (var metadataArray = MetadataArraySafeHandle.Create(headers)) + { + call.StartDuplexStreaming(finishedHandler, metadataArray); + } StartReceiveMessage(); } diff --git a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs index a8cef4a68b1..14add60c728 100644 --- a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs @@ -57,25 +57,28 @@ namespace Grpc.Core.Internal [DllImport("grpc_csharp_ext.dll")] static extern GRPCCallError grpcsharp_call_start_unary(CallSafeHandle call, [MarshalAs(UnmanagedType.FunctionPtr)] CompletionCallbackDelegate callback, - byte[] send_buffer, UIntPtr send_buffer_len); + byte[] send_buffer, UIntPtr send_buffer_len, MetadataArraySafeHandle metadataArray); [DllImport("grpc_csharp_ext.dll")] static extern void grpcsharp_call_blocking_unary(CallSafeHandle call, CompletionQueueSafeHandle dedicatedCq, [MarshalAs(UnmanagedType.FunctionPtr)] CompletionCallbackDelegate callback, - byte[] send_buffer, UIntPtr send_buffer_len); + byte[] send_buffer, UIntPtr send_buffer_len, MetadataArraySafeHandle metadataArray); [DllImport("grpc_csharp_ext.dll")] static extern GRPCCallError grpcsharp_call_start_client_streaming(CallSafeHandle call, - [MarshalAs(UnmanagedType.FunctionPtr)] CompletionCallbackDelegate callback); + [MarshalAs(UnmanagedType.FunctionPtr)] CompletionCallbackDelegate callback, + MetadataArraySafeHandle metadataArray); [DllImport("grpc_csharp_ext.dll")] static extern GRPCCallError grpcsharp_call_start_server_streaming(CallSafeHandle call, [MarshalAs(UnmanagedType.FunctionPtr)] CompletionCallbackDelegate callback, - byte[] send_buffer, UIntPtr send_buffer_len); + byte[] send_buffer, UIntPtr send_buffer_len, + MetadataArraySafeHandle metadataArray); [DllImport("grpc_csharp_ext.dll")] static extern GRPCCallError grpcsharp_call_start_duplex_streaming(CallSafeHandle call, - [MarshalAs(UnmanagedType.FunctionPtr)] CompletionCallbackDelegate callback); + [MarshalAs(UnmanagedType.FunctionPtr)] CompletionCallbackDelegate callback, + MetadataArraySafeHandle metadataArray); [DllImport("grpc_csharp_ext.dll")] static extern GRPCCallError grpcsharp_call_send_message(CallSafeHandle call, @@ -109,29 +112,29 @@ namespace Grpc.Core.Internal return grpcsharp_channel_create_call(channel, cq, method, host, deadline); } - public void StartUnary(byte[] payload, CompletionCallbackDelegate callback) + public void StartUnary(byte[] payload, CompletionCallbackDelegate callback, MetadataArraySafeHandle metadataArray) { - AssertCallOk(grpcsharp_call_start_unary(this, callback, payload, new UIntPtr((ulong)payload.Length))); + AssertCallOk(grpcsharp_call_start_unary(this, callback, payload, new UIntPtr((ulong)payload.Length), metadataArray)); } - public void BlockingUnary(CompletionQueueSafeHandle dedicatedCq, byte[] payload, CompletionCallbackDelegate callback) + public void BlockingUnary(CompletionQueueSafeHandle dedicatedCq, byte[] payload, CompletionCallbackDelegate callback, MetadataArraySafeHandle metadataArray) { - grpcsharp_call_blocking_unary(this, dedicatedCq, callback, payload, new UIntPtr((ulong)payload.Length)); + grpcsharp_call_blocking_unary(this, dedicatedCq, callback, payload, new UIntPtr((ulong)payload.Length), metadataArray); } - public void StartClientStreaming(CompletionCallbackDelegate callback) + public void StartClientStreaming(CompletionCallbackDelegate callback, MetadataArraySafeHandle metadataArray) { - AssertCallOk(grpcsharp_call_start_client_streaming(this, callback)); + AssertCallOk(grpcsharp_call_start_client_streaming(this, callback, metadataArray)); } - public void StartServerStreaming(byte[] payload, CompletionCallbackDelegate callback) + public void StartServerStreaming(byte[] payload, CompletionCallbackDelegate callback, MetadataArraySafeHandle metadataArray) { - AssertCallOk(grpcsharp_call_start_server_streaming(this, callback, payload, new UIntPtr((ulong)payload.Length))); + AssertCallOk(grpcsharp_call_start_server_streaming(this, callback, payload, new UIntPtr((ulong)payload.Length), metadataArray)); } - public void StartDuplexStreaming(CompletionCallbackDelegate callback) + public void StartDuplexStreaming(CompletionCallbackDelegate callback, MetadataArraySafeHandle metadataArray) { - AssertCallOk(grpcsharp_call_start_duplex_streaming(this, callback)); + AssertCallOk(grpcsharp_call_start_duplex_streaming(this, callback, metadataArray)); } public void StartSendMessage(byte[] payload, CompletionCallbackDelegate callback) diff --git a/src/csharp/Grpc.Core/Internal/MetadataArraySafeHandle.cs b/src/csharp/Grpc.Core/Internal/MetadataArraySafeHandle.cs new file mode 100644 index 00000000000..c9c4d954c91 --- /dev/null +++ b/src/csharp/Grpc.Core/Internal/MetadataArraySafeHandle.cs @@ -0,0 +1,72 @@ +#region Copyright notice and license +// 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. +#endregion +using System; +using System.Runtime.InteropServices; +using System.Threading.Tasks; + +namespace Grpc.Core.Internal +{ + /// + /// grpc_metadata_array from + /// + internal class MetadataArraySafeHandle : SafeHandleZeroIsInvalid + { + [DllImport("grpc_csharp_ext.dll")] + static extern MetadataArraySafeHandle grpcsharp_metadata_array_create(UIntPtr capacity); + + [DllImport("grpc_csharp_ext.dll", CharSet = CharSet.Ansi)] + static extern void grpcsharp_metadata_array_add(MetadataArraySafeHandle array, string key, byte[] value, UIntPtr valueLength); + + [DllImport("grpc_csharp_ext.dll")] + static extern void grpcsharp_metadata_array_destroy_full(IntPtr array); + + private MetadataArraySafeHandle() + { + } + + public static MetadataArraySafeHandle Create(Metadata metadata) + { + var entries = metadata.Entries; + var metadataArray = grpcsharp_metadata_array_create(new UIntPtr((ulong)entries.Count)); + for (int i = 0; i < entries.Count; i++) + { + grpcsharp_metadata_array_add(metadataArray, entries[i].Key, entries[i].ValueBytes, new UIntPtr((ulong)entries[i].ValueBytes.Length)); + } + return metadataArray; + } + + protected override bool ReleaseHandle() + { + grpcsharp_metadata_array_destroy_full(handle); + return true; + } + } +} diff --git a/src/csharp/Grpc.Core/Marshaller.cs b/src/csharp/Grpc.Core/Marshaller.cs index e73e7b762ef..8b1a9290741 100644 --- a/src/csharp/Grpc.Core/Marshaller.cs +++ b/src/csharp/Grpc.Core/Marshaller.cs @@ -32,6 +32,7 @@ #endregion using System; +using Grpc.Core.Utils; namespace Grpc.Core { @@ -45,8 +46,8 @@ namespace Grpc.Core public Marshaller(Func serializer, Func deserializer) { - this.serializer = serializer; - this.deserializer = deserializer; + this.serializer = Preconditions.CheckNotNull(serializer); + this.deserializer = Preconditions.CheckNotNull(deserializer); } public Func Serializer diff --git a/src/csharp/Grpc.Core/Metadata.cs b/src/csharp/Grpc.Core/Metadata.cs new file mode 100644 index 00000000000..eccec26a616 --- /dev/null +++ b/src/csharp/Grpc.Core/Metadata.cs @@ -0,0 +1,126 @@ +#region Copyright notice and license +// 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. +#endregion + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Runtime.InteropServices; +using System.Text; + +namespace Grpc.Core +{ + /// + /// gRPC call metadata. + /// + public class Metadata + { + public static readonly Metadata Empty = new Metadata(ImmutableList.Empty); + + readonly ImmutableList entries; + + public Metadata(ImmutableList entries) + { + this.entries = entries; + } + + public ImmutableList Entries + { + get + { + return this.entries; + } + } + + public static Builder CreateBuilder() + { + return new Builder(); + } + + public struct MetadataEntry + { + readonly string key; + readonly byte[] valueBytes; + + public MetadataEntry(string key, byte[] valueBytes) + { + this.key = key; + this.valueBytes = valueBytes; + } + + public MetadataEntry(string key, string value) + { + this.key = key; + this.valueBytes = Encoding.ASCII.GetBytes(value); + } + + public string Key + { + get + { + return this.key; + } + } + + // TODO: using ByteString would guarantee immutability. + public byte[] ValueBytes + { + get + { + return this.valueBytes; + } + } + } + + public class Builder + { + readonly List entries = new List(); + + public List Entries + { + get + { + return entries; + } + } + + public Builder Add(MetadataEntry entry) + { + entries.Add(entry); + return this; + } + + public Metadata Build() + { + return new Metadata(entries.ToImmutableList()); + } + } + } +} diff --git a/src/csharp/Grpc.Core/ServerServiceDefinition.cs b/src/csharp/Grpc.Core/ServerServiceDefinition.cs index 004415477ca..f08c7d88f3f 100644 --- a/src/csharp/Grpc.Core/ServerServiceDefinition.cs +++ b/src/csharp/Grpc.Core/ServerServiceDefinition.cs @@ -43,12 +43,10 @@ namespace Grpc.Core /// public class ServerServiceDefinition { - readonly string serviceName; readonly ImmutableDictionary callHandlers; - private ServerServiceDefinition(string serviceName, ImmutableDictionary callHandlers) + private ServerServiceDefinition(ImmutableDictionary callHandlers) { - this.serviceName = serviceName; this.callHandlers = callHandlers; } @@ -79,7 +77,7 @@ namespace Grpc.Core Method method, UnaryRequestServerMethod handler) { - callHandlers.Add(method.Name, ServerCalls.UnaryRequestCall(method, handler)); + callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.UnaryRequestCall(method, handler)); return this; } @@ -87,13 +85,18 @@ namespace Grpc.Core Method method, StreamingRequestServerMethod handler) { - callHandlers.Add(method.Name, ServerCalls.StreamingRequestCall(method, handler)); + callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.StreamingRequestCall(method, handler)); return this; } public ServerServiceDefinition Build() { - return new ServerServiceDefinition(serviceName, callHandlers.ToImmutableDictionary()); + return new ServerServiceDefinition(callHandlers.ToImmutableDictionary()); + } + + private string GetFullMethodName(string serviceName, string methodName) + { + return serviceName + "/" + methodName; } } } diff --git a/src/csharp/Grpc.Core/Stub/AbstractStub.cs b/src/csharp/Grpc.Core/Stub/AbstractStub.cs new file mode 100644 index 00000000000..cf5ab958c5b --- /dev/null +++ b/src/csharp/Grpc.Core/Stub/AbstractStub.cs @@ -0,0 +1,73 @@ +#region Copyright notice and license + +// 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. + +#endregion + +using System; +using Grpc.Core.Internal; + +namespace Grpc.Core +{ + // TODO: support adding timeout to methods. + /// + /// Base for client-side stubs. + /// + public abstract class AbstractStub + where TConfig : StubConfiguration + { + readonly Channel channel; + readonly TConfig config; + + public AbstractStub(Channel channel, TConfig config) + { + this.channel = channel; + this.config = config; + } + + public Channel Channel + { + get + { + return this.channel; + } + } + + /// + /// Creates a new call to given method. + /// + protected Call CreateCall(string serviceName, Method method) + { + var headerBuilder = Metadata.CreateBuilder(); + config.HeaderInterceptor(headerBuilder); + return new Call(serviceName, method, channel, headerBuilder.Build()); + } + } +} diff --git a/src/csharp/Grpc.Core/Stub/StubConfiguration.cs b/src/csharp/Grpc.Core/Stub/StubConfiguration.cs new file mode 100644 index 00000000000..5bcb5b40d2d --- /dev/null +++ b/src/csharp/Grpc.Core/Stub/StubConfiguration.cs @@ -0,0 +1,64 @@ +#region Copyright notice and license + +// 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. + +#endregion + +using System; +using Grpc.Core.Internal; +using Grpc.Core.Utils; + +namespace Grpc.Core +{ + public delegate void HeaderInterceptorDelegate(Metadata.Builder headerBuilder); + + public class StubConfiguration + { + /// + /// The default stub configuration. + /// + public static readonly StubConfiguration Default = new StubConfiguration((headerBuilder) => { }); + + readonly HeaderInterceptorDelegate headerInterceptor; + + public StubConfiguration(HeaderInterceptorDelegate headerInterceptor) + { + this.headerInterceptor = Preconditions.CheckNotNull(headerInterceptor); + } + + public HeaderInterceptorDelegate HeaderInterceptor + { + get + { + return headerInterceptor; + } + } + } +} diff --git a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs index c86da65af47..32a523f2135 100644 --- a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs +++ b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs @@ -61,7 +61,14 @@ namespace math.Tests int port = server.AddPort(host + ":0"); server.Start(); channel = new Channel(host + ":" + port); - client = MathGrpc.NewStub(channel); + + // TODO: get rid of the custom header here once we have dedicated tests + // for header support. + var stubConfig = new StubConfiguration((headerBuilder) => + { + headerBuilder.Add(new Metadata.MetadataEntry("customHeader", "abcdef")); + }); + client = MathGrpc.NewStub(channel, stubConfig); } [TestFixtureTearDown] diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 33a9ca92876..24e6a1de8e3 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -45,6 +45,8 @@ namespace math /// public class MathGrpc { + static readonly string ServiceName = "/math.Math"; + static readonly Marshaller DivArgsMarshaller = Marshallers.Create((arg) => arg.ToByteArray(), DivArgs.ParseFrom); static readonly Marshaller DivReplyMarshaller = Marshallers.Create((arg) => arg.ToByteArray(), DivReply.ParseFrom); static readonly Marshaller NumMarshaller = Marshallers.Create((arg) => arg.ToByteArray(), Num.ParseFrom); @@ -52,25 +54,25 @@ namespace math static readonly Method DivMethod = new Method( MethodType.Unary, - "/math.Math/Div", + "Div", DivArgsMarshaller, DivReplyMarshaller); static readonly Method FibMethod = new Method( MethodType.ServerStreaming, - "/math.Math/Fib", + "Fib", FibArgsMarshaller, NumMarshaller); static readonly Method SumMethod = new Method( MethodType.ClientStreaming, - "/math.Math/Sum", + "Sum", NumMarshaller, NumMarshaller); static readonly Method DivManyMethod = new Method( MethodType.DuplexStreaming, - "/math.Math/DivMany", + "DivMany", DivArgsMarshaller, DivReplyMarshaller); @@ -87,42 +89,43 @@ namespace math IObserver DivMany(IObserver responseObserver, CancellationToken token = default(CancellationToken)); } - public class MathServiceClientStub : IMathServiceClient + public class MathServiceClientStub : AbstractStub, IMathServiceClient { - readonly Channel channel; + public MathServiceClientStub(Channel channel) : this(channel, StubConfiguration.Default) + { + } - public MathServiceClientStub(Channel channel) + public MathServiceClientStub(Channel channel, StubConfiguration config) : base(channel, config) { - this.channel = channel; } public DivReply Div(DivArgs request, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(DivMethod, channel); + var call = CreateCall(ServiceName, DivMethod); return Calls.BlockingUnaryCall(call, request, token); } public Task DivAsync(DivArgs request, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(DivMethod, channel); + var call = CreateCall(ServiceName, DivMethod); return Calls.AsyncUnaryCall(call, request, token); } public void Fib(FibArgs request, IObserver responseObserver, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(FibMethod, channel); + var call = CreateCall(ServiceName, FibMethod); Calls.AsyncServerStreamingCall(call, request, responseObserver, token); } public ClientStreamingAsyncResult Sum(CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(SumMethod, channel); + var call = CreateCall(ServiceName, SumMethod); return Calls.AsyncClientStreamingCall(call, token); } public IObserver DivMany(IObserver responseObserver, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(DivManyMethod, channel); + var call = CreateCall(ServiceName, DivManyMethod); return Calls.DuplexStreamingCall(call, responseObserver, token); } } @@ -141,7 +144,7 @@ namespace math public static ServerServiceDefinition BindService(IMathService serviceImpl) { - return ServerServiceDefinition.CreateBuilder("/math.Math/") + return ServerServiceDefinition.CreateBuilder(ServiceName) .AddMethod(DivMethod, serviceImpl.Div) .AddMethod(FibMethod, serviceImpl.Fib) .AddMethod(SumMethod, serviceImpl.Sum) @@ -152,5 +155,10 @@ namespace math { return new MathServiceClientStub(channel); } + + public static IMathServiceClient NewStub(Channel channel, StubConfiguration config) + { + return new MathServiceClientStub(channel, config); + } } } diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index cfb258711ad..c3e5f03074a 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -39,8 +39,7 @@ ..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll - - False + ..\packages\System.Collections.Immutable.1.1.34-rc\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll diff --git a/src/csharp/Grpc.IntegrationTesting/TestServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestServiceGrpc.cs index 9b0251c3ca9..f63e0361a45 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestServiceGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestServiceGrpc.cs @@ -44,6 +44,8 @@ namespace grpc.testing /// public class TestServiceGrpc { + static readonly string ServiceName = "/grpc.testing.TestService"; + static readonly Marshaller EmptyMarshaller = Marshallers.Create((arg) => arg.ToByteArray(), Empty.ParseFrom); static readonly Marshaller SimpleRequestMarshaller = Marshallers.Create((arg) => arg.ToByteArray(), SimpleRequest.ParseFrom); static readonly Marshaller SimpleResponseMarshaller = Marshallers.Create((arg) => arg.ToByteArray(), SimpleResponse.ParseFrom); @@ -54,37 +56,37 @@ namespace grpc.testing static readonly Method EmptyCallMethod = new Method( MethodType.Unary, - "/grpc.testing.TestService/EmptyCall", + "EmptyCall", EmptyMarshaller, EmptyMarshaller); static readonly Method UnaryCallMethod = new Method( MethodType.Unary, - "/grpc.testing.TestService/UnaryCall", + "UnaryCall", SimpleRequestMarshaller, SimpleResponseMarshaller); static readonly Method StreamingOutputCallMethod = new Method( MethodType.ServerStreaming, - "/grpc.testing.TestService/StreamingOutputCall", + "StreamingOutputCall", StreamingOutputCallRequestMarshaller, StreamingOutputCallResponseMarshaller); static readonly Method StreamingInputCallMethod = new Method( MethodType.ClientStreaming, - "/grpc.testing.TestService/StreamingInputCall", + "StreamingInputCall", StreamingInputCallRequestMarshaller, StreamingInputCallResponseMarshaller); static readonly Method FullDuplexCallMethod = new Method( MethodType.DuplexStreaming, - "/grpc.testing.TestService/FullDuplexCall", + "FullDuplexCall", StreamingOutputCallRequestMarshaller, StreamingOutputCallResponseMarshaller); static readonly Method HalfDuplexCallMethod = new Method( MethodType.DuplexStreaming, - "/grpc.testing.TestService/HalfDuplexCall", + "HalfDuplexCall", StreamingOutputCallRequestMarshaller, StreamingOutputCallResponseMarshaller); @@ -107,60 +109,61 @@ namespace grpc.testing IObserver HalfDuplexCall(IObserver responseObserver, CancellationToken token = default(CancellationToken)); } - public class TestServiceClientStub : ITestServiceClient + public class TestServiceClientStub : AbstractStub, ITestServiceClient { - readonly Channel channel; + public TestServiceClientStub(Channel channel) : base(channel, StubConfiguration.Default) + { + } - public TestServiceClientStub(Channel channel) + public TestServiceClientStub(Channel channel, StubConfiguration config) : base(channel, config) { - this.channel = channel; } public Empty EmptyCall(Empty request, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(EmptyCallMethod, channel); + var call = CreateCall(ServiceName, EmptyCallMethod); return Calls.BlockingUnaryCall(call, request, token); } public Task EmptyCallAsync(Empty request, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(EmptyCallMethod, channel); + var call = CreateCall(ServiceName, EmptyCallMethod); return Calls.AsyncUnaryCall(call, request, token); } public SimpleResponse UnaryCall(SimpleRequest request, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(UnaryCallMethod, channel); + var call = CreateCall(ServiceName, UnaryCallMethod); return Calls.BlockingUnaryCall(call, request, token); } public Task UnaryCallAsync(SimpleRequest request, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(UnaryCallMethod, channel); + var call = CreateCall(ServiceName, UnaryCallMethod); return Calls.AsyncUnaryCall(call, request, token); } public void StreamingOutputCall(StreamingOutputCallRequest request, IObserver responseObserver, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(StreamingOutputCallMethod, channel); + var call = CreateCall(ServiceName, StreamingOutputCallMethod); Calls.AsyncServerStreamingCall(call, request, responseObserver, token); } public ClientStreamingAsyncResult StreamingInputCall(CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(StreamingInputCallMethod, channel); + var call = CreateCall(ServiceName, StreamingInputCallMethod); return Calls.AsyncClientStreamingCall(call, token); } public IObserver FullDuplexCall(IObserver responseObserver, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(FullDuplexCallMethod, channel); + var call = CreateCall(ServiceName, FullDuplexCallMethod); return Calls.DuplexStreamingCall(call, responseObserver, token); } public IObserver HalfDuplexCall(IObserver responseObserver, CancellationToken token = default(CancellationToken)) { - var call = new Grpc.Core.Call(HalfDuplexCallMethod, channel); + var call = CreateCall(ServiceName, HalfDuplexCallMethod); return Calls.DuplexStreamingCall(call, responseObserver, token); } } @@ -183,7 +186,7 @@ namespace grpc.testing public static ServerServiceDefinition BindService(ITestService serviceImpl) { - return ServerServiceDefinition.CreateBuilder("/grpc.testing.TestService/") + return ServerServiceDefinition.CreateBuilder(ServiceName) .AddMethod(EmptyCallMethod, serviceImpl.EmptyCall) .AddMethod(UnaryCallMethod, serviceImpl.UnaryCall) .AddMethod(StreamingOutputCallMethod, serviceImpl.StreamingOutputCall) diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c index 51abb632f7a..9a1c908d11b 100644 --- a/src/csharp/ext/grpc_csharp_ext.c +++ b/src/csharp/ext/grpc_csharp_ext.c @@ -102,34 +102,114 @@ grpcsharp_batch_context *grpcsharp_batch_context_create() { return ctx; } -/** - * Destroys metadata array including keys and values. +/* + * Destroys array->metadata. + * The array pointer itself is not freed. + */ +void grpcsharp_metadata_array_destroy_metadata_only( + grpc_metadata_array *array) { + gpr_free(array->metadata); +} + +/* + * Destroys keys, values and array->metadata. + * The array pointer itself is not freed. + */ +void grpcsharp_metadata_array_destroy_metadata_including_entries( + grpc_metadata_array *array) { + size_t i; + if (array->metadata) { + for (i = 0; i < array->count; i++) { + gpr_free((void *)array->metadata[i].key); + gpr_free((void *)array->metadata[i].value); + } + } + gpr_free(array->metadata); +} + +/* + * Fully destroys the metadata array. + */ +GPR_EXPORT void GPR_CALLTYPE +grpcsharp_metadata_array_destroy_full(grpc_metadata_array *array) { + if (!array) { + return; + } + grpcsharp_metadata_array_destroy_metadata_including_entries(array); + gpr_free(array); +} + +/* + * Creates an empty metadata array with given capacity. + * Array can later be destroyed by grpc_metadata_array_destroy_full. */ -void grpcsharp_metadata_array_destroy_recursive(grpc_metadata_array *array) { - if (!array->metadata) { +GPR_EXPORT grpc_metadata_array *GPR_CALLTYPE +grpcsharp_metadata_array_create(size_t capacity) { + grpc_metadata_array *array = + (grpc_metadata_array *)gpr_malloc(sizeof(grpc_metadata_array)); + grpc_metadata_array_init(array); + array->capacity = capacity; + array->count = 0; + if (capacity > 0) { + array->metadata = + (grpc_metadata *)gpr_malloc(sizeof(grpc_metadata) * capacity); + memset(array->metadata, 0, sizeof(grpc_metadata) * capacity); + } else { + array->metadata = NULL; + } + return array; +} + +GPR_EXPORT void GPR_CALLTYPE +grpcsharp_metadata_array_add(grpc_metadata_array *array, const char *key, + const char *value, size_t value_length) { + size_t i = array->count; + GPR_ASSERT(array->count < array->capacity); + array->metadata[i].key = gpr_strdup(key); + array->metadata[i].value = (char *)gpr_malloc(value_length); + memcpy((void *)array->metadata[i].value, value, value_length); + array->metadata[i].value_length = value_length; + array->count++; +} + +/* Move contents of metadata array */ +void grpcsharp_metadata_array_move(grpc_metadata_array *dest, + grpc_metadata_array *src) { + if (!src) { + dest->capacity = 0; + dest->count = 0; + dest->metadata = NULL; return; } - /* TODO: destroy also keys and values */ - grpc_metadata_array_destroy(array); + + dest->capacity = src->capacity; + dest->count = src->count; + dest->metadata = src->metadata; + + src->capacity = 0; + src->count = 0; + src->metadata = NULL; } void grpcsharp_batch_context_destroy(grpcsharp_batch_context *ctx) { if (!ctx) { return; } - grpcsharp_metadata_array_destroy_recursive(&(ctx->send_initial_metadata)); + grpcsharp_metadata_array_destroy_metadata_including_entries( + &(ctx->send_initial_metadata)); grpc_byte_buffer_destroy(ctx->send_message); - grpcsharp_metadata_array_destroy_recursive( + grpcsharp_metadata_array_destroy_metadata_including_entries( &(ctx->send_status_from_server.trailing_metadata)); gpr_free(ctx->send_status_from_server.status_details); - grpc_metadata_array_destroy(&(ctx->recv_initial_metadata)); + grpcsharp_metadata_array_destroy_metadata_only(&(ctx->recv_initial_metadata)); grpc_byte_buffer_destroy(ctx->recv_message); - grpc_metadata_array_destroy(&(ctx->recv_status_on_client.trailing_metadata)); + grpcsharp_metadata_array_destroy_metadata_only( + &(ctx->recv_status_on_client.trailing_metadata)); gpr_free((void *)ctx->recv_status_on_client.status_details); /* NOTE: ctx->server_rpc_new.call is not destroyed because callback handler is @@ -137,7 +217,8 @@ void grpcsharp_batch_context_destroy(grpcsharp_batch_context *ctx) { to take its ownership. */ grpc_call_details_destroy(&(ctx->server_rpc_new.call_details)); - grpc_metadata_array_destroy(&(ctx->server_rpc_new.request_metadata)); + grpcsharp_metadata_array_destroy_metadata_only( + &(ctx->server_rpc_new.request_metadata)); gpr_free(ctx); } @@ -346,17 +427,19 @@ grpcsharp_call_start_write_from_copied_buffer(grpc_call *call, GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_unary(grpc_call *call, callback_funcptr callback, - const char *send_buffer, size_t send_buffer_len) { + const char *send_buffer, size_t send_buffer_len, + grpc_metadata_array *initial_metadata) { /* TODO: don't use magic number */ grpc_op ops[6]; grpcsharp_batch_context *ctx = grpcsharp_batch_context_create(); ctx->callback = callback; - /* TODO: implement sending the metadata... */ ops[0].op = GRPC_OP_SEND_INITIAL_METADATA; - /* ctx->send_initial_metadata is already zeroed out. */ - ops[0].data.send_initial_metadata.count = 0; - ops[0].data.send_initial_metadata.metadata = NULL; + grpcsharp_metadata_array_move(&(ctx->send_initial_metadata), + initial_metadata); + ops[0].data.send_initial_metadata.count = ctx->send_initial_metadata.count; + ops[0].data.send_initial_metadata.metadata = + ctx->send_initial_metadata.metadata; ops[1].op = GRPC_OP_SEND_MESSAGE; ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len); @@ -389,9 +472,11 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_call_blocking_unary(grpc_call *call, grpc_completion_queue *dedicated_cq, callback_funcptr callback, - const char *send_buffer, size_t send_buffer_len) { + const char *send_buffer, size_t send_buffer_len, + grpc_metadata_array *initial_metadata) { GPR_ASSERT(grpcsharp_call_start_unary(call, callback, send_buffer, - send_buffer_len) == GRPC_CALL_OK); + send_buffer_len, + initial_metadata) == GRPC_CALL_OK); /* TODO: we would like to use pluck, but we don't know the tag */ GPR_ASSERT(grpcsharp_completion_queue_next_with_callback(dedicated_cq) == @@ -403,17 +488,19 @@ grpcsharp_call_blocking_unary(grpc_call *call, GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_client_streaming(grpc_call *call, - callback_funcptr callback) { + callback_funcptr callback, + grpc_metadata_array *initial_metadata) { /* TODO: don't use magic number */ grpc_op ops[4]; grpcsharp_batch_context *ctx = grpcsharp_batch_context_create(); ctx->callback = callback; - /* TODO: implement sending the metadata... */ ops[0].op = GRPC_OP_SEND_INITIAL_METADATA; - /* ctx->send_initial_metadata is already zeroed out. */ - ops[0].data.send_initial_metadata.count = 0; - ops[0].data.send_initial_metadata.metadata = NULL; + grpcsharp_metadata_array_move(&(ctx->send_initial_metadata), + initial_metadata); + ops[0].data.send_initial_metadata.count = ctx->send_initial_metadata.count; + ops[0].data.send_initial_metadata.metadata = + ctx->send_initial_metadata.metadata; ops[1].op = GRPC_OP_RECV_INITIAL_METADATA; ops[1].data.recv_initial_metadata = &(ctx->recv_initial_metadata); @@ -435,21 +522,20 @@ grpcsharp_call_start_client_streaming(grpc_call *call, return grpc_call_start_batch(call, ops, sizeof(ops) / sizeof(ops[0]), ctx); } -GPR_EXPORT grpc_call_error GPR_CALLTYPE -grpcsharp_call_start_server_streaming(grpc_call *call, - callback_funcptr callback, - const char *send_buffer, - size_t send_buffer_len) { +GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_server_streaming( + grpc_call *call, callback_funcptr callback, const char *send_buffer, + size_t send_buffer_len, grpc_metadata_array *initial_metadata) { /* TODO: don't use magic number */ grpc_op ops[5]; grpcsharp_batch_context *ctx = grpcsharp_batch_context_create(); ctx->callback = callback; - /* TODO: implement sending the metadata... */ ops[0].op = GRPC_OP_SEND_INITIAL_METADATA; - /* ctx->send_initial_metadata is already zeroed out. */ - ops[0].data.send_initial_metadata.count = 0; - ops[0].data.send_initial_metadata.metadata = NULL; + grpcsharp_metadata_array_move(&(ctx->send_initial_metadata), + initial_metadata); + ops[0].data.send_initial_metadata.count = ctx->send_initial_metadata.count; + ops[0].data.send_initial_metadata.metadata = + ctx->send_initial_metadata.metadata; ops[1].op = GRPC_OP_SEND_MESSAGE; ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len); @@ -476,17 +562,19 @@ grpcsharp_call_start_server_streaming(grpc_call *call, GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_duplex_streaming(grpc_call *call, - callback_funcptr callback) { + callback_funcptr callback, + grpc_metadata_array *initial_metadata) { /* TODO: don't use magic number */ grpc_op ops[3]; grpcsharp_batch_context *ctx = grpcsharp_batch_context_create(); ctx->callback = callback; - /* TODO: implement sending the metadata... */ ops[0].op = GRPC_OP_SEND_INITIAL_METADATA; - /* ctx->send_initial_metadata is already zeroed out. */ - ops[0].data.send_initial_metadata.count = 0; - ops[0].data.send_initial_metadata.metadata = NULL; + grpcsharp_metadata_array_move(&(ctx->send_initial_metadata), + initial_metadata); + ops[0].data.send_initial_metadata.count = ctx->send_initial_metadata.count; + ops[0].data.send_initial_metadata.metadata = + ctx->send_initial_metadata.metadata; ops[1].op = GRPC_OP_RECV_INITIAL_METADATA; ops[1].data.recv_initial_metadata = &(ctx->recv_initial_metadata); From 2493ea6d4b300a952d0a6fe120d61760814490d1 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 16 Mar 2015 14:53:19 -0700 Subject: [PATCH 37/75] Fixed argument types in setup.py --- src/python/src/setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/src/setup.py b/src/python/src/setup.py index a513a2811bd..7d93aa7ded0 100644 --- a/src/python/src/setup.py +++ b/src/python/src/setup.py @@ -54,8 +54,8 @@ _EXTENSION_LIBRARIES = ( _EXTENSION_MODULE = _core.Extension( 'grpc._adapter._c', sources=list(_EXTENSION_SOURCES), - include_dirs=_EXTENSION_INCLUDE_DIRECTORIES, - libraries=_EXTENSION_LIBRARIES, + include_dirs=list(_EXTENSION_INCLUDE_DIRECTORIES), + libraries=list(_EXTENSION_LIBRARIES), ) _PACKAGES = ( @@ -82,5 +82,5 @@ _PACKAGE_DIRECTORIES = { _core.setup( name='grpc-2015', version='0.4.0', - ext_modules=[_EXTENSION_MODULE], packages=_PACKAGES, + ext_modules=[_EXTENSION_MODULE], packages=list(_PACKAGES), package_dir=_PACKAGE_DIRECTORIES) From c4fada6e9acc5657869fea87a8c91b7442908f3c Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 13 Mar 2015 22:23:59 +0000 Subject: [PATCH 38/75] Add service name to Python early_adopter --- src/compiler/python_generator.cc | 27 ++++-- .../interop/interop/_insecure_interop_test.py | 5 +- .../interop/interop/_secure_interop_test.py | 6 +- src/python/interop/interop/client.py | 7 +- src/python/interop/interop/methods.py | 38 ++++----- src/python/interop/interop/server.py | 5 +- .../src/grpc/early_adopter/_face_utilities.py | 82 +++++++++++++------ .../src/grpc/early_adopter/_reexport.py | 5 ++ .../src/grpc/early_adopter/implementations.py | 59 ++++++------- .../early_adopter/implementations_test.py | 8 +- 10 files changed, 147 insertions(+), 95 deletions(-) diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index b5022d55c49..8136602ae5a 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -229,7 +229,8 @@ bool GetModuleAndMessagePath(const Descriptor* type, return true; } -bool PrintServerFactory(const ServiceDescriptor* service, Printer* out) { +bool PrintServerFactory(const std::string& package_qualified_service_name, + const ServiceDescriptor* service, Printer* out) { out->Print("def early_adopter_create_$Service$_server(servicer, port, " "root_certificates, key_chain_pairs):\n", "Service", service->name()); @@ -293,17 +294,18 @@ bool PrintServerFactory(const ServiceDescriptor* service, Printer* out) { out->Print("),\n"); } out->Print("}\n"); - // out->Print("return implementations.insecure_server(" - // "method_service_descriptions, port)\n"); out->Print( "return implementations.secure_server(" - "method_service_descriptions, port, root_certificates," - " key_chain_pairs)\n"); + "\"$PackageQualifiedServiceName$\"," + " method_service_descriptions, port, root_certificates," + " key_chain_pairs)\n", + "PackageQualifiedServiceName", package_qualified_service_name); } return true; } -bool PrintStubFactory(const ServiceDescriptor* service, Printer* out) { +bool PrintStubFactory(const std::string& package_qualified_service_name, + const ServiceDescriptor* service, Printer* out) { map dict = ListToDict({ "Service", service->name(), }); @@ -369,7 +371,9 @@ bool PrintStubFactory(const ServiceDescriptor* service, Printer* out) { out->Print("}\n"); out->Print( "return implementations.insecure_stub(" - "method_invocation_descriptions, host, port)\n"); + "\"$PackageQualifiedServiceName$\"," + " method_invocation_descriptions, host, port)\n", + "PackageQualifiedServiceName", package_qualified_service_name); } return true; } @@ -392,13 +396,18 @@ pair GetServices(const FileDescriptor* file) { if (!PrintPreamble(file, &out)) { return make_pair(false, ""); } + auto package = file->package(); + if (!package.empty()) { + package = package.append("."); + } for (int i = 0; i < file->service_count(); ++i) { auto service = file->service(i); + auto package_qualified_service_name = package + service->name(); if (!(PrintServicer(service, &out) && PrintServer(service, &out) && PrintStub(service, &out) && - PrintServerFactory(service, &out) && - PrintStubFactory(service, &out))) { + PrintServerFactory(package_qualified_service_name, service, &out) && + PrintStubFactory(package_qualified_service_name, service, &out))) { return make_pair(false, ""); } } diff --git a/src/python/interop/interop/_insecure_interop_test.py b/src/python/interop/interop/_insecure_interop_test.py index 1fa6b8b3f8f..e4ddff1a0b0 100644 --- a/src/python/interop/interop/_insecure_interop_test.py +++ b/src/python/interop/interop/_insecure_interop_test.py @@ -42,11 +42,12 @@ class InsecureInteropTest( unittest.TestCase): def setUp(self): - self.server = implementations.insecure_server(methods.SERVER_METHODS, 0) + self.server = implementations.insecure_server( + methods.SERVICE_NAME, methods.SERVER_METHODS, 0) self.server.start() port = self.server.port() self.stub = implementations.insecure_stub( - methods.CLIENT_METHODS, 'localhost', port) + methods.SERVICE_NAME, methods.CLIENT_METHODS, 'localhost', port) def tearDown(self): self.server.stop() diff --git a/src/python/interop/interop/_secure_interop_test.py b/src/python/interop/interop/_secure_interop_test.py index cc9e93821ad..214212dca4f 100644 --- a/src/python/interop/interop/_secure_interop_test.py +++ b/src/python/interop/interop/_secure_interop_test.py @@ -46,12 +46,12 @@ class SecureInteropTest( def setUp(self): self.server = implementations.secure_server( - methods.SERVER_METHODS, 0, resources.private_key(), - resources.certificate_chain()) + methods.SERVICE_NAME, methods.SERVER_METHODS, 0, + resources.private_key(), resources.certificate_chain()) self.server.start() port = self.server.port() self.stub = implementations.secure_stub( - methods.CLIENT_METHODS, 'localhost', port, + methods.SERVICE_NAME, methods.CLIENT_METHODS, 'localhost', port, resources.test_root_certificates(), None, None, server_host_override=_SERVER_HOST_OVERRIDE) diff --git a/src/python/interop/interop/client.py b/src/python/interop/interop/client.py index b674a64f9d8..fb7dfb57298 100644 --- a/src/python/interop/interop/client.py +++ b/src/python/interop/interop/client.py @@ -67,12 +67,13 @@ def _stub(args): root_certificates = resources.prod_root_certificates() stub = implementations.secure_stub( - methods.CLIENT_METHODS, args.server_host, args.server_port, - root_certificates, None, None, + methods.SERVICE_NAME, methods.CLIENT_METHODS, args.server_host, + args.server_port, root_certificates, None, None, server_host_override=args.server_host_override) else: stub = implementations.insecure_stub( - methods.CLIENT_METHODS, args.server_host, args.server_port) + methods.SERVICE_NAME, methods.CLIENT_METHODS, args.server_host, + args.server_port) return stub diff --git a/src/python/interop/interop/methods.py b/src/python/interop/interop/methods.py index 2e15fac9157..4f83ccc085b 100644 --- a/src/python/interop/interop/methods.py +++ b/src/python/interop/interop/methods.py @@ -122,31 +122,31 @@ _SERVER_HALF_DUPLEX_CALL = utilities.stream_stream_service_description( messages_pb2.StreamingOutputCallResponse.SerializeToString) -_SERVICE_NAME = '/grpc.testing.TestService' +SERVICE_NAME = 'grpc.testing.TestService' -EMPTY_CALL_METHOD_NAME = _SERVICE_NAME + '/EmptyCall' -UNARY_CALL_METHOD_NAME = _SERVICE_NAME + '/UnaryCall' -STREAMING_OUTPUT_CALL_METHOD_NAME = _SERVICE_NAME + '/StreamingOutputCall' -STREAMING_INPUT_CALL_METHOD_NAME = _SERVICE_NAME + '/StreamingInputCall' -FULL_DUPLEX_CALL_METHOD_NAME = _SERVICE_NAME + '/FullDuplexCall' -HALF_DUPLEX_CALL_METHOD_NAME = _SERVICE_NAME + '/HalfDuplexCall' +_EMPTY_CALL_METHOD_NAME = 'EmptyCall' +_UNARY_CALL_METHOD_NAME = 'UnaryCall' +_STREAMING_OUTPUT_CALL_METHOD_NAME = 'StreamingOutputCall' +_STREAMING_INPUT_CALL_METHOD_NAME = 'StreamingInputCall' +_FULL_DUPLEX_CALL_METHOD_NAME = 'FullDuplexCall' +_HALF_DUPLEX_CALL_METHOD_NAME = 'HalfDuplexCall' CLIENT_METHODS = { - EMPTY_CALL_METHOD_NAME: _CLIENT_EMPTY_CALL, - UNARY_CALL_METHOD_NAME: _CLIENT_UNARY_CALL, - STREAMING_OUTPUT_CALL_METHOD_NAME: _CLIENT_STREAMING_OUTPUT_CALL, - STREAMING_INPUT_CALL_METHOD_NAME: _CLIENT_STREAMING_INPUT_CALL, - FULL_DUPLEX_CALL_METHOD_NAME: _CLIENT_FULL_DUPLEX_CALL, - HALF_DUPLEX_CALL_METHOD_NAME: _CLIENT_HALF_DUPLEX_CALL, + _EMPTY_CALL_METHOD_NAME: _CLIENT_EMPTY_CALL, + _UNARY_CALL_METHOD_NAME: _CLIENT_UNARY_CALL, + _STREAMING_OUTPUT_CALL_METHOD_NAME: _CLIENT_STREAMING_OUTPUT_CALL, + _STREAMING_INPUT_CALL_METHOD_NAME: _CLIENT_STREAMING_INPUT_CALL, + _FULL_DUPLEX_CALL_METHOD_NAME: _CLIENT_FULL_DUPLEX_CALL, + _HALF_DUPLEX_CALL_METHOD_NAME: _CLIENT_HALF_DUPLEX_CALL, } SERVER_METHODS = { - EMPTY_CALL_METHOD_NAME: _SERVER_EMPTY_CALL, - UNARY_CALL_METHOD_NAME: _SERVER_UNARY_CALL, - STREAMING_OUTPUT_CALL_METHOD_NAME: _SERVER_STREAMING_OUTPUT_CALL, - STREAMING_INPUT_CALL_METHOD_NAME: _SERVER_STREAMING_INPUT_CALL, - FULL_DUPLEX_CALL_METHOD_NAME: _SERVER_FULL_DUPLEX_CALL, - HALF_DUPLEX_CALL_METHOD_NAME: _SERVER_HALF_DUPLEX_CALL, + _EMPTY_CALL_METHOD_NAME: _SERVER_EMPTY_CALL, + _UNARY_CALL_METHOD_NAME: _SERVER_UNARY_CALL, + _STREAMING_OUTPUT_CALL_METHOD_NAME: _SERVER_STREAMING_OUTPUT_CALL, + _STREAMING_INPUT_CALL_METHOD_NAME: _SERVER_STREAMING_INPUT_CALL, + _FULL_DUPLEX_CALL_METHOD_NAME: _SERVER_FULL_DUPLEX_CALL, + _HALF_DUPLEX_CALL_METHOD_NAME: _SERVER_HALF_DUPLEX_CALL, } diff --git a/src/python/interop/interop/server.py b/src/python/interop/interop/server.py index 4e4b127a9a7..57912037435 100644 --- a/src/python/interop/interop/server.py +++ b/src/python/interop/interop/server.py @@ -54,10 +54,11 @@ def serve(): private_key = resources.private_key() certificate_chain = resources.certificate_chain() server = implementations.secure_server( - methods.SERVER_METHODS, args.port, private_key, certificate_chain) + methods.SERVICE_NAME, methods.SERVER_METHODS, args.port, private_key, + certificate_chain) else: server = implementations.insecure_server( - methods.SERVER_METHODS, args.port) + methods.SERVICE_NAME, methods.SERVER_METHODS, args.port) server.start() logging.info('Server serving.') diff --git a/src/python/src/grpc/early_adopter/_face_utilities.py b/src/python/src/grpc/early_adopter/_face_utilities.py index 2cf576018d4..ce099fc22f0 100644 --- a/src/python/src/grpc/early_adopter/_face_utilities.py +++ b/src/python/src/grpc/early_adopter/_face_utilities.py @@ -38,16 +38,28 @@ from grpc.early_adopter import _reexport from grpc.early_adopter import interfaces +def _qualified_name(service_name, method_name): + return '/%s/%s' % (service_name, method_name) + + +# TODO(nathaniel): This structure is getting bloated; it could be shrunk if +# implementations._Stub used a generic rather than a dynamic underlying +# face-layer stub. class InvocationBreakdown(object): """An intermediate representation of invocation-side views of RPC methods. Attributes: cardinalities: A dictionary from RPC method name to interfaces.Cardinality value. - request_serializers: A dictionary from RPC method name to callable - behavior to be used serializing request values for the RPC. - response_deserializers: A dictionary from RPC method name to callable - behavior to be used deserializing response values for the RPC. + qualified_names: A dictionary from unqualified RPC method name to + service-qualified RPC method name. + face_cardinalities: A dictionary from service-qualified RPC method name to + to cardinality.Cardinality value. + request_serializers: A dictionary from service-qualified RPC method name to + callable behavior to be used serializing request values for the RPC. + response_deserializers: A dictionary from service-qualified RPC method name + to callable behavior to be used deserializing response values for the + RPC. """ __metaclass__ = abc.ABCMeta @@ -56,7 +68,8 @@ class _EasyInvocationBreakdown( InvocationBreakdown, collections.namedtuple( '_EasyInvocationBreakdown', - ('cardinalities', 'request_serializers', 'response_deserializers'))): + ('cardinalities', 'qualified_names', 'face_cardinalities', + 'request_serializers', 'response_deserializers'))): pass @@ -64,12 +77,12 @@ class ServiceBreakdown(object): """An intermediate representation of service-side views of RPC methods. Attributes: - implementations: A dictionary from RPC method name to + implementations: A dictionary from service-qualified RPC method name to face_interfaces.MethodImplementation implementing the RPC method. - request_deserializers: A dictionary from RPC method name to callable - behavior to be used deserializing request values for the RPC. - response_serializers: A dictionary from RPC method name to callable - behavior to be used serializing response values for the RPC. + request_deserializers: A dictionary from service-qualified RPC method name + to callable behavior to be used deserializing request values for the RPC. + response_serializers: A dictionary from service-qualified RPC method name + to callable behavior to be used serializing response values for the RPC. """ __metaclass__ = abc.ABCMeta @@ -82,10 +95,11 @@ class _EasyServiceBreakdown( pass -def break_down_invocation(method_descriptions): +def break_down_invocation(service_name, method_descriptions): """Derives an InvocationBreakdown from several RPC method descriptions. Args: + service_name: The package-qualified full name of the service. method_descriptions: A dictionary from RPC method name to interfaces.RpcMethodInvocationDescription describing the RPCs. @@ -93,17 +107,26 @@ def break_down_invocation(method_descriptions): An InvocationBreakdown corresponding to the given method descriptions. """ cardinalities = {} + qualified_names = {} + face_cardinalities = {} request_serializers = {} response_deserializers = {} for name, method_description in method_descriptions.iteritems(): + qualified_name = _qualified_name(service_name, name) + method_cardinality = method_description.cardinality() cardinalities[name] = method_description.cardinality() - request_serializers[name] = method_description.serialize_request - response_deserializers[name] = method_description.deserialize_response + qualified_names[name] = qualified_name + face_cardinalities[qualified_name] = _reexport.common_cardinality( + method_cardinality) + request_serializers[qualified_name] = method_description.serialize_request + response_deserializers[qualified_name] = ( + method_description.deserialize_response) return _EasyInvocationBreakdown( - cardinalities, request_serializers, response_deserializers) + cardinalities, qualified_names, face_cardinalities, request_serializers, + response_deserializers) -def break_down_service(method_descriptions): +def break_down_service(service_name, method_descriptions): """Derives a ServiceBreakdown from several RPC method descriptions. Args: @@ -117,37 +140,44 @@ def break_down_service(method_descriptions): request_deserializers = {} response_serializers = {} for name, method_description in method_descriptions.iteritems(): - cardinality = method_description.cardinality() - if cardinality is interfaces.Cardinality.UNARY_UNARY: + qualified_name = _qualified_name(service_name, name) + method_cardinality = method_description.cardinality() + if method_cardinality is interfaces.Cardinality.UNARY_UNARY: def service( request, face_rpc_context, service_behavior=method_description.service_unary_unary): return service_behavior( request, _reexport.rpc_context(face_rpc_context)) - implementations[name] = face_utilities.unary_unary_inline(service) - elif cardinality is interfaces.Cardinality.UNARY_STREAM: + implementations[qualified_name] = face_utilities.unary_unary_inline( + service) + elif method_cardinality is interfaces.Cardinality.UNARY_STREAM: def service( request, face_rpc_context, service_behavior=method_description.service_unary_stream): return service_behavior( request, _reexport.rpc_context(face_rpc_context)) - implementations[name] = face_utilities.unary_stream_inline(service) - elif cardinality is interfaces.Cardinality.STREAM_UNARY: + implementations[qualified_name] = face_utilities.unary_stream_inline( + service) + elif method_cardinality is interfaces.Cardinality.STREAM_UNARY: def service( request_iterator, face_rpc_context, service_behavior=method_description.service_stream_unary): return service_behavior( request_iterator, _reexport.rpc_context(face_rpc_context)) - implementations[name] = face_utilities.stream_unary_inline(service) - elif cardinality is interfaces.Cardinality.STREAM_STREAM: + implementations[qualified_name] = face_utilities.stream_unary_inline( + service) + elif method_cardinality is interfaces.Cardinality.STREAM_STREAM: def service( request_iterator, face_rpc_context, service_behavior=method_description.service_stream_stream): return service_behavior( request_iterator, _reexport.rpc_context(face_rpc_context)) - implementations[name] = face_utilities.stream_stream_inline(service) - request_deserializers[name] = method_description.deserialize_request - response_serializers[name] = method_description.serialize_response + implementations[qualified_name] = face_utilities.stream_stream_inline( + service) + request_deserializers[qualified_name] = ( + method_description.deserialize_request) + response_serializers[qualified_name] = ( + method_description.serialize_response) return _EasyServiceBreakdown( implementations, request_deserializers, response_serializers) diff --git a/src/python/src/grpc/early_adopter/_reexport.py b/src/python/src/grpc/early_adopter/_reexport.py index f3416028e8c..49bc38e203c 100644 --- a/src/python/src/grpc/early_adopter/_reexport.py +++ b/src/python/src/grpc/early_adopter/_reexport.py @@ -174,6 +174,11 @@ class _StreamUnarySyncAsync(interfaces.StreamUnarySyncAsync): return _ReexportedFuture(self._underlying.future(request_iterator, timeout)) +def common_cardinality(early_adopter_cardinality): + return _EARLY_ADOPTER_CARDINALITY_TO_COMMON_CARDINALITY[ + early_adopter_cardinality] + + def common_cardinalities(early_adopter_cardinalities): common_cardinalities = {} for name, early_adopter_cardinality in early_adopter_cardinalities.iteritems(): diff --git a/src/python/src/grpc/early_adopter/implementations.py b/src/python/src/grpc/early_adopter/implementations.py index 6fe90594a74..7c50d7d8b26 100644 --- a/src/python/src/grpc/early_adopter/implementations.py +++ b/src/python/src/grpc/early_adopter/implementations.py @@ -146,8 +146,7 @@ class _Stub(interfaces.Stub): self._rear_link.join_fore_link(self._front) self._rear_link.start() self._understub = _face_implementations.dynamic_stub( - _reexport.common_cardinalities(self._breakdown.cardinalities), - self._front, self._pool, '') + self._breakdown.face_cardinalities, self._front, self._pool, '') else: raise ValueError('Tried to __enter__ already-__enter__ed Stub!') return self @@ -171,17 +170,9 @@ class _Stub(interfaces.Stub): if self._pool is None: raise ValueError('Tried to __getattr__ non-__enter__ed Stub!') else: - underlying_attr = getattr(self._understub, attr, None) method_cardinality = self._breakdown.cardinalities.get(attr) - # TODO(nathaniel): Eliminate this trick. - if underlying_attr is None: - for method_name, method_cardinality in self._breakdown.cardinalities.iteritems(): - last_slash_index = method_name.rfind('/') - if 0 <= last_slash_index and method_name[last_slash_index + 1:] == attr: - underlying_attr = getattr(self._understub, method_name) - break - else: - raise AttributeError(attr) + underlying_attr = getattr( + self._understub, self._breakdown.qualified_names.get(attr), None) if method_cardinality is interfaces.Cardinality.UNARY_UNARY: return _reexport.unary_unary_sync_async(underlying_attr) elif method_cardinality is interfaces.Cardinality.UNARY_STREAM: @@ -198,44 +189,49 @@ class _Stub(interfaces.Stub): def _build_stub( - methods, host, port, secure, root_certificates, private_key, + service_name, methods, host, port, secure, root_certificates, private_key, certificate_chain, server_host_override=None): - breakdown = _face_utilities.break_down_invocation(methods) + breakdown = _face_utilities.break_down_invocation(service_name, methods) return _Stub( breakdown, host, port, secure, root_certificates, private_key, certificate_chain, server_host_override=server_host_override) -def _build_server(methods, port, private_key, certificate_chain): - breakdown = _face_utilities.break_down_service(methods) +def _build_server(service_name, methods, port, private_key, certificate_chain): + breakdown = _face_utilities.break_down_service(service_name, methods) return _Server(breakdown, port, private_key, certificate_chain) -def insecure_stub(methods, host, port): +def insecure_stub(service_name, methods, host, port): """Constructs an insecure interfaces.Stub. Args: + service_name: The package-qualified full name of the service. methods: A dictionary from RPC method name to interfaces.RpcMethodInvocationDescription describing the RPCs to be - supported by the created stub. + supported by the created stub. The RPC method names in the dictionary are + not qualified by the service name or decorated in any other way. host: The host to which to connect for RPC service. port: The port to which to connect for RPC service. Returns: An interfaces.Stub affording RPC invocation. """ - return _build_stub(methods, host, port, False, None, None, None) + return _build_stub( + service_name, methods, host, port, False, None, None, None) def secure_stub( - methods, host, port, root_certificates, private_key, certificate_chain, - server_host_override=None): + service_name, methods, host, port, root_certificates, private_key, + certificate_chain, server_host_override=None): """Constructs an insecure interfaces.Stub. Args: + service_name: The package-qualified full name of the service. methods: A dictionary from RPC method name to interfaces.RpcMethodInvocationDescription describing the RPCs to be - supported by the created stub. + supported by the created stub. The RPC method names in the dictionary are + not qualified by the service name or decorated in any other way. host: The host to which to connect for RPC service. port: The port to which to connect for RPC service. root_certificates: The PEM-encoded root certificates or None to ask for @@ -251,17 +247,19 @@ def secure_stub( An interfaces.Stub affording RPC invocation. """ return _build_stub( - methods, host, port, True, root_certificates, private_key, + service_name, methods, host, port, True, root_certificates, private_key, certificate_chain, server_host_override=server_host_override) -def insecure_server(methods, port): +def insecure_server(service_name, methods, port): """Constructs an insecure interfaces.Server. Args: + service_name: The package-qualified full name of the service. methods: A dictionary from RPC method name to interfaces.RpcMethodServiceDescription describing the RPCs to - be serviced by the created server. + be serviced by the created server. The RPC method names in the dictionary + are not qualified by the service name or decorated in any other way. port: The desired port on which to serve or zero to ask for a port to be automatically selected. @@ -269,16 +267,18 @@ def insecure_server(methods, port): An interfaces.Server that will run with no security and service unsecured raw requests. """ - return _build_server(methods, port, None, None) + return _build_server(service_name, methods, port, None, None) -def secure_server(methods, port, private_key, certificate_chain): +def secure_server(service_name, methods, port, private_key, certificate_chain): """Constructs a secure interfaces.Server. Args: + service_name: The package-qualified full name of the service. methods: A dictionary from RPC method name to interfaces.RpcMethodServiceDescription describing the RPCs to - be serviced by the created server. + be serviced by the created server. The RPC method names in the dictionary + are not qualified by the service name or decorated in any other way. port: The port on which to serve or zero to ask for a port to be automatically selected. private_key: A pem-encoded private key. @@ -287,4 +287,5 @@ def secure_server(methods, port, private_key, certificate_chain): Returns: An interfaces.Server that will serve secure traffic. """ - return _build_server(methods, port, private_key, certificate_chain) + return _build_server( + service_name, methods, port, private_key, certificate_chain) diff --git a/src/python/src/grpc/early_adopter/implementations_test.py b/src/python/src/grpc/early_adopter/implementations_test.py index 9ef06c32cbc..949d3def3de 100644 --- a/src/python/src/grpc/early_adopter/implementations_test.py +++ b/src/python/src/grpc/early_adopter/implementations_test.py @@ -37,6 +37,8 @@ from grpc.early_adopter import implementations from grpc.early_adopter import utilities from grpc._junkdrawer import math_pb2 +SERVICE_NAME = 'math.Math' + DIV = 'Div' DIV_MANY = 'DivMany' FIB = 'Fib' @@ -104,10 +106,12 @@ _TIMEOUT = 3 class EarlyAdopterImplementationsTest(unittest.TestCase): def setUp(self): - self.server = implementations.insecure_server(_SERVICE_DESCRIPTIONS, 0) + self.server = implementations.insecure_server( + SERVICE_NAME, _SERVICE_DESCRIPTIONS, 0) self.server.start() port = self.server.port() - self.stub = implementations.insecure_stub(_INVOCATION_DESCRIPTIONS, 'localhost', port) + self.stub = implementations.insecure_stub( + SERVICE_NAME, _INVOCATION_DESCRIPTIONS, 'localhost', port) def tearDown(self): self.server.stop() From ae3e5b53f04883c9386e7d80789d92c13acc1e2f Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Mon, 16 Mar 2015 23:30:03 +0000 Subject: [PATCH 39/75] Change managers to pass each other Outcomes This refactoring greatly reduces the base-internal use of packet kinds and will make much simpler a future change distinguishing front-to-back packet kinds from back-to-front packet kinds. --- .../framework/base/packets/_cancellation.py | 5 +- .../grpc/framework/base/packets/_context.py | 8 +-- .../grpc/framework/base/packets/_emission.py | 22 +++---- .../src/grpc/framework/base/packets/_ends.py | 4 +- .../framework/base/packets/_expiration.py | 6 +- .../grpc/framework/base/packets/_ingestion.py | 40 ++++++------ .../framework/base/packets/_interfaces.py | 8 +-- .../grpc/framework/base/packets/_reception.py | 55 ++++++++-------- .../framework/base/packets/_termination.py | 48 +++++--------- .../framework/base/packets/_transmission.py | 63 +++++++++++-------- 10 files changed, 130 insertions(+), 129 deletions(-) diff --git a/src/python/src/grpc/framework/base/packets/_cancellation.py b/src/python/src/grpc/framework/base/packets/_cancellation.py index 2373c78842d..4a0ced1440c 100644 --- a/src/python/src/grpc/framework/base/packets/_cancellation.py +++ b/src/python/src/grpc/framework/base/packets/_cancellation.py @@ -29,6 +29,7 @@ """State and behavior for operation cancellation.""" +from grpc.framework.base import interfaces as base_interfaces from grpc.framework.base.packets import _interfaces from grpc.framework.base.packets import packets @@ -58,7 +59,7 @@ class CancellationManager(_interfaces.CancellationManager): def cancel(self): """See _interfaces.CancellationManager.cancel for specification.""" with self._lock: - self._termination_manager.abort(packets.Kind.CANCELLATION) - self._transmission_manager.abort(packets.Kind.CANCELLATION) + self._termination_manager.abort(base_interfaces.Outcome.CANCELLED) + self._transmission_manager.abort(base_interfaces.Outcome.CANCELLED) self._ingestion_manager.abort() self._expiration_manager.abort() diff --git a/src/python/src/grpc/framework/base/packets/_context.py b/src/python/src/grpc/framework/base/packets/_context.py index e09d4a60c91..45241c639e8 100644 --- a/src/python/src/grpc/framework/base/packets/_context.py +++ b/src/python/src/grpc/framework/base/packets/_context.py @@ -31,10 +31,9 @@ import time -# _interfaces and packets are referenced from specification in this module. +# _interfaces is referenced from specification in this module. from grpc.framework.base import interfaces as base_interfaces from grpc.framework.base.packets import _interfaces # pylint: disable=unused-import -from grpc.framework.base.packets import packets # pylint: disable=unused-import class OperationContext(base_interfaces.OperationContext): @@ -48,8 +47,9 @@ class OperationContext(base_interfaces.OperationContext): Args: lock: The operation-wide lock. operation_id: An object identifying the operation. - local_failure: Whichever one of packets.Kind.SERVICED_FAILURE or - packets.Kind.SERVICER_FAILURE describes local failure of customer code. + local_failure: Whichever one of base_interfaces.Outcome.SERVICED_FAILURE + or base_interfaces.Outcome.SERVICER_FAILURE describes local failure of + customer code. termination_manager: The _interfaces.TerminationManager for the operation. transmission_manager: The _interfaces.TransmissionManager for the operation. diff --git a/src/python/src/grpc/framework/base/packets/_emission.py b/src/python/src/grpc/framework/base/packets/_emission.py index 9446b8665db..cfc9e40a242 100644 --- a/src/python/src/grpc/framework/base/packets/_emission.py +++ b/src/python/src/grpc/framework/base/packets/_emission.py @@ -29,29 +29,29 @@ """State and behavior for handling emitted values.""" -# packets is referenced from specifications in this module. +from grpc.framework.base import interfaces as base_interfaces from grpc.framework.base.packets import _interfaces -from grpc.framework.base.packets import packets # pylint: disable=unused-import class _EmissionManager(_interfaces.EmissionManager): """An implementation of _interfaces.EmissionManager.""" def __init__( - self, lock, failure_kind, termination_manager, transmission_manager): + self, lock, failure_outcome, termination_manager, transmission_manager): """Constructor. Args: lock: The operation-wide lock. - failure_kind: Whichever one of packets.Kind.SERVICED_FAILURE or - packets.Kind.SERVICER_FAILURE describes this object's methods being - called inappropriately by customer code. + failure_outcome: Whichever one of + base_interfaces.Outcome.SERVICED_FAILURE or + base_interfaces.Outcome.SERVICER_FAILURE describes this object's + methods being called inappropriately by customer code. termination_manager: The _interfaces.TerminationManager for the operation. transmission_manager: The _interfaces.TransmissionManager for the operation. """ self._lock = lock - self._failure_kind = failure_kind + self._failure_outcome = failure_outcome self._termination_manager = termination_manager self._transmission_manager = transmission_manager self._ingestion_manager = None @@ -65,8 +65,8 @@ class _EmissionManager(_interfaces.EmissionManager): self._expiration_manager = expiration_manager def _abort(self): - self._termination_manager.abort(self._failure_kind) - self._transmission_manager.abort(self._failure_kind) + self._termination_manager.abort(self._failure_outcome) + self._transmission_manager.abort(self._failure_outcome) self._ingestion_manager.abort() self._expiration_manager.abort() @@ -106,7 +106,7 @@ def front_emission_manager(lock, termination_manager, transmission_manager): An _interfaces.EmissionManager appropriate for front-side use. """ return _EmissionManager( - lock, packets.Kind.SERVICED_FAILURE, termination_manager, + lock, base_interfaces.Outcome.SERVICED_FAILURE, termination_manager, transmission_manager) @@ -122,5 +122,5 @@ def back_emission_manager(lock, termination_manager, transmission_manager): An _interfaces.EmissionManager appropriate for back-side use. """ return _EmissionManager( - lock, packets.Kind.SERVICER_FAILURE, termination_manager, + lock, base_interfaces.Outcome.SERVICER_FAILURE, termination_manager, transmission_manager) diff --git a/src/python/src/grpc/framework/base/packets/_ends.py b/src/python/src/grpc/framework/base/packets/_ends.py index ac369c4fbda..ca35cdd9b40 100644 --- a/src/python/src/grpc/framework/base/packets/_ends.py +++ b/src/python/src/grpc/framework/base/packets/_ends.py @@ -198,7 +198,7 @@ def _front_operate( lock, transmission_pool, callback, operation_id, name, subscription.kind, trace_id, timeout, termination_manager) operation_context = _context.OperationContext( - lock, operation_id, packets.Kind.SERVICED_FAILURE, + lock, operation_id, base_interfaces.Outcome.SERVICED_FAILURE, termination_manager, transmission_manager) emission_manager = _emission.front_emission_manager( lock, termination_manager, transmission_manager) @@ -327,7 +327,7 @@ def _back_operate( lock, transmission_pool, callback, ticket.operation_id, termination_manager, ticket.subscription) operation_context = _context.OperationContext( - lock, ticket.operation_id, packets.Kind.SERVICER_FAILURE, + lock, ticket.operation_id, base_interfaces.Outcome.SERVICER_FAILURE, termination_manager, transmission_manager) emission_manager = _emission.back_emission_manager( lock, termination_manager, transmission_manager) diff --git a/src/python/src/grpc/framework/base/packets/_expiration.py b/src/python/src/grpc/framework/base/packets/_expiration.py index f58db28aa25..a9ecaeaa63c 100644 --- a/src/python/src/grpc/framework/base/packets/_expiration.py +++ b/src/python/src/grpc/framework/base/packets/_expiration.py @@ -31,8 +31,8 @@ import time +from grpc.framework.base import interfaces as base_interfaces from grpc.framework.base.packets import _interfaces -from grpc.framework.base.packets import packets from grpc.framework.foundation import later @@ -73,8 +73,8 @@ class _ExpirationManager(_interfaces.ExpirationManager): with self._lock: if self._future is not None and index == self._index: self._future = None - self._termination_manager.abort(packets.Kind.EXPIRATION) - self._transmission_manager.abort(packets.Kind.EXPIRATION) + self._termination_manager.abort(base_interfaces.Outcome.EXPIRED) + self._transmission_manager.abort(base_interfaces.Outcome.EXPIRED) self._ingestion_manager.abort() def start(self): diff --git a/src/python/src/grpc/framework/base/packets/_ingestion.py b/src/python/src/grpc/framework/base/packets/_ingestion.py index a750195ccba..c5c08fd98e4 100644 --- a/src/python/src/grpc/framework/base/packets/_ingestion.py +++ b/src/python/src/grpc/framework/base/packets/_ingestion.py @@ -206,7 +206,7 @@ class _IngestionManager(_interfaces.IngestionManager): """An implementation of _interfaces.IngestionManager.""" def __init__( - self, lock, pool, consumer_creator, failure_kind, termination_manager, + self, lock, pool, consumer_creator, failure_outcome, termination_manager, transmission_manager): """Constructor. @@ -216,8 +216,10 @@ class _IngestionManager(_interfaces.IngestionManager): consumer_creator: A _ConsumerCreator wrapping the portion of customer code that when called returns the stream.Consumer with which the customer code will ingest payload values. - failure_kind: Whichever one of packets.Kind.SERVICED_FAILURE or - packets.Kind.SERVICER_FAILURE describes local failure of customer code. + failure_outcome: Whichever one of + interfaces.Outcome.SERVICED_FAILURE or + interfaces.Outcome.SERVICER_FAILURE describes local failure of + customer code. termination_manager: The _interfaces.TerminationManager for the operation. transmission_manager: The _interfaces.TransmissionManager for the operation. @@ -225,7 +227,7 @@ class _IngestionManager(_interfaces.IngestionManager): self._lock = lock self._pool = pool self._consumer_creator = consumer_creator - self._failure_kind = failure_kind + self._failure_outcome = failure_outcome self._termination_manager = termination_manager self._transmission_manager = transmission_manager self._expiration_manager = None @@ -299,12 +301,12 @@ class _IngestionManager(_interfaces.IngestionManager): else: with self._lock: if self._pending_ingestion is not None: - self._abort_and_notify(self._failure_kind) + self._abort_and_notify(self._failure_outcome) self._processing = False return else: with self._lock: - self._abort_and_notify(self._failure_kind) + self._abort_and_notify(self._failure_outcome) self._processing = False return @@ -316,16 +318,16 @@ class _IngestionManager(_interfaces.IngestionManager): _CREATE_CONSUMER_EXCEPTION_LOG_MESSAGE, requirement) if consumer_creation_outcome.return_value is None: with self._lock: - self._abort_and_notify(self._failure_kind) + self._abort_and_notify(self._failure_outcome) self._processing = False elif consumer_creation_outcome.return_value.remote_error: with self._lock: - self._abort_and_notify(packets.Kind.RECEPTION_FAILURE) + self._abort_and_notify(interfaces.Outcome.RECEPTION_FAILURE) self._processing = False elif consumer_creation_outcome.return_value.abandoned: with self._lock: if self._pending_ingestion is not None: - self._abort_and_notify(self._failure_kind) + self._abort_and_notify(self._failure_outcome) self._processing = False else: wrapped_ingestion_consumer = _WrappedConsumer( @@ -346,7 +348,7 @@ class _IngestionManager(_interfaces.IngestionManager): def consume(self, payload): if self._ingestion_complete: - self._abort_and_notify(self._failure_kind) + self._abort_and_notify(self._failure_outcome) elif self._pending_ingestion is not None: if self._processing: self._pending_ingestion.append(payload) @@ -359,7 +361,7 @@ class _IngestionManager(_interfaces.IngestionManager): def terminate(self): if self._ingestion_complete: - self._abort_and_notify(self._failure_kind) + self._abort_and_notify(self._failure_outcome) else: self._ingestion_complete = True if self._pending_ingestion is not None and not self._processing: @@ -371,7 +373,7 @@ class _IngestionManager(_interfaces.IngestionManager): def consume_and_terminate(self, payload): if self._ingestion_complete: - self._abort_and_notify(self._failure_kind) + self._abort_and_notify(self._failure_outcome) else: self._ingestion_complete = True if self._pending_ingestion is not None: @@ -397,19 +399,20 @@ def front_ingestion_manager( Args: lock: The operation-wide lock. pool: A thread pool in which to execute customer code. - subscription: A base_interfaces.ServicedSubscription indicating the + subscription: A interfaces.ServicedSubscription indicating the customer's interest in the results of the operation. termination_manager: The _interfaces.TerminationManager for the operation. transmission_manager: The _interfaces.TransmissionManager for the operation. - operation_context: A base_interfaces.OperationContext for the operation. + operation_context: A interfaces.OperationContext for the operation. Returns: An IngestionManager appropriate for front-side use. """ ingestion_manager = _IngestionManager( lock, pool, _FrontConsumerCreator(subscription, operation_context), - packets.Kind.SERVICED_FAILURE, termination_manager, transmission_manager) + interfaces.Outcome.SERVICED_FAILURE, termination_manager, + transmission_manager) ingestion_manager.start(None) return ingestion_manager @@ -422,11 +425,11 @@ def back_ingestion_manager( Args: lock: The operation-wide lock. pool: A thread pool in which to execute customer code. - servicer: A base_interfaces.Servicer for servicing the operation. + servicer: A interfaces.Servicer for servicing the operation. termination_manager: The _interfaces.TerminationManager for the operation. transmission_manager: The _interfaces.TransmissionManager for the operation. - operation_context: A base_interfaces.OperationContext for the operation. + operation_context: A interfaces.OperationContext for the operation. emission_consumer: The _interfaces.EmissionConsumer for the operation. Returns: @@ -435,5 +438,6 @@ def back_ingestion_manager( ingestion_manager = _IngestionManager( lock, pool, _BackConsumerCreator( servicer, operation_context, emission_consumer), - packets.Kind.SERVICER_FAILURE, termination_manager, transmission_manager) + interfaces.Outcome.SERVICER_FAILURE, termination_manager, + transmission_manager) return ingestion_manager diff --git a/src/python/src/grpc/framework/base/packets/_interfaces.py b/src/python/src/grpc/framework/base/packets/_interfaces.py index 64dc33e8d58..64184bdf7c9 100644 --- a/src/python/src/grpc/framework/base/packets/_interfaces.py +++ b/src/python/src/grpc/framework/base/packets/_interfaces.py @@ -83,11 +83,11 @@ class TerminationManager(object): raise NotImplementedError() @abc.abstractmethod - def abort(self, kind): + def abort(self, outcome): """Indicates that the operation must abort for the indicated reason. Args: - kind: A value of packets.Kind indicating operation abortion. + outcome: A base_interfaces.Outcome indicating operation abortion. """ raise NotImplementedError() @@ -109,11 +109,11 @@ class TransmissionManager(object): raise NotImplementedError() @abc.abstractmethod - def abort(self, kind): + def abort(self, outcome): """Indicates that the operation has aborted for the indicated reason. Args: - kind: A value of packets.Kind indicating operation abortion. + outcome: A base_interfaces.Outcome indicating operation abortion. """ raise NotImplementedError() diff --git a/src/python/src/grpc/framework/base/packets/_reception.py b/src/python/src/grpc/framework/base/packets/_reception.py index 6e2c9c0a4e7..becbef828dc 100644 --- a/src/python/src/grpc/framework/base/packets/_reception.py +++ b/src/python/src/grpc/framework/base/packets/_reception.py @@ -31,6 +31,7 @@ import abc +from grpc.framework.base import interfaces as base_interfaces from grpc.framework.base.packets import _interfaces from grpc.framework.base.packets import packets @@ -72,11 +73,11 @@ class _Receiver(object): def _abort( - category, termination_manager, transmission_manager, ingestion_manager, + outcome, termination_manager, transmission_manager, ingestion_manager, expiration_manager): - """Indicates abortion with the given category to the given managers.""" - termination_manager.abort(category) - transmission_manager.abort(category) + """Indicates abortion with the given outcome to the given managers.""" + termination_manager.abort(outcome) + transmission_manager.abort(outcome) ingestion_manager.abort() expiration_manager.abort() @@ -88,9 +89,9 @@ def _abort_if_abortive( Args: packet: A just-arrived packet. - abortive: A callable that takes a packet and returns an operation category - indicating that the operation should be aborted or None indicating that - the operation should not be aborted. + abortive: A callable that takes a packet and returns a + base_interfaces.Outcome indicating that the operation should be aborted + or None indicating that the operation should not be aborted. termination_manager: The operation's _interfaces.TerminationManager. transmission_manager: The operation's _interfaces.TransmissionManager. ingestion_manager: The operation's _interfaces.IngestionManager. @@ -99,12 +100,12 @@ def _abort_if_abortive( Returns: True if the operation was aborted; False otherwise. """ - abort_category = abortive(packet) - if abort_category is None: + abortion_outcome = abortive(packet) + if abortion_outcome is None: return False else: _abort( - abort_category, termination_manager, transmission_manager, + abortion_outcome, termination_manager, transmission_manager, ingestion_manager, expiration_manager) return True @@ -114,8 +115,8 @@ def _reception_failure( expiration_manager): """Aborts the operation with an indication of reception failure.""" _abort( - packets.Kind.RECEPTION_FAILURE, termination_manager, transmission_manager, - ingestion_manager, expiration_manager) + base_interfaces.Outcome.RECEPTION_FAILURE, termination_manager, + transmission_manager, ingestion_manager, expiration_manager) class _BackReceiver(_Receiver): @@ -147,23 +148,22 @@ class _BackReceiver(_Receiver): packet: A just-arrived packet. Returns: - One of packets.Kind.CANCELLATION, packets.Kind.SERVICED_FAILURE, or - packets.Kind.RECEPTION_FAILURE, indicating that the packet is abortive - and how, or None, indicating that the packet is not abortive. + A base_interfaces.Outcome value describing operation abortion if the + packet is abortive or None if the packet is not abortive. """ if packet.kind is packets.Kind.CANCELLATION: - return packets.Kind.CANCELLATION + return base_interfaces.Outcome.CANCELLED elif packet.kind is packets.Kind.EXPIRATION: - return packets.Kind.EXPIRATION + return base_interfaces.Outcome.EXPIRED elif packet.kind is packets.Kind.SERVICED_FAILURE: - return packets.Kind.SERVICED_FAILURE + return base_interfaces.Outcome.SERVICED_FAILURE elif packet.kind is packets.Kind.RECEPTION_FAILURE: - return packets.Kind.SERVICED_FAILURE + return base_interfaces.Outcome.SERVICED_FAILURE elif (packet.kind in (packets.Kind.COMMENCEMENT, packets.Kind.ENTIRE) and self._first_packet_seen): - return packets.Kind.RECEPTION_FAILURE + return base_interfaces.Outcome.RECEPTION_FAILURE elif self._last_packet_seen: - return packets.Kind.RECEPTION_FAILURE + return base_interfaces.Outcome.RECEPTION_FAILURE else: return None @@ -236,18 +236,17 @@ class _FrontReceiver(_Receiver): packet: A just-arrived packet. Returns: - One of packets.Kind.EXPIRATION, packets.Kind.SERVICER_FAILURE, or - packets.Kind.RECEPTION_FAILURE, indicating that the packet is abortive - and how, or None, indicating that the packet is not abortive. + A base_interfaces.Outcome value describing operation abortion if the + packet is abortive or None if the packet is not abortive. """ if packet.kind is packets.Kind.EXPIRATION: - return packets.Kind.EXPIRATION + return base_interfaces.Outcome.EXPIRED elif packet.kind is packets.Kind.SERVICER_FAILURE: - return packets.Kind.SERVICER_FAILURE + return base_interfaces.Outcome.SERVICER_FAILURE elif packet.kind is packets.Kind.RECEPTION_FAILURE: - return packets.Kind.SERVICER_FAILURE + return base_interfaces.Outcome.SERVICER_FAILURE elif self._last_packet_seen: - return packets.Kind.RECEPTION_FAILURE + return base_interfaces.Outcome.RECEPTION_FAILURE else: return None diff --git a/src/python/src/grpc/framework/base/packets/_termination.py b/src/python/src/grpc/framework/base/packets/_termination.py index 575eee65a83..6afba88fc41 100644 --- a/src/python/src/grpc/framework/base/packets/_termination.py +++ b/src/python/src/grpc/framework/base/packets/_termination.py @@ -34,21 +34,10 @@ import enum from grpc.framework.base import interfaces from grpc.framework.base.packets import _constants from grpc.framework.base.packets import _interfaces -from grpc.framework.base.packets import packets from grpc.framework.foundation import callable_util _CALLBACK_EXCEPTION_LOG_MESSAGE = 'Exception calling termination callback!' -_KINDS_TO_OUTCOMES = { - packets.Kind.COMPLETION: interfaces.Outcome.COMPLETED, - packets.Kind.CANCELLATION: interfaces.Outcome.CANCELLED, - packets.Kind.EXPIRATION: interfaces.Outcome.EXPIRED, - packets.Kind.RECEPTION_FAILURE: interfaces.Outcome.RECEPTION_FAILURE, - packets.Kind.TRANSMISSION_FAILURE: interfaces.Outcome.TRANSMISSION_FAILURE, - packets.Kind.SERVICER_FAILURE: interfaces.Outcome.SERVICER_FAILURE, - packets.Kind.SERVICED_FAILURE: interfaces.Outcome.SERVICED_FAILURE, - } - @enum.unique class _Requirement(enum.Enum): @@ -78,8 +67,8 @@ class _TerminationManager(_interfaces.TerminationManager): action: An action to call on operation termination. requirements: A combination of _Requirement values identifying what must finish for the operation to be considered completed. - local_failure: A packets.Kind specifying what constitutes local failure of - customer work. + local_failure: An interfaces.Outcome specifying what constitutes local + failure of customer work. """ self._work_pool = work_pool self._utility_pool = utility_pool @@ -89,27 +78,23 @@ class _TerminationManager(_interfaces.TerminationManager): self._expiration_manager = None self._outstanding_requirements = set(requirements) - self._kind = None + self._outcome = None self._callbacks = [] def set_expiration_manager(self, expiration_manager): self._expiration_manager = expiration_manager - def _terminate(self, kind): + def _terminate(self, outcome): """Terminates the operation. Args: - kind: One of packets.Kind.COMPLETION, packets.Kind.CANCELLATION, - packets.Kind.EXPIRATION, packets.Kind.RECEPTION_FAILURE, - packets.Kind.TRANSMISSION_FAILURE, packets.Kind.SERVICER_FAILURE, or - packets.Kind.SERVICED_FAILURE. + outcome: An interfaces.Outcome describing the outcome of the operation. """ self._expiration_manager.abort() self._outstanding_requirements = None callbacks = list(self._callbacks) self._callbacks = None - self._kind = kind - outcome = _KINDS_TO_OUTCOMES[kind] + self._outcome = outcome act = callable_util.with_exceptions_logged( self._action, _constants.INTERNAL_ERROR_LOG_MESSAGE) @@ -122,7 +107,7 @@ class _TerminationManager(_interfaces.TerminationManager): callback_outcome = callable_util.call_logging_exceptions( callback, _CALLBACK_EXCEPTION_LOG_MESSAGE, outcome) if callback_outcome.exception is not None: - outcome = _KINDS_TO_OUTCOMES[self._local_failure] + outcome = self._local_failure break self._utility_pool.submit(act, outcome) @@ -141,8 +126,7 @@ class _TerminationManager(_interfaces.TerminationManager): if self._outstanding_requirements is None: self._work_pool.submit( callable_util.with_exceptions_logged( - callback, _CALLBACK_EXCEPTION_LOG_MESSAGE), - _KINDS_TO_OUTCOMES[self._kind]) + callback, _CALLBACK_EXCEPTION_LOG_MESSAGE), self._outcome) else: self._callbacks.append(callback) @@ -151,28 +135,28 @@ class _TerminationManager(_interfaces.TerminationManager): if self._outstanding_requirements is not None: self._outstanding_requirements.discard(_Requirement.EMISSION) if not self._outstanding_requirements: - self._terminate(packets.Kind.COMPLETION) + self._terminate(interfaces.Outcome.COMPLETED) def transmission_complete(self): """See superclass method for specification.""" if self._outstanding_requirements is not None: self._outstanding_requirements.discard(_Requirement.TRANSMISSION) if not self._outstanding_requirements: - self._terminate(packets.Kind.COMPLETION) + self._terminate(interfaces.Outcome.COMPLETED) def ingestion_complete(self): """See superclass method for specification.""" if self._outstanding_requirements is not None: self._outstanding_requirements.discard(_Requirement.INGESTION) if not self._outstanding_requirements: - self._terminate(packets.Kind.COMPLETION) + self._terminate(interfaces.Outcome.COMPLETED) - def abort(self, kind): + def abort(self, outcome): """See _interfaces.TerminationManager.abort for specification.""" - if kind == self._local_failure: + if outcome is self._local_failure: self._has_failed_locally = True if self._outstanding_requirements is not None: - self._terminate(kind) + self._terminate(outcome) def front_termination_manager( @@ -195,7 +179,7 @@ def front_termination_manager( return _TerminationManager( work_pool, utility_pool, action, requirements, - packets.Kind.SERVICED_FAILURE) + interfaces.Outcome.SERVICED_FAILURE) def back_termination_manager(work_pool, utility_pool, action, subscription_kind): @@ -217,4 +201,4 @@ def back_termination_manager(work_pool, utility_pool, action, subscription_kind) return _TerminationManager( work_pool, utility_pool, action, requirements, - packets.Kind.SERVICER_FAILURE) + interfaces.Outcome.SERVICER_FAILURE) diff --git a/src/python/src/grpc/framework/base/packets/_transmission.py b/src/python/src/grpc/framework/base/packets/_transmission.py index ac7f4509db9..002519b9a1c 100644 --- a/src/python/src/grpc/framework/base/packets/_transmission.py +++ b/src/python/src/grpc/framework/base/packets/_transmission.py @@ -39,14 +39,24 @@ from grpc.framework.foundation import callable_util _TRANSMISSION_EXCEPTION_LOG_MESSAGE = 'Exception during transmission!' -_FRONT_TO_BACK_NO_TRANSMISSION_KINDS = ( - packets.Kind.SERVICER_FAILURE, +_FRONT_TO_BACK_NO_TRANSMISSION_OUTCOMES = ( + interfaces.Outcome.SERVICER_FAILURE, ) -_BACK_TO_FRONT_NO_TRANSMISSION_KINDS = ( - packets.Kind.CANCELLATION, - packets.Kind.SERVICED_FAILURE, +_BACK_TO_FRONT_NO_TRANSMISSION_OUTCOMES = ( + interfaces.Outcome.CANCELLED, + interfaces.Outcome.SERVICED_FAILURE, ) +_ABORTION_OUTCOME_TO_PACKET_KIND = { + interfaces.Outcome.CANCELLED: packets.Kind.CANCELLATION, + interfaces.Outcome.EXPIRED: packets.Kind.EXPIRATION, + interfaces.Outcome.RECEPTION_FAILURE: packets.Kind.RECEPTION_FAILURE, + interfaces.Outcome.TRANSMISSION_FAILURE: packets.Kind.TRANSMISSION_FAILURE, + interfaces.Outcome.SERVICED_FAILURE: packets.Kind.SERVICED_FAILURE, + interfaces.Outcome.SERVICER_FAILURE: packets.Kind.SERVICER_FAILURE, +} + + class _Packetizer(object): """Common specification of different packet-creating behavior.""" @@ -72,18 +82,18 @@ class _Packetizer(object): raise NotImplementedError() @abc.abstractmethod - def packetize_abortion(self, operation_id, sequence_number, kind): + def packetize_abortion(self, operation_id, sequence_number, outcome): """Creates a packet indicating that the operation is aborted. Args: operation_id: The operation ID for the current operation. sequence_number: A sequence number for the packet. - kind: One of the values of packets.Kind indicating operational abortion. + outcome: An interfaces.Outcome value describing the operation abortion. Returns: An object of an appropriate type suitable for transmission to the other side of the operation, or None if transmission is not appropriate for - the given kind. + the given outcome. """ raise NotImplementedError() @@ -122,11 +132,12 @@ class _FrontPacketizer(_Packetizer): self._name, self._subscription_kind, self._trace_id, payload, self._timeout) - def packetize_abortion(self, operation_id, sequence_number, kind): + def packetize_abortion(self, operation_id, sequence_number, outcome): """See _Packetizer.packetize_abortion for specification.""" - if kind in _FRONT_TO_BACK_NO_TRANSMISSION_KINDS: + if outcome in _FRONT_TO_BACK_NO_TRANSMISSION_OUTCOMES: return None else: + kind = _ABORTION_OUTCOME_TO_PACKET_KIND[outcome] return packets.FrontToBackPacket( operation_id, sequence_number, kind, None, None, None, None, None) @@ -141,11 +152,12 @@ class _BackPacketizer(_Packetizer): packets.Kind.COMPLETION if complete else packets.Kind.CONTINUATION, payload) - def packetize_abortion(self, operation_id, sequence_number, kind): + def packetize_abortion(self, operation_id, sequence_number, outcome): """See _Packetizer.packetize_abortion for specification.""" - if kind in _BACK_TO_FRONT_NO_TRANSMISSION_KINDS: + if outcome in _BACK_TO_FRONT_NO_TRANSMISSION_OUTCOMES: return None else: + kind = _ABORTION_OUTCOME_TO_PACKET_KIND[outcome] return packets.BackToFrontPacket( operation_id, sequence_number, kind, None) @@ -178,7 +190,7 @@ class _EmptyTransmissionManager(TransmissionManager): def inmit(self, emission, complete): """See _interfaces.TransmissionManager.inmit for specification.""" - def abort(self, category): + def abort(self, outcome): """See _interfaces.TransmissionManager.abort for specification.""" @@ -212,7 +224,7 @@ class _TransmittingTransmissionManager(TransmissionManager): self._emissions = [] self._emission_complete = False - self._kind = None + self._outcome = None self._lowest_unused_sequence_number = 0 self._transmitting = False @@ -239,17 +251,17 @@ class _TransmittingTransmissionManager(TransmissionManager): return self._packetizer.packetize( self._operation_id, sequence_number, emission, complete) - def _abortive_response_packet(self, kind): + def _abortive_response_packet(self, outcome): """Creates a packet indicating operation abortion. Args: - kind: One of the values of packets.Kind indicating operational abortion. + outcome: An interfaces.Outcome value describing operation abortion. Returns: A packet indicating operation abortion. """ packet = self._packetizer.packetize_abortion( - self._operation_id, self._lowest_unused_sequence_number, kind) + self._operation_id, self._lowest_unused_sequence_number, outcome) if packet is None: return None else: @@ -267,7 +279,7 @@ class _TransmittingTransmissionManager(TransmissionManager): """ if self._emissions is None: return False, None - elif self._kind is None: + elif self._outcome is None: if self._emissions: payload = self._emissions.pop(0) complete = self._emission_complete and not self._emissions @@ -278,7 +290,7 @@ class _TransmittingTransmissionManager(TransmissionManager): else: return self._emission_complete, None else: - packet = self._abortive_response_packet(self._kind) + packet = self._abortive_response_packet(self._outcome) self._emissions = None return False, None if packet is None else packet @@ -303,7 +315,8 @@ class _TransmittingTransmissionManager(TransmissionManager): else: with self._lock: self._emissions = None - self._termination_manager.abort(packets.Kind.TRANSMISSION_FAILURE) + self._termination_manager.abort( + interfaces.Outcome.TRANSMISSION_FAILURE) self._ingestion_manager.abort() self._expiration_manager.abort() self._transmitting = False @@ -315,19 +328,19 @@ class _TransmittingTransmissionManager(TransmissionManager): def inmit(self, emission, complete): """See _interfaces.TransmissionManager.inmit for specification.""" - if self._emissions is not None and self._kind is None: + if self._emissions is not None and self._outcome is None: self._emission_complete = complete if self._transmitting: self._emissions.append(emission) else: self._transmit(self._lead_packet(emission, complete)) - def abort(self, kind): + def abort(self, outcome): """See _interfaces.TransmissionManager.abort for specification.""" - if self._emissions is not None and self._kind is None: - self._kind = kind + if self._emissions is not None and self._outcome is None: + self._outcome = outcome if not self._transmitting: - packet = self._abortive_response_packet(kind) + packet = self._abortive_response_packet(outcome) self._emissions = None if packet is not None: self._transmit(packet) From 8d81365a3c03184683782cdd2dd8a9c934c790c7 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Mon, 16 Mar 2015 23:35:15 +0000 Subject: [PATCH 40/75] Iterate over an enum since we can Since enums are themselves iterable there's no need to maintain a list of the elements of the enum dating from back before the enum when its values were just independent constants that hung out together. --- src/python/src/grpc/framework/base/packets/_ends.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/python/src/grpc/framework/base/packets/_ends.py b/src/python/src/grpc/framework/base/packets/_ends.py index ca35cdd9b40..614d1f666e0 100644 --- a/src/python/src/grpc/framework/base/packets/_ends.py +++ b/src/python/src/grpc/framework/base/packets/_ends.py @@ -50,16 +50,6 @@ from grpc.framework.foundation import callable_util _IDLE_ACTION_EXCEPTION_LOG_MESSAGE = 'Exception calling idle action!' -_OPERATION_OUTCOMES = ( - base_interfaces.Outcome.COMPLETED, - base_interfaces.Outcome.CANCELLED, - base_interfaces.Outcome.EXPIRED, - base_interfaces.Outcome.RECEPTION_FAILURE, - base_interfaces.Outcome.TRANSMISSION_FAILURE, - base_interfaces.Outcome.SERVICER_FAILURE, - base_interfaces.Outcome.SERVICED_FAILURE, - ) - class _EasyOperation(base_interfaces.Operation): """A trivial implementation of base_interfaces.Operation.""" @@ -98,7 +88,7 @@ class _Endlette(object): # indicates an in-progress fire-and-forget operation for which the customer # has chosen to ignore results. self._operations = {} - self._stats = {outcome: 0 for outcome in _OPERATION_OUTCOMES} + self._stats = {outcome: 0 for outcome in base_interfaces.Outcome} self._idle_actions = [] def terminal_action(self, operation_id): From 6b64c811b32024cf1c678ed32a64669d8bb51953 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Mon, 16 Mar 2015 17:49:24 -0700 Subject: [PATCH 41/75] Fixes iPhone platform detection --- include/grpc/support/port_platform.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index 25602900149..be0ed8c3fb3 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -114,10 +114,11 @@ #define GPR_ARCH_32 1 #endif /* _LP64 */ #elif defined(__APPLE__) +#include #ifndef _BSD_SOURCE #define _BSD_SOURCE #endif -#ifdef TARGET_OS_IPHONE +#if TARGET_OS_IPHONE #define GPR_CPU_IPHONE 1 #else /* TARGET_OS_IPHONE */ #define GPR_CPU_POSIX 1 From e2e443c1d466c525454335c6a5bee4daf35a7bd4 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Tue, 17 Mar 2015 00:49:36 +0000 Subject: [PATCH 42/75] Use distinct enums for distinct ticket types --- src/python/src/grpc/_adapter/_links_test.py | 63 +++++++++++------- .../grpc/_adapter/_lonely_rear_link_test.py | 12 ++-- src/python/src/grpc/_adapter/fore.py | 28 ++++---- src/python/src/grpc/_adapter/rear.py | 28 ++++---- .../grpc/framework/base/packets/_reception.py | 31 +++++---- .../framework/base/packets/_transmission.py | 64 +++++++++++++------ .../grpc/framework/base/packets/packets.py | 57 +++++++++-------- 7 files changed, 172 insertions(+), 111 deletions(-) diff --git a/src/python/src/grpc/_adapter/_links_test.py b/src/python/src/grpc/_adapter/_links_test.py index 5d7e6772434..49fd1f7a1ca 100644 --- a/src/python/src/grpc/_adapter/_links_test.py +++ b/src/python/src/grpc/_adapter/_links_test.py @@ -60,9 +60,11 @@ class RoundTripTest(unittest.TestCase): test_fore_link = _test_links.ForeLink(None, None) def rear_action(front_to_back_ticket, fore_link): if front_to_back_ticket.kind in ( - tickets.Kind.COMPLETION, tickets.Kind.ENTIRE): + tickets.FrontToBackPacket.Kind.COMPLETION, + tickets.FrontToBackPacket.Kind.ENTIRE): back_to_front_ticket = tickets.BackToFrontPacket( - front_to_back_ticket.operation_id, 0, tickets.Kind.COMPLETION, None) + front_to_back_ticket.operation_id, 0, + tickets.BackToFrontPacket.Kind.COMPLETION, None) fore_link.accept_back_to_front_ticket(back_to_front_ticket) test_rear_link = _test_links.RearLink(rear_action, None) @@ -81,20 +83,24 @@ class RoundTripTest(unittest.TestCase): rear_link.start() front_to_back_ticket = tickets.FrontToBackPacket( - test_operation_id, 0, tickets.Kind.ENTIRE, test_method, - interfaces.ServicedSubscription.Kind.FULL, None, None, _TIMEOUT) + test_operation_id, 0, tickets.FrontToBackPacket.Kind.ENTIRE, + test_method, interfaces.ServicedSubscription.Kind.FULL, None, None, + _TIMEOUT) rear_link.accept_front_to_back_ticket(front_to_back_ticket) with test_fore_link.condition: while (not test_fore_link.tickets or - test_fore_link.tickets[-1].kind is tickets.Kind.CONTINUATION): + test_fore_link.tickets[-1].kind is + tickets.BackToFrontPacket.Kind.CONTINUATION): test_fore_link.condition.wait() rear_link.stop() fore_link.stop() with test_fore_link.condition: - self.assertIs(test_fore_link.tickets[-1].kind, tickets.Kind.COMPLETION) + self.assertIs( + test_fore_link.tickets[-1].kind, + tickets.BackToFrontPacket.Kind.COMPLETION) def testEntireRoundTrip(self): test_operation_id = object() @@ -109,11 +115,15 @@ class RoundTripTest(unittest.TestCase): else: payload = test_back_to_front_datum terminal = front_to_back_ticket.kind in ( - tickets.Kind.COMPLETION, tickets.Kind.ENTIRE) + tickets.FrontToBackPacket.Kind.COMPLETION, + tickets.FrontToBackPacket.Kind.ENTIRE) if payload is not None or terminal: + if terminal: + kind = tickets.BackToFrontPacket.Kind.COMPLETION + else: + kind = tickets.BackToFrontPacket.Kind.CONTINUATION back_to_front_ticket = tickets.BackToFrontPacket( - front_to_back_ticket.operation_id, rear_sequence_number[0], - tickets.Kind.COMPLETION if terminal else tickets.Kind.CONTINUATION, + front_to_back_ticket.operation_id, rear_sequence_number[0], kind, payload) rear_sequence_number[0] += 1 fore_link.accept_back_to_front_ticket(back_to_front_ticket) @@ -135,14 +145,15 @@ class RoundTripTest(unittest.TestCase): rear_link.start() front_to_back_ticket = tickets.FrontToBackPacket( - test_operation_id, 0, tickets.Kind.ENTIRE, test_method, - interfaces.ServicedSubscription.Kind.FULL, None, + test_operation_id, 0, tickets.FrontToBackPacket.Kind.ENTIRE, + test_method, interfaces.ServicedSubscription.Kind.FULL, None, test_front_to_back_datum, _TIMEOUT) rear_link.accept_front_to_back_ticket(front_to_back_ticket) with test_fore_link.condition: while (not test_fore_link.tickets or - test_fore_link.tickets[-1].kind is not tickets.Kind.COMPLETION): + test_fore_link.tickets[-1].kind is not + tickets.BackToFrontPacket.Kind.COMPLETION): test_fore_link.condition.wait() rear_link.stop() @@ -172,11 +183,15 @@ class RoundTripTest(unittest.TestCase): else: response = None terminal = front_to_back_ticket.kind in ( - tickets.Kind.COMPLETION, tickets.Kind.ENTIRE) + tickets.FrontToBackPacket.Kind.COMPLETION, + tickets.FrontToBackPacket.Kind.ENTIRE) if response is not None or terminal: + if terminal: + kind = tickets.BackToFrontPacket.Kind.COMPLETION + else: + kind = tickets.BackToFrontPacket.Kind.CONTINUATION back_to_front_ticket = tickets.BackToFrontPacket( - front_to_back_ticket.operation_id, rear_sequence_number[0], - tickets.Kind.COMPLETION if terminal else tickets.Kind.CONTINUATION, + front_to_back_ticket.operation_id, rear_sequence_number[0], kind, response) rear_sequence_number[0] += 1 fore_link.accept_back_to_front_ticket(back_to_front_ticket) @@ -199,25 +214,29 @@ class RoundTripTest(unittest.TestCase): rear_link.start() commencement_ticket = tickets.FrontToBackPacket( - test_operation_id, 0, tickets.Kind.COMMENCEMENT, test_method, - interfaces.ServicedSubscription.Kind.FULL, None, None, _TIMEOUT) + test_operation_id, 0, tickets.FrontToBackPacket.Kind.COMMENCEMENT, + test_method, interfaces.ServicedSubscription.Kind.FULL, None, None, + _TIMEOUT) fore_sequence_number = 1 rear_link.accept_front_to_back_ticket(commencement_ticket) for request in scenario.requests(): continuation_ticket = tickets.FrontToBackPacket( - test_operation_id, fore_sequence_number, tickets.Kind.CONTINUATION, - None, None, None, request, None) + test_operation_id, fore_sequence_number, + tickets.FrontToBackPacket.Kind.CONTINUATION, None, None, None, + request, None) fore_sequence_number += 1 rear_link.accept_front_to_back_ticket(continuation_ticket) completion_ticket = tickets.FrontToBackPacket( - test_operation_id, fore_sequence_number, tickets.Kind.COMPLETION, None, - None, None, None, None) + test_operation_id, fore_sequence_number, + tickets.FrontToBackPacket.Kind.COMPLETION, None, None, None, None, + None) fore_sequence_number += 1 rear_link.accept_front_to_back_ticket(completion_ticket) with test_fore_link.condition: while (not test_fore_link.tickets or - test_fore_link.tickets[-1].kind is not tickets.Kind.COMPLETION): + test_fore_link.tickets[-1].kind is not + tickets.BackToFrontPacket.Kind.COMPLETION): test_fore_link.condition.wait() rear_link.stop() diff --git a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py b/src/python/src/grpc/_adapter/_lonely_rear_link_test.py index 77821ba71a4..29c95d1d0a0 100644 --- a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py +++ b/src/python/src/grpc/_adapter/_lonely_rear_link_test.py @@ -76,22 +76,26 @@ class LonelyRearLinkTest(unittest.TestCase): with fore_link.condition: while True: if (fore_link.tickets and - fore_link.tickets[-1].kind is not packets.Kind.CONTINUATION): + fore_link.tickets[-1].kind is not + packets.BackToFrontPacket.Kind.CONTINUATION): break fore_link.condition.wait() rear_link.stop() with fore_link.condition: - self.assertIsNot(fore_link.tickets[-1].kind, packets.Kind.COMPLETION) + self.assertIsNot( + fore_link.tickets[-1].kind, + packets.BackToFrontPacket.Kind.COMPLETION) @unittest.skip('TODO(nathaniel): This seems to have broken in the last few weeks; fix it.') def testLonelyClientCommencementPacket(self): self._perform_lonely_client_test_with_ticket_kind( - packets.Kind.COMMENCEMENT) + packets.FrontToBackPacket.Kind.COMMENCEMENT) def testLonelyClientEntirePacket(self): - self._perform_lonely_client_test_with_ticket_kind(packets.Kind.ENTIRE) + self._perform_lonely_client_test_with_ticket_kind( + packets.FrontToBackPacket.Kind.ENTIRE) if __name__ == '__main__': diff --git a/src/python/src/grpc/_adapter/fore.py b/src/python/src/grpc/_adapter/fore.py index 339c0ef216c..16e5a2018cb 100644 --- a/src/python/src/grpc/_adapter/fore.py +++ b/src/python/src/grpc/_adapter/fore.py @@ -128,7 +128,7 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): self._response_serializers[method]) ticket = tickets.FrontToBackPacket( - call, 0, tickets.Kind.COMMENCEMENT, method, + call, 0, tickets.FrontToBackPacket.Kind.COMMENCEMENT, method, interfaces.ServicedSubscription.Kind.FULL, None, None, service_acceptance.deadline - time.time()) self._rear_link.accept_front_to_back_ticket(ticket) @@ -146,13 +146,13 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): rpc_state.sequence_number += 1 if event.bytes is None: ticket = tickets.FrontToBackPacket( - call, sequence_number, tickets.Kind.COMPLETION, None, None, None, - None, None) + call, sequence_number, tickets.FrontToBackPacket.Kind.COMPLETION, + None, None, None, None, None) else: call.read(call) ticket = tickets.FrontToBackPacket( - call, sequence_number, tickets.Kind.CONTINUATION, None, None, None, - rpc_state.deserializer(event.bytes), None) + call, sequence_number, tickets.FrontToBackPacket.Kind.CONTINUATION, + None, None, None, rpc_state.deserializer(event.bytes), None) self._rear_link.accept_front_to_back_ticket(ticket) @@ -181,7 +181,8 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): sequence_number = rpc_state.sequence_number rpc_state.sequence_number += 1 ticket = tickets.FrontToBackPacket( - call, sequence_number, tickets.Kind.TRANSMISSION_FAILURE, None, None, + call, sequence_number, + tickets.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, None, None, None, None, None) self._rear_link.accept_front_to_back_ticket(ticket) @@ -200,16 +201,17 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): rpc_state.sequence_number += 1 if code is _low.Code.CANCELLED: ticket = tickets.FrontToBackPacket( - call, sequence_number, tickets.Kind.CANCELLATION, None, None, None, - None, None) + call, sequence_number, tickets.FrontToBackPacket.Kind.CANCELLATION, + None, None, None, None, None) elif code is _low.Code.EXPIRED: ticket = tickets.FrontToBackPacket( - call, sequence_number, tickets.Kind.EXPIRATION, None, None, None, - None, None) + call, sequence_number, tickets.FrontToBackPacket.Kind.EXPIRATION, + None, None, None, None, None) else: # TODO(nathaniel): Better mapping of codes to ticket-categories ticket = tickets.FrontToBackPacket( - call, sequence_number, tickets.Kind.TRANSMISSION_FAILURE, None, None, + call, sequence_number, + tickets.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, None, None, None, None, None) self._rear_link.accept_front_to_back_ticket(ticket) @@ -351,9 +353,9 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): if self._server is None: return - if ticket.kind is tickets.Kind.CONTINUATION: + if ticket.kind is tickets.BackToFrontPacket.Kind.CONTINUATION: self._continue(ticket.operation_id, ticket.payload) - elif ticket.kind is tickets.Kind.COMPLETION: + elif ticket.kind is tickets.BackToFrontPacket.Kind.COMPLETION: self._complete(ticket.operation_id, ticket.payload) else: self._cancel(ticket.operation_id) diff --git a/src/python/src/grpc/_adapter/rear.py b/src/python/src/grpc/_adapter/rear.py index 62703fab30e..38936ed7ae8 100644 --- a/src/python/src/grpc/_adapter/rear.py +++ b/src/python/src/grpc/_adapter/rear.py @@ -154,7 +154,7 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): rpc_state.active = False ticket = tickets.BackToFrontPacket( operation_id, rpc_state.common.sequence_number, - tickets.Kind.TRANSMISSION_FAILURE, None) + tickets.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, None) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -165,7 +165,8 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): ticket = tickets.BackToFrontPacket( operation_id, rpc_state.common.sequence_number, - tickets.Kind.CONTINUATION, rpc_state.common.deserializer(event.bytes)) + tickets.BackToFrontPacket.Kind.CONTINUATION, + rpc_state.common.deserializer(event.bytes)) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -175,7 +176,7 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): rpc_state.active = False ticket = tickets.BackToFrontPacket( operation_id, rpc_state.common.sequence_number, - tickets.Kind.TRANSMISSION_FAILURE, None) + tickets.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, None) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -188,17 +189,16 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): """Handle termination of an RPC.""" # TODO(nathaniel): Cover all statuses. if event.status.code is _low.Code.OK: - category = tickets.Kind.COMPLETION + kind = tickets.BackToFrontPacket.Kind.COMPLETION elif event.status.code is _low.Code.CANCELLED: # TODO(issue 752): Use a CANCELLATION ticket kind here. - category = tickets.Kind.SERVICER_FAILURE + kind = tickets.BackToFrontPacket.Kind.SERVICER_FAILURE elif event.status.code is _low.Code.EXPIRED: - category = tickets.Kind.EXPIRATION + kind = tickets.BackToFrontPacket.Kind.EXPIRATION else: - category = tickets.Kind.TRANSMISSION_FAILURE + kind = tickets.BackToFrontPacket.Kind.TRANSMISSION_FAILURE ticket = tickets.BackToFrontPacket( - operation_id, rpc_state.common.sequence_number, category, - None) + operation_id, rpc_state.common.sequence_number, kind, None) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -372,17 +372,17 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): if self._completion_queue is None: return - if ticket.kind is tickets.Kind.COMMENCEMENT: + if ticket.kind is tickets.FrontToBackPacket.Kind.COMMENCEMENT: self._commence( ticket.operation_id, ticket.name, ticket.payload, ticket.timeout) - elif ticket.kind is tickets.Kind.CONTINUATION: + elif ticket.kind is tickets.FrontToBackPacket.Kind.CONTINUATION: self._continue(ticket.operation_id, ticket.payload) - elif ticket.kind is tickets.Kind.COMPLETION: + elif ticket.kind is tickets.FrontToBackPacket.Kind.COMPLETION: self._complete(ticket.operation_id, ticket.payload) - elif ticket.kind is tickets.Kind.ENTIRE: + elif ticket.kind is tickets.FrontToBackPacket.Kind.ENTIRE: self._entire( ticket.operation_id, ticket.name, ticket.payload, ticket.timeout) - elif ticket.kind is tickets.Kind.CANCELLATION: + elif ticket.kind is tickets.FrontToBackPacket.Kind.CANCELLATION: self._cancel(ticket.operation_id) else: # NOTE(nathaniel): All other categories are treated as cancellation. diff --git a/src/python/src/grpc/framework/base/packets/_reception.py b/src/python/src/grpc/framework/base/packets/_reception.py index becbef828dc..697095961ae 100644 --- a/src/python/src/grpc/framework/base/packets/_reception.py +++ b/src/python/src/grpc/framework/base/packets/_reception.py @@ -35,6 +35,11 @@ from grpc.framework.base import interfaces as base_interfaces from grpc.framework.base.packets import _interfaces from grpc.framework.base.packets import packets +_INITIAL_FRONT_TO_BACK_PACKET_KINDS = ( + packets.FrontToBackPacket.Kind.COMMENCEMENT, + packets.FrontToBackPacket.Kind.ENTIRE, +) + class _Receiver(object): """Common specification of different packet-handling behavior.""" @@ -151,15 +156,15 @@ class _BackReceiver(_Receiver): A base_interfaces.Outcome value describing operation abortion if the packet is abortive or None if the packet is not abortive. """ - if packet.kind is packets.Kind.CANCELLATION: + if packet.kind is packets.FrontToBackPacket.Kind.CANCELLATION: return base_interfaces.Outcome.CANCELLED - elif packet.kind is packets.Kind.EXPIRATION: + elif packet.kind is packets.FrontToBackPacket.Kind.EXPIRATION: return base_interfaces.Outcome.EXPIRED - elif packet.kind is packets.Kind.SERVICED_FAILURE: + elif packet.kind is packets.FrontToBackPacket.Kind.SERVICED_FAILURE: return base_interfaces.Outcome.SERVICED_FAILURE - elif packet.kind is packets.Kind.RECEPTION_FAILURE: + elif packet.kind is packets.FrontToBackPacket.Kind.RECEPTION_FAILURE: return base_interfaces.Outcome.SERVICED_FAILURE - elif (packet.kind in (packets.Kind.COMMENCEMENT, packets.Kind.ENTIRE) and + elif (packet.kind in _INITIAL_FRONT_TO_BACK_PACKET_KINDS and self._first_packet_seen): return base_interfaces.Outcome.RECEPTION_FAILURE elif self._last_packet_seen: @@ -179,14 +184,14 @@ class _BackReceiver(_Receiver): if packet.timeout is not None: self._expiration_manager.change_timeout(packet.timeout) - if packet.kind is packets.Kind.COMMENCEMENT: + if packet.kind is packets.FrontToBackPacket.Kind.COMMENCEMENT: self._first_packet_seen = True self._ingestion_manager.start(packet.name) if packet.payload is not None: self._ingestion_manager.consume(packet.payload) - elif packet.kind is packets.Kind.CONTINUATION: + elif packet.kind is packets.FrontToBackPacket.Kind.CONTINUATION: self._ingestion_manager.consume(packet.payload) - elif packet.kind is packets.Kind.COMPLETION: + elif packet.kind is packets.FrontToBackPacket.Kind.COMPLETION: self._last_packet_seen = True if packet.payload is None: self._ingestion_manager.terminate() @@ -239,11 +244,11 @@ class _FrontReceiver(_Receiver): A base_interfaces.Outcome value describing operation abortion if the packet is abortive or None if the packet is not abortive. """ - if packet.kind is packets.Kind.EXPIRATION: + if packet.kind is packets.BackToFrontPacket.Kind.EXPIRATION: return base_interfaces.Outcome.EXPIRED - elif packet.kind is packets.Kind.SERVICER_FAILURE: + elif packet.kind is packets.BackToFrontPacket.Kind.SERVICER_FAILURE: return base_interfaces.Outcome.SERVICER_FAILURE - elif packet.kind is packets.Kind.RECEPTION_FAILURE: + elif packet.kind is packets.BackToFrontPacket.Kind.RECEPTION_FAILURE: return base_interfaces.Outcome.SERVICER_FAILURE elif self._last_packet_seen: return base_interfaces.Outcome.RECEPTION_FAILURE @@ -259,9 +264,9 @@ class _FrontReceiver(_Receiver): def receive(self, packet): """See _Receiver.receive for specification.""" - if packet.kind is packets.Kind.CONTINUATION: + if packet.kind is packets.BackToFrontPacket.Kind.CONTINUATION: self._ingestion_manager.consume(packet.payload) - elif packet.kind is packets.Kind.COMPLETION: + elif packet.kind is packets.BackToFrontPacket.Kind.COMPLETION: self._last_packet_seen = True if packet.payload is None: self._ingestion_manager.terminate() diff --git a/src/python/src/grpc/framework/base/packets/_transmission.py b/src/python/src/grpc/framework/base/packets/_transmission.py index 002519b9a1c..9922213d0aa 100644 --- a/src/python/src/grpc/framework/base/packets/_transmission.py +++ b/src/python/src/grpc/framework/base/packets/_transmission.py @@ -47,15 +47,33 @@ _BACK_TO_FRONT_NO_TRANSMISSION_OUTCOMES = ( interfaces.Outcome.SERVICED_FAILURE, ) -_ABORTION_OUTCOME_TO_PACKET_KIND = { - interfaces.Outcome.CANCELLED: packets.Kind.CANCELLATION, - interfaces.Outcome.EXPIRED: packets.Kind.EXPIRATION, - interfaces.Outcome.RECEPTION_FAILURE: packets.Kind.RECEPTION_FAILURE, - interfaces.Outcome.TRANSMISSION_FAILURE: packets.Kind.TRANSMISSION_FAILURE, - interfaces.Outcome.SERVICED_FAILURE: packets.Kind.SERVICED_FAILURE, - interfaces.Outcome.SERVICER_FAILURE: packets.Kind.SERVICER_FAILURE, +_ABORTION_OUTCOME_TO_FRONT_TO_BACK_PACKET_KIND = { + interfaces.Outcome.CANCELLED: + packets.FrontToBackPacket.Kind.CANCELLATION, + interfaces.Outcome.EXPIRED: + packets.FrontToBackPacket.Kind.EXPIRATION, + interfaces.Outcome.RECEPTION_FAILURE: + packets.FrontToBackPacket.Kind.RECEPTION_FAILURE, + interfaces.Outcome.TRANSMISSION_FAILURE: + packets.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, + interfaces.Outcome.SERVICED_FAILURE: + packets.FrontToBackPacket.Kind.SERVICED_FAILURE, + interfaces.Outcome.SERVICER_FAILURE: + packets.FrontToBackPacket.Kind.SERVICER_FAILURE, } +_ABORTION_OUTCOME_TO_BACK_TO_FRONT_PACKET_KIND = { + interfaces.Outcome.EXPIRED: + packets.BackToFrontPacket.Kind.EXPIRATION, + interfaces.Outcome.RECEPTION_FAILURE: + packets.BackToFrontPacket.Kind.RECEPTION_FAILURE, + interfaces.Outcome.TRANSMISSION_FAILURE: + packets.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, + interfaces.Outcome.SERVICED_FAILURE: + packets.BackToFrontPacket.Kind.SERVICED_FAILURE, + interfaces.Outcome.SERVICER_FAILURE: + packets.BackToFrontPacket.Kind.SERVICER_FAILURE, +} class _Packetizer(object): @@ -120,24 +138,28 @@ class _FrontPacketizer(_Packetizer): def packetize(self, operation_id, sequence_number, payload, complete): """See _Packetizer.packetize for specification.""" if sequence_number: + if complete: + kind = packets.FrontToBackPacket.Kind.COMPLETION + else: + kind = packets.FrontToBackPacket.Kind.CONTINUATION return packets.FrontToBackPacket( - operation_id, sequence_number, - packets.Kind.COMPLETION if complete else packets.Kind.CONTINUATION, - self._name, self._subscription_kind, self._trace_id, payload, - self._timeout) + operation_id, sequence_number, kind, self._name, + self._subscription_kind, self._trace_id, payload, self._timeout) else: + if complete: + kind = packets.FrontToBackPacket.Kind.ENTIRE + else: + kind = packets.FrontToBackPacket.Kind.COMMENCEMENT return packets.FrontToBackPacket( - operation_id, 0, - packets.Kind.ENTIRE if complete else packets.Kind.COMMENCEMENT, - self._name, self._subscription_kind, self._trace_id, payload, - self._timeout) + operation_id, 0, kind, self._name, self._subscription_kind, + self._trace_id, payload, self._timeout) def packetize_abortion(self, operation_id, sequence_number, outcome): """See _Packetizer.packetize_abortion for specification.""" if outcome in _FRONT_TO_BACK_NO_TRANSMISSION_OUTCOMES: return None else: - kind = _ABORTION_OUTCOME_TO_PACKET_KIND[outcome] + kind = _ABORTION_OUTCOME_TO_FRONT_TO_BACK_PACKET_KIND[outcome] return packets.FrontToBackPacket( operation_id, sequence_number, kind, None, None, None, None, None) @@ -147,17 +169,19 @@ class _BackPacketizer(_Packetizer): def packetize(self, operation_id, sequence_number, payload, complete): """See _Packetizer.packetize for specification.""" + if complete: + kind = packets.BackToFrontPacket.Kind.COMPLETION + else: + kind = packets.BackToFrontPacket.Kind.CONTINUATION return packets.BackToFrontPacket( - operation_id, sequence_number, - packets.Kind.COMPLETION if complete else packets.Kind.CONTINUATION, - payload) + operation_id, sequence_number, kind, payload) def packetize_abortion(self, operation_id, sequence_number, outcome): """See _Packetizer.packetize_abortion for specification.""" if outcome in _BACK_TO_FRONT_NO_TRANSMISSION_OUTCOMES: return None else: - kind = _ABORTION_OUTCOME_TO_PACKET_KIND[outcome] + kind = _ABORTION_OUTCOME_TO_BACK_TO_FRONT_PACKET_KIND[outcome] return packets.BackToFrontPacket( operation_id, sequence_number, kind, None) diff --git a/src/python/src/grpc/framework/base/packets/packets.py b/src/python/src/grpc/framework/base/packets/packets.py index 9e2d4080b8c..d3f9a92aa07 100644 --- a/src/python/src/grpc/framework/base/packets/packets.py +++ b/src/python/src/grpc/framework/base/packets/packets.py @@ -36,22 +36,6 @@ import enum from grpc.framework.base import interfaces # pylint: disable=unused-import -@enum.unique -class Kind(enum.Enum): - """Identifies the overall kind of a ticket.""" - - COMMENCEMENT = 'commencement' - CONTINUATION = 'continuation' - COMPLETION = 'completion' - ENTIRE = 'entire' - CANCELLATION = 'cancellation' - EXPIRATION = 'expiration' - SERVICER_FAILURE = 'servicer failure' - SERVICED_FAILURE = 'serviced failure' - RECEPTION_FAILURE = 'reception failure' - TRANSMISSION_FAILURE = 'transmission failure' - - class FrontToBackPacket( collections.namedtuple( 'FrontToBackPacket', @@ -66,9 +50,7 @@ class FrontToBackPacket( packet's place among all the packets sent from front to back for this particular operation. Must be zero if kind is Kind.COMMENCEMENT or Kind.ENTIRE. Must be positive for any other kind. - kind: One of Kind.COMMENCEMENT, Kind.CONTINUATION, Kind.COMPLETION, - Kind.ENTIRE, Kind.CANCELLATION, Kind.EXPIRATION, Kind.SERVICED_FAILURE, - Kind.RECEPTION_FAILURE, or Kind.TRANSMISSION_FAILURE. + kind: A Kind value describing the overall kind of ticket. name: The name of an operation. Must be present if kind is Kind.COMMENCEMENT or Kind.ENTIRE. Must be None for any other kind. subscription: An interfaces.ServicedSubscription.Kind value describing the @@ -88,6 +70,21 @@ class FrontToBackPacket( operations. """ + @enum.unique + class Kind(enum.Enum): + """Identifies the overall kind of a FrontToBackPacket.""" + + COMMENCEMENT = 'commencement' + CONTINUATION = 'continuation' + COMPLETION = 'completion' + ENTIRE = 'entire' + CANCELLATION = 'cancellation' + EXPIRATION = 'expiration' + SERVICER_FAILURE = 'servicer failure' + SERVICED_FAILURE = 'serviced failure' + RECEPTION_FAILURE = 'reception failure' + TRANSMISSION_FAILURE = 'transmission failure' + class BackToFrontPacket( collections.namedtuple( @@ -101,11 +98,21 @@ class BackToFrontPacket( sequence_number: A zero-indexed integer sequence number identifying the packet's place among all the packets sent from back to front for this particular operation. - kind: One of Kind.CONTINUATION, Kind.COMPLETION, Kind.EXPIRATION, - Kind.SERVICER_FAILURE, Kind.RECEPTION_FAILURE, or - Kind.TRANSMISSION_FAILURE. + kind: A Kind value describing the overall kind of ticket. payload: A customer payload object. Must be present if kind is - Kind.CONTINUATION. May be None if kind is Kind.COMPLETION. Must be None if - kind is Kind.EXPIRATION, Kind.SERVICER_FAILURE, Kind.RECEPTION_FAILURE, or - Kind.TRANSMISSION_FAILURE. + Kind.CONTINUATION. May be None if kind is Kind.COMPLETION. Must be None + otherwise. """ + + @enum.unique + class Kind(enum.Enum): + """Identifies the overall kind of a BackToFrontPacket.""" + + # TODO(issue 752): Add CANCELLATION. + CONTINUATION = 'continuation' + COMPLETION = 'completion' + EXPIRATION = 'expiration' + SERVICER_FAILURE = 'servicer failure' + SERVICED_FAILURE = 'serviced failure' + RECEPTION_FAILURE = 'reception failure' + TRANSMISSION_FAILURE = 'transmission failure' From affe916405440dd043c6b49aa17d1a976d5f99e2 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Tue, 17 Mar 2015 01:10:22 +0000 Subject: [PATCH 43/75] Add at CANCELLATION back-to-front ticket kind This addresses issue #752. --- src/python/src/grpc/_adapter/rear.py | 3 +-- src/python/src/grpc/framework/base/packets/_reception.py | 4 +++- src/python/src/grpc/framework/base/packets/_transmission.py | 2 ++ src/python/src/grpc/framework/base/packets/packets.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/python/src/grpc/_adapter/rear.py b/src/python/src/grpc/_adapter/rear.py index 38936ed7ae8..eee008e4dfa 100644 --- a/src/python/src/grpc/_adapter/rear.py +++ b/src/python/src/grpc/_adapter/rear.py @@ -191,8 +191,7 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): if event.status.code is _low.Code.OK: kind = tickets.BackToFrontPacket.Kind.COMPLETION elif event.status.code is _low.Code.CANCELLED: - # TODO(issue 752): Use a CANCELLATION ticket kind here. - kind = tickets.BackToFrontPacket.Kind.SERVICER_FAILURE + kind = tickets.BackToFrontPacket.Kind.CANCELLATION elif event.status.code is _low.Code.EXPIRED: kind = tickets.BackToFrontPacket.Kind.EXPIRATION else: diff --git a/src/python/src/grpc/framework/base/packets/_reception.py b/src/python/src/grpc/framework/base/packets/_reception.py index 697095961ae..ef10c7f8fe5 100644 --- a/src/python/src/grpc/framework/base/packets/_reception.py +++ b/src/python/src/grpc/framework/base/packets/_reception.py @@ -244,7 +244,9 @@ class _FrontReceiver(_Receiver): A base_interfaces.Outcome value describing operation abortion if the packet is abortive or None if the packet is not abortive. """ - if packet.kind is packets.BackToFrontPacket.Kind.EXPIRATION: + if packet.kind is packets.BackToFrontPacket.Kind.CANCELLATION: + return base_interfaces.Outcome.CANCELLED + elif packet.kind is packets.BackToFrontPacket.Kind.EXPIRATION: return base_interfaces.Outcome.EXPIRED elif packet.kind is packets.BackToFrontPacket.Kind.SERVICER_FAILURE: return base_interfaces.Outcome.SERVICER_FAILURE diff --git a/src/python/src/grpc/framework/base/packets/_transmission.py b/src/python/src/grpc/framework/base/packets/_transmission.py index 9922213d0aa..1b18204ec51 100644 --- a/src/python/src/grpc/framework/base/packets/_transmission.py +++ b/src/python/src/grpc/framework/base/packets/_transmission.py @@ -63,6 +63,8 @@ _ABORTION_OUTCOME_TO_FRONT_TO_BACK_PACKET_KIND = { } _ABORTION_OUTCOME_TO_BACK_TO_FRONT_PACKET_KIND = { + interfaces.Outcome.CANCELLED: + packets.BackToFrontPacket.Kind.CANCELLATION, interfaces.Outcome.EXPIRED: packets.BackToFrontPacket.Kind.EXPIRATION, interfaces.Outcome.RECEPTION_FAILURE: diff --git a/src/python/src/grpc/framework/base/packets/packets.py b/src/python/src/grpc/framework/base/packets/packets.py index d3f9a92aa07..1b140481f0e 100644 --- a/src/python/src/grpc/framework/base/packets/packets.py +++ b/src/python/src/grpc/framework/base/packets/packets.py @@ -108,9 +108,9 @@ class BackToFrontPacket( class Kind(enum.Enum): """Identifies the overall kind of a BackToFrontPacket.""" - # TODO(issue 752): Add CANCELLATION. CONTINUATION = 'continuation' COMPLETION = 'completion' + CANCELLATION = 'cancellation' EXPIRATION = 'expiration' SERVICER_FAILURE = 'servicer failure' SERVICED_FAILURE = 'serviced failure' From 3dbaf171f9d9480605223b9bf16baf1a2b946c20 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Mon, 16 Mar 2015 18:35:53 -0700 Subject: [PATCH 44/75] Adds a dockerfile and script for building a tar archive containing protoc and the grpc plugins --- tools/dockerfile/grpc_dist_proto/Dockerfile | 73 +++++++++++++++++++++ tools/gce_setup/grpc_docker.sh | 52 +++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 tools/dockerfile/grpc_dist_proto/Dockerfile diff --git a/tools/dockerfile/grpc_dist_proto/Dockerfile b/tools/dockerfile/grpc_dist_proto/Dockerfile new file mode 100644 index 00000000000..a15b7ca4a61 --- /dev/null +++ b/tools/dockerfile/grpc_dist_proto/Dockerfile @@ -0,0 +1,73 @@ +# 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. + +# Dockerfile to build protoc and plugins for inclusion in a release. +FROM grpc/base + +# Install tools needed for building protoc. +RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev + +# Get the protobuf source from GitHub. +RUN mkdir -p /var/local/git +RUN git clone https://github.com/google/protobuf.git /var/local/git/protobuf + +# Build the protobuf library statically and install to /tmp/protoc_static. +WORKDIR /var/local/git/protobuf +RUN ./autogen.sh && \ + ./configure --disable-shared --prefix=/tmp/protoc_static \ + LDFLAGS="-lgcc_eh -static-libgcc -static-libstdc++" && \ + make -j12 && make check && make install + +# Build the protobuf library dynamically and install to /usr/local. +WORKDIR /var/local/git/protobuf +RUN ./autogen.sh && \ + ./configure --prefix=/usr/local && \ + make -j12 && make check && make install + +# Build the grpc plugins. +RUN git clone https://github.com/google/grpc.git /var/local/git/grpc +WORKDIR /var/local/git/grpc +RUN LDFLAGS=-static make plugins + +# Create an archive containing all the generated binaries. +RUN mkdir /tmp/proto_bins_root +RUN cp -v bins/opt/* /tmp/proto_bins_root +RUN cp -v /tmp/protoc_static/bin/protoc /tmp/proto_bins_root +RUN cd /tmp/proto_bins_root && \ + tar -czf /tmp/proto-bins-linux-$(uname -m).tar.gz * + +# List the tar contents: provides a way to visually confirm that the contents +# are correct. +RUN echo 'proto-bins-linux-tar-$(uname -m) contents:' && \ + tar -ztf /tmp/proto-bins-linux-$(uname -m).tar.gz + + + + + diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index 619eff56d62..44b5b459de9 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -663,6 +663,58 @@ grpc_show_servers() { gcloud compute $project_opt ssh $zone_opt $host --command "$cmd" } +_grpc_build_proto_bins_args() { + [[ -n $1 ]] && { # host + host=$1 + shift + } || { + host='grpc-docker-builder' + } +} + +# grpc_build_proto_bins +# +# - rebuilds the dist_proto docker image +# * doing this builds the protoc and the ruby, python and cpp bins statically +# +# - runs a docker command that copies the built protos to the GCE host +# - copies the built protos to the local machine +grpc_build_proto_bins() { + _grpc_ensure_gcloud_ssh || return 1; + + # declare vars local so that they don't pollute the shell environment + # where they this func is used. + local grpc_zone grpc_project dry_run # set by _grpc_set_project_and_zone + # set by _grpc_build_proto_bins_args + local host + + # set the project zone and check that all necessary args are provided + _grpc_set_project_and_zone -f _grpc_build_proto_bins_args "$@" || return 1 + gce_has_instance $grpc_project $host || return 1; + local project_opt="--project $grpc_project" + local zone_opt="--zone $grpc_zone" + + # rebuild the dist_proto image + local label='dist_proto' + grpc_update_image -- -h $host $label || return 1 + + # run a command to copy the generated output to the local machine + local docker_prefix='sudo docker run -v /tmp:/tmp/proto_bins_out' + local tar_name='proto-bins-linux-x86_64.tar.gz' + local cp_cmd="cp /tmp/$tar_name /tmp/proto_bins_out" + local cmd="$docker_prefix grpc/$label $cp_cmd" + local ssh_cmd="bash -l -c \"$cmd\"" + echo "will run:" + echo " $ssh_cmd" + echo "on $host" + gcloud compute $project_opt ssh $zone_opt $host --command "$cmd" || return 1 + + # copy the tar.gz locally + local rmt_tar="$host:/tmp/$tar_name" + local local_copy="$(pwd)/$tar_name" + gcloud compute copy-files $rmt_tar $local_copy $project_opt $zone_opt || return 1 +} + _grpc_launch_servers_args() { [[ -n $1 ]] && { # host host=$1 From 9ef929d78d33697d8a9d47170f78b9cb8d9c1594 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Tue, 17 Mar 2015 02:24:37 +0000 Subject: [PATCH 45/75] Reenable a disabled test method --- src/python/src/grpc/_adapter/_lonely_rear_link_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py b/src/python/src/grpc/_adapter/_lonely_rear_link_test.py index 29c95d1d0a0..ead0b9eb383 100644 --- a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py +++ b/src/python/src/grpc/_adapter/_lonely_rear_link_test.py @@ -88,7 +88,6 @@ class LonelyRearLinkTest(unittest.TestCase): fore_link.tickets[-1].kind, packets.BackToFrontPacket.Kind.COMPLETION) - @unittest.skip('TODO(nathaniel): This seems to have broken in the last few weeks; fix it.') def testLonelyClientCommencementPacket(self): self._perform_lonely_client_test_with_ticket_kind( packets.FrontToBackPacket.Kind.COMMENCEMENT) From 89d68bd7cf1863fbbe96017fa9a78c044b4e88a0 Mon Sep 17 00:00:00 2001 From: Julien Boeuf Date: Mon, 16 Mar 2015 22:55:57 -0700 Subject: [PATCH 46/75] Removing src/core/security/roots.pem I believe it was introduced by mistake here: https://github.com/grpc/grpc/commit/3f1e69668642c42372b2e54c502458dc8dbba1bf --- src/core/security/roots.pem | 2183 ----------------------------------- 1 file changed, 2183 deletions(-) delete mode 100644 src/core/security/roots.pem diff --git a/src/core/security/roots.pem b/src/core/security/roots.pem deleted file mode 100644 index 70990f1f824..00000000000 --- a/src/core/security/roots.pem +++ /dev/null @@ -1,2183 +0,0 @@ -# Issuer: CN=GTE CyberTrust Global Root O=GTE Corporation OU=GTE CyberTrust Solutions, Inc. -# Subject: CN=GTE CyberTrust Global Root O=GTE Corporation OU=GTE CyberTrust Solutions, Inc. -# Label: "GTE CyberTrust Global Root" -# Serial: 421 -# MD5 Fingerprint: ca:3d:d3:68:f1:03:5c:d0:32:fa:b8:2b:59:e8:5a:db -# SHA1 Fingerprint: 97:81:79:50:d8:1c:96:70:cc:34:d8:09:cf:79:44:31:36:7e:f4:74 -# SHA256 Fingerprint: a5:31:25:18:8d:21:10:aa:96:4b:02:c7:b7:c6:da:32:03:17:08:94:e5:fb:71:ff:fb:66:67:d5:e6:81:0a:36 ------BEGIN CERTIFICATE----- -MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD -VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv -bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv -b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV -UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU -cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds -b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH -iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS -r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4 -04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r -GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9 -3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P -lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ ------END CERTIFICATE----- - -# Issuer: CN=Thawte Server CA O=Thawte Consulting cc OU=Certification Services Division -# Subject: CN=Thawte Server CA O=Thawte Consulting cc OU=Certification Services Division -# Label: "Thawte Server CA" -# Serial: 1 -# MD5 Fingerprint: c5:70:c4:a2:ed:53:78:0c:c8:10:53:81:64:cb:d0:1d -# SHA1 Fingerprint: 23:e5:94:94:51:95:f2:41:48:03:b4:d5:64:d2:a3:a3:f5:d8:8b:8c -# SHA256 Fingerprint: b4:41:0b:73:e2:e6:ea:ca:47:fb:c4:2f:8f:a4:01:8a:f4:38:1d:c5:4c:fa:a8:44:50:46:1e:ed:09:45:4d:e9 ------BEGIN CERTIFICATE----- -MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD -VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm -MCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx -MDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT -DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3 -dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl -cyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3 -DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD -gY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91 -yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX -L+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj -EzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG -7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e -QNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ -qdq5snUb9kLy78fyGPmJvKP/iiMucEc= ------END CERTIFICATE----- - -# Issuer: CN=Thawte Premium Server CA O=Thawte Consulting cc OU=Certification Services Division -# Subject: CN=Thawte Premium Server CA O=Thawte Consulting cc OU=Certification Services Division -# Label: "Thawte Premium Server CA" -# Serial: 1 -# MD5 Fingerprint: 06:9f:69:79:16:66:90:02:1b:8c:8c:a2:c3:07:6f:3a -# SHA1 Fingerprint: 62:7f:8d:78:27:65:63:99:d2:7d:7f:90:44:c9:fe:b3:f3:3e:fa:9a -# SHA256 Fingerprint: ab:70:36:36:5c:71:54:aa:29:c2:c2:9f:5d:41:91:16:3b:16:2a:22:25:01:13:57:d5:6d:07:ff:a7:bc:1f:72 ------BEGIN CERTIFICATE----- -MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD -VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy -dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t -MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB -MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG -A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp -b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl -cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv -bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE -VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ -ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR -uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG -9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI -hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM -pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== ------END CERTIFICATE----- - -# Issuer: O=Equifax OU=Equifax Secure Certificate Authority -# Subject: O=Equifax OU=Equifax Secure Certificate Authority -# Label: "Equifax Secure CA" -# Serial: 903804111 -# MD5 Fingerprint: 67:cb:9d:c0:13:24:8a:82:9b:b2:17:1e:d1:1b:ec:d4 -# SHA1 Fingerprint: d2:32:09:ad:23:d3:14:23:21:74:e4:0d:7f:9d:62:13:97:86:63:3a -# SHA256 Fingerprint: 08:29:7a:40:47:db:a2:36:80:c7:31:db:6e:31:76:53:ca:78:48:e1:be:bd:3a:0b:01:79:a7:07:f9:2c:f1:78 ------BEGIN CERTIFICATE----- -MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV -UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy -dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1 -MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx -dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f -BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A -cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC -AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ -MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm -aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw -ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj -IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF -MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA -A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y -7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh -1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4 ------END CERTIFICATE----- - -# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority -# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority -# Label: "Verisign Class 3 Public Primary Certification Authority" -# Serial: 149843929435818692848040365716851702463 -# MD5 Fingerprint: 10:fc:63:5d:f6:26:3e:0d:f3:25:be:5f:79:cd:67:67 -# SHA1 Fingerprint: 74:2c:31:92:e6:07:e4:24:eb:45:49:54:2b:e1:bb:c5:3e:61:74:e2 -# SHA256 Fingerprint: e7:68:56:34:ef:ac:f6:9a:ce:93:9a:6b:25:5b:7b:4f:ab:ef:42:93:5b:50:a2:65:ac:b5:cb:60:27:e4:4e:70 ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz -cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 -MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV -BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE -BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is -I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G -CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do -lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc -AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k ------END CERTIFICATE----- - -# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority - G2/(c) 1998 VeriSign, Inc. - For authorized use only/VeriSign Trust Network -# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority - G2/(c) 1998 VeriSign, Inc. - For authorized use only/VeriSign Trust Network -# Label: "Verisign Class 3 Public Primary Certification Authority - G2" -# Serial: 167285380242319648451154478808036881606 -# MD5 Fingerprint: a2:33:9b:4c:74:78:73:d4:6c:e7:c1:f3:8d:cb:5c:e9 -# SHA1 Fingerprint: 85:37:1c:a6:e5:50:14:3d:ce:28:03:47:1b:de:3a:09:e8:f8:77:0f -# SHA256 Fingerprint: 83:ce:3c:12:29:68:8a:59:3d:48:5f:81:97:3c:0f:91:95:43:1e:da:37:cc:5e:36:43:0e:79:c7:a8:88:63:8b ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh -c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy -MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp -emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X -DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw -FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg -UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo -YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 -MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4 -pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0 -13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID -AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk -U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i -F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY -oJ2daZH9 ------END CERTIFICATE----- - -# Issuer: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA -# Subject: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA -# Label: "GlobalSign Root CA" -# Serial: 4835703278459707669005204 -# MD5 Fingerprint: 3e:45:52:15:09:51:92:e1:b7:5d:37:9f:b1:87:29:8a -# SHA1 Fingerprint: b1:bc:96:8b:d4:f4:9d:62:2a:a8:9a:81:f2:15:01:52:a4:1d:82:9c -# SHA256 Fingerprint: eb:d4:10:40:e4:bb:3e:c7:42:c9:e3:81:d3:1e:f2:a4:1a:48:b6:68:5c:96:e7:ce:f3:c1:df:6c:d4:33:1c:99 ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG -A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv -b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw -MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i -YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT -aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ -jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp -xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp -1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG -snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ -U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 -9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E -BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B -AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz -yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE -38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP -AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad -DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME -HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== ------END CERTIFICATE----- - -# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2 -# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2 -# Label: "GlobalSign Root CA - R2" -# Serial: 4835703278459682885658125 -# MD5 Fingerprint: 94:14:77:7e:3e:5e:fd:8f:30:bd:41:b0:cf:e7:d0:30 -# SHA1 Fingerprint: 75:e0:ab:b6:13:85:12:27:1c:04:f8:5f:dd:de:38:e4:b7:24:2e:fe -# SHA256 Fingerprint: ca:42:dd:41:74:5f:d0:b8:1e:b9:02:36:2c:f9:d8:bf:71:9d:a1:bd:1b:1e:fc:94:6f:5b:4c:99:f4:2c:1b:9e ------BEGIN CERTIFICATE----- -MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G -A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp -Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1 -MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG -A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL -v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8 -eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq -tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd -C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa -zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB -mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH -V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n -bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG -3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs -J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO -291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS -ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd -AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 -TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== ------END CERTIFICATE----- - -# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 1 Policy Validation Authority -# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 1 Policy Validation Authority -# Label: "ValiCert Class 1 VA" -# Serial: 1 -# MD5 Fingerprint: 65:58:ab:15:ad:57:6c:1e:a8:a7:b5:69:ac:bf:ff:eb -# SHA1 Fingerprint: e5:df:74:3c:b6:01:c4:9b:98:43:dc:ab:8c:e8:6a:81:10:9f:e4:8e -# SHA256 Fingerprint: f4:c1:49:55:1a:30:13:a3:5b:c7:bf:fe:17:a7:f3:44:9b:c1:ab:5b:5a:0a:e7:4b:06:c2:3b:90:00:4c:01:04 ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 -IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz -BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y -aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG -9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIyMjM0OFoXDTE5MDYy -NTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y -azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw -Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl -cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9Y -LqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIiGQj4/xEjm84H9b9pGib+ -TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCmDuJWBQ8Y -TfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0 -LBwGlN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLW -I8sogTLDAHkY7FkXicnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPw -nXS3qT6gpf+2SQMT2iLM7XGCK5nPOrf1LXLI ------END CERTIFICATE----- - -# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 2 Policy Validation Authority -# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 2 Policy Validation Authority -# Label: "ValiCert Class 2 VA" -# Serial: 1 -# MD5 Fingerprint: a9:23:75:9b:ba:49:36:6e:31:c2:db:f2:e7:66:ba:87 -# SHA1 Fingerprint: 31:7a:2a:d0:7f:2b:33:5e:f5:a1:c3:4e:4b:57:e8:b7:d8:f1:fc:a6 -# SHA256 Fingerprint: 58:d0:17:27:9c:d4:dc:63:ab:dd:b1:96:a6:c9:90:6c:30:c4:e0:87:83:ea:e8:c1:60:99:54:d6:93:55:59:6b ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 -IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz -BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y -aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG -9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy -NjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y -azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw -Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl -cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY -dA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9 -WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS -v4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v -UJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu -IYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC -W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd ------END CERTIFICATE----- - -# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 3 Policy Validation Authority -# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 3 Policy Validation Authority -# Label: "RSA Root Certificate 1" -# Serial: 1 -# MD5 Fingerprint: a2:6f:53:b7:ee:40:db:4a:68:e7:fa:18:d9:10:4b:72 -# SHA1 Fingerprint: 69:bd:8c:f4:9c:d3:00:fb:59:2e:17:93:ca:55:6a:f3:ec:aa:35:fb -# SHA256 Fingerprint: bc:23:f9:8a:31:3c:b9:2d:e3:bb:fc:3a:5a:9f:44:61:ac:39:49:4c:4a:e1:5a:9e:9d:f1:31:e9:9b:73:01:9a ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 -IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz -BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y -aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG -9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMjIzM1oXDTE5MDYy -NjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y -azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw -Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl -cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjmFGWHOjVsQaBalfD -cnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td3zZxFJmP3MKS8edgkpfs -2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89HBFx1cQqY -JJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliE -Zwgs3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJ -n0WuPIqpsHEzXcjFV9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/A -PhmcGcwTTYJBtYze4D1gCCAPRX5ron+jjBXu ------END CERTIFICATE----- - -# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only -# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only -# Label: "Verisign Class 3 Public Primary Certification Authority - G3" -# Serial: 206684696279472310254277870180966723415 -# MD5 Fingerprint: cd:68:b6:a7:c7:c4:ce:75:e0:1d:4f:57:44:61:92:09 -# SHA1 Fingerprint: 13:2d:0d:45:53:4b:69:97:cd:b2:d5:c3:39:e2:55:76:60:9b:5c:c6 -# SHA256 Fingerprint: eb:04:cf:5e:b1:f3:9a:fa:76:2f:2b:b1:20:f2:96:cb:a5:20:c1:b9:7d:b1:58:95:65:b8:1c:b9:a1:7b:72:44 ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD -VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT -aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ -bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu -IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b -N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t -KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu -kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm -CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ -Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu -imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te -2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe -DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC -/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p -F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt -TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== ------END CERTIFICATE----- - -# Issuer: CN=VeriSign Class 4 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only -# Subject: CN=VeriSign Class 4 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only -# Label: "Verisign Class 4 Public Primary Certification Authority - G3" -# Serial: 314531972711909413743075096039378935511 -# MD5 Fingerprint: db:c8:f2:27:2e:b1:ea:6a:29:23:5d:fe:56:3e:33:df -# SHA1 Fingerprint: c8:ec:8c:87:92:69:cb:4b:ab:39:e9:8d:7e:57:67:f3:14:95:73:9d -# SHA256 Fingerprint: e3:89:36:0d:0f:db:ae:b3:d2:50:58:4b:47:30:31:4e:22:2f:39:c1:56:a0:20:14:4e:8d:96:05:61:79:15:06 ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD -VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT -aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ -bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu -IENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK3LpRFpxlmr8Y+1 -GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaStBO3IFsJ -+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0Gbd -U6LM8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLm -NxdLMEYH5IBtptiWLugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XY -ufTsgsbSPZUd5cBPhMnZo0QoBmrXRazwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ -ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAj/ola09b5KROJ1WrIhVZPMq1 -CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXttmhwwjIDLk5Mq -g6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm -fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c -2NU8Qh0XwRJdRTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/ -bLvSHgCwIe34QWKCudiyxLtGUPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== ------END CERTIFICATE----- - -# Issuer: CN=Entrust.net Secure Server Certification Authority O=Entrust.net OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited -# Subject: CN=Entrust.net Secure Server Certification Authority O=Entrust.net OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited -# Label: "Entrust.net Secure Server CA" -# Serial: 927650371 -# MD5 Fingerprint: df:f2:80:73:cc:f1:e6:61:73:fc:f5:42:e9:c5:7c:ee -# SHA1 Fingerprint: 99:a6:9b:e6:1a:fe:88:6b:4d:2b:82:00:7c:b8:54:fc:31:7e:15:39 -# SHA256 Fingerprint: 62:f2:40:27:8c:56:4c:4d:d8:bf:7d:9d:4f:6f:36:6e:a8:94:d2:2f:5f:34:d9:89:a9:83:ac:ec:2f:ff:ed:50 ------BEGIN CERTIFICATE----- -MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC -VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u -ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc -KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u -ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1 -MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE -ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j -b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF -bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg -U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA -A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/ -I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3 -wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC -AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb -oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5 -BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p -dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk -MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp -b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu -dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0 -MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi -E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa -MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI -hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN -95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd -2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= ------END CERTIFICATE----- - -# Issuer: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited -# Subject: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited -# Label: "Entrust.net Premium 2048 Secure Server CA" -# Serial: 946059622 -# MD5 Fingerprint: ba:21:ea:20:d6:dd:db:8f:c1:57:8b:40:ad:a1:fc:fc -# SHA1 Fingerprint: 80:1d:62:d0:7b:44:9d:5c:5c:03:5c:98:ea:61:fa:44:3c:2a:58:fe -# SHA256 Fingerprint: d1:c3:39:ea:27:84:eb:87:0f:93:4f:c5:63:4e:4a:a9:ad:55:05:01:64:01:f2:64:65:d3:7a:57:46:63:35:9f ------BEGIN CERTIFICATE----- -MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML -RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp -bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 -IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0xOTEy -MjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 -LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp -YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG -A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq -K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe -sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX -MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT -XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ -HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH -4QIDAQABo3QwcjARBglghkgBhvhCAQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGA -vtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdERgL7YibkIozH5oSQJFrlwMB0G -CSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEA -WUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo -oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQ -h7A6tcOdBTcSo8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18 -f3v/rxzP5tsHrV7bhZ3QKw0z2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfN -B/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjXOP/swNlQ8C5LWK5Gb9Auw2DaclVy -vUxFnmG6v4SBkgPR0ml8xQ== ------END CERTIFICATE----- - -# Issuer: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust -# Subject: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust -# Label: "Baltimore CyberTrust Root" -# Serial: 33554617 -# MD5 Fingerprint: ac:b6:94:a5:9c:17:e0:d7:91:52:9b:b1:97:06:a6:e4 -# SHA1 Fingerprint: d4:de:20:d0:5e:66:fc:53:fe:1a:50:88:2c:78:db:28:52:ca:e4:74 -# SHA256 Fingerprint: 16:af:57:a9:f6:76:b0:ab:12:60:95:aa:5e:ba:de:f2:2a:b3:11:19:d6:44:ac:95:cd:4b:93:db:f3:f2:6a:eb ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ -RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD -VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX -DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y -ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy -VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr -mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr -IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK -mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu -XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy -dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye -jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 -BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 -DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 -9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx -jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 -Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz -ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS -R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp ------END CERTIFICATE----- - -# Issuer: CN=Equifax Secure Global eBusiness CA-1 O=Equifax Secure Inc. -# Subject: CN=Equifax Secure Global eBusiness CA-1 O=Equifax Secure Inc. -# Label: "Equifax Secure Global eBusiness CA" -# Serial: 1 -# MD5 Fingerprint: 8f:5d:77:06:27:c4:98:3c:5b:93:78:e7:d7:7d:9b:cc -# SHA1 Fingerprint: 7e:78:4a:10:1c:82:65:cc:2d:e1:f1:6d:47:b4:40:ca:d9:0a:19:45 -# SHA256 Fingerprint: 5f:0b:62:ea:b5:e3:53:ea:65:21:65:16:58:fb:b6:53:59:f4:43:28:0a:4a:fb:d1:04:d7:7d:10:f9:f0:4c:07 ------BEGIN CERTIFICATE----- -MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc -MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT -ZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw -MDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj -dXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l -c3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC -UdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc -58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/ -o5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH -MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr -aGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA -A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA -Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv -8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV ------END CERTIFICATE----- - -# Issuer: CN=Equifax Secure eBusiness CA-1 O=Equifax Secure Inc. -# Subject: CN=Equifax Secure eBusiness CA-1 O=Equifax Secure Inc. -# Label: "Equifax Secure eBusiness CA 1" -# Serial: 4 -# MD5 Fingerprint: 64:9c:ef:2e:44:fc:c6:8f:52:07:d0:51:73:8f:cb:3d -# SHA1 Fingerprint: da:40:18:8b:91:89:a3:ed:ee:ae:da:97:fe:2f:9d:f5:b7:d1:8a:41 -# SHA256 Fingerprint: cf:56:ff:46:a4:a1:86:10:9d:d9:65:84:b5:ee:b5:8a:51:0c:42:75:b0:e5:f9:4f:40:bb:ae:86:5e:19:f6:73 ------BEGIN CERTIFICATE----- -MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc -MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT -ZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw -MDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j -LjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ -KoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo -RvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu -WqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw -Env+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD -AQH/MB8GA1UdIwQYMBaAFEp4MlIR21kWNl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRK -eDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQFAAOBgQB1W6ibAxHm6VZM -zfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5lSE/9dR+ -WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN -/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ== ------END CERTIFICATE----- - -# Issuer: O=Equifax Secure OU=Equifax Secure eBusiness CA-2 -# Subject: O=Equifax Secure OU=Equifax Secure eBusiness CA-2 -# Label: "Equifax Secure eBusiness CA 2" -# Serial: 930140085 -# MD5 Fingerprint: aa:bf:bf:64:97:da:98:1d:6f:c6:08:3a:95:70:33:ca -# SHA1 Fingerprint: 39:4f:f6:85:0b:06:be:52:e5:18:56:cc:10:e1:80:e8:82:b3:85:cc -# SHA256 Fingerprint: 2f:27:4e:48:ab:a4:ac:7b:76:59:33:10:17:75:50:6d:c3:0e:e3:8e:f6:ac:d5:c0:49:32:cf:e0:41:23:42:20 ------BEGIN CERTIFICATE----- -MIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2Vj -dXJlIGVCdXNpbmVzcyBDQS0yMB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0 -NVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkVxdWlmYXggU2VjdXJlMSYwJAYD -VQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn2Z0G -vxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/ -BPO3QSQ5BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0C -AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEX -MBUGA1UEChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJl -IGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTkw -NjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9euSBIplBq -y/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQF -MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA -A4GBAAyGgq3oThr1jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy -0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1 -E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUmV+GRMOrN ------END CERTIFICATE----- - -# Issuer: CN=AddTrust Class 1 CA Root O=AddTrust AB OU=AddTrust TTP Network -# Subject: CN=AddTrust Class 1 CA Root O=AddTrust AB OU=AddTrust TTP Network -# Label: "AddTrust Low-Value Services Root" -# Serial: 1 -# MD5 Fingerprint: 1e:42:95:02:33:92:6b:b9:5f:c0:7f:da:d6:b2:4b:fc -# SHA1 Fingerprint: cc:ab:0e:a0:4c:23:01:d6:69:7b:dd:37:9f:cd:12:eb:24:e3:94:9d -# SHA256 Fingerprint: 8c:72:09:27:9a:c0:4e:27:5e:16:d0:7f:d3:b7:75:e8:01:54:b5:96:80:46:e3:1f:52:dd:25:76:63:24:e9:a7 ------BEGIN CERTIFICATE----- -MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 -b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMw -MTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYD -VQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ul -CDtbKRY654eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6n -tGO0/7Gcrjyvd7ZWxbWroulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyl -dI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1Zmne3yzxbrww2ywkEtvrNTVokMsAsJch -PXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJuiGMx1I4S+6+JNM3GOGvDC -+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8wHQYDVR0O -BBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8E -BTADAQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBl -MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFk -ZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENB -IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxtZBsfzQ3duQH6lmM0MkhHma6X -7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0PhiVYrqW9yTkkz -43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY -eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJl -pz/+0WatC7xrmYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOA -WiFeIc9TVPC6b4nbqKqVz4vjccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= ------END CERTIFICATE----- - -# Issuer: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network -# Subject: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network -# Label: "AddTrust External Root" -# Serial: 1 -# MD5 Fingerprint: 1d:35:54:04:85:78:b0:3f:42:42:4d:bf:20:73:0a:3f -# SHA1 Fingerprint: 02:fa:f3:e2:91:43:54:68:60:78:57:69:4d:f5:e4:5b:68:85:18:68 -# SHA256 Fingerprint: 68:7f:a4:51:38:22:78:ff:f0:c8:b1:1f:8d:43:d5:76:67:1c:6e:b2:bc:ea:b4:13:fb:83:d9:65:d0:6d:2f:f2 ------BEGIN CERTIFICATE----- -MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs -IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 -MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux -FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h -bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v -dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt -H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 -uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX -mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX -a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN -E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 -WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD -VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 -Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU -cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx -IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN -AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH -YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 -6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC -Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX -c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a -mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= ------END CERTIFICATE----- - -# Issuer: CN=AddTrust Public CA Root O=AddTrust AB OU=AddTrust TTP Network -# Subject: CN=AddTrust Public CA Root O=AddTrust AB OU=AddTrust TTP Network -# Label: "AddTrust Public Services Root" -# Serial: 1 -# MD5 Fingerprint: c1:62:3e:23:c5:82:73:9c:03:59:4b:2b:e9:77:49:7f -# SHA1 Fingerprint: 2a:b6:28:48:5e:78:fb:f3:ad:9e:79:10:dd:6b:df:99:72:2c:96:e5 -# SHA256 Fingerprint: 07:91:ca:07:49:b2:07:82:aa:d3:c7:d7:bd:0c:df:c9:48:58:35:84:3e:b2:d7:99:60:09:ce:43:ab:6c:69:27 ------BEGIN CERTIFICATE----- -MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 -b3JrMSAwHgYDVQQDExdBZGRUcnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAx -MDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtB -ZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIDAeBgNV -BAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV -6tsfSlbunyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nX -GCwwfQ56HmIexkvA/X1id9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnP -dzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSGAa2Il+tmzV7R/9x98oTaunet3IAIx6eH -1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAwHM+A+WD+eeSI8t0A65RF -62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0GA1UdDgQW -BBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUw -AwEB/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDEL -MAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRU -cnVzdCBUVFAgTmV0d29yazEgMB4GA1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJv -b3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4JNojVhaTdt02KLmuG7jD8WS6 -IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL+YPoRNWyQSW/ -iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao -GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh -4SINhwBk/ox9Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQm -XiLsks3/QppEIW1cxeMiHV9HEufOX1362KqxMy3ZdvJOOjMMK7MtkAY= ------END CERTIFICATE----- - -# Issuer: CN=AddTrust Qualified CA Root O=AddTrust AB OU=AddTrust TTP Network -# Subject: CN=AddTrust Qualified CA Root O=AddTrust AB OU=AddTrust TTP Network -# Label: "AddTrust Qualified Certificates Root" -# Serial: 1 -# MD5 Fingerprint: 27:ec:39:47:cd:da:5a:af:e2:9a:01:65:21:a9:4c:bb -# SHA1 Fingerprint: 4d:23:78:ec:91:95:39:b5:00:7f:75:8f:03:3b:21:1e:c5:4d:8b:cf -# SHA256 Fingerprint: 80:95:21:08:05:db:4b:bc:35:5e:44:28:d8:fd:6e:c2:cd:e3:ab:5f:b9:7a:99:42:98:8e:b8:f4:dc:d0:60:16 ------BEGIN CERTIFICATE----- -MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 -b3JrMSMwIQYDVQQDExpBZGRUcnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1 -MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcxCzAJBgNVBAYTAlNFMRQwEgYDVQQK -EwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIzAh -BgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwq -xBb/4Oxx64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G -87B4pfYOQnrjfxvM0PC3KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i -2O+tCBGaKZnhqkRFmhJePp1tUvznoD1oL/BLcHwTOK28FSXx1s6rosAx1i+f4P8U -WfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GRwVY18BTcZTYJbqukB8c1 -0cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HUMIHRMB0G -A1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0T -AQH/BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6Fr -pGkwZzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQL -ExRBZGRUcnVzdCBUVFAgTmV0d29yazEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlm -aWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv -hsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm -hpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X -dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3 -P6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y -iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no -xqE= ------END CERTIFICATE----- - -# Issuer: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc. -# Subject: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc. -# Label: "Entrust Root Certification Authority" -# Serial: 1164660820 -# MD5 Fingerprint: d6:a5:c3:ed:5d:dd:3e:00:c1:3d:87:92:1f:1d:3f:e4 -# SHA1 Fingerprint: b3:1e:b1:b7:40:e3:6c:84:02:da:dc:37:d4:4d:f5:d4:67:49:52:f9 -# SHA256 Fingerprint: 73:c1:76:43:4f:1b:c6:d5:ad:f4:5b:0e:76:e7:27:28:7c:8d:e5:76:16:c1:e6:e6:14:1a:2b:2c:bc:7d:8e:4c ------BEGIN CERTIFICATE----- -MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC -VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 -Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW -KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl -cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0MloXDTI2MTEyNzIw -NTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw -NwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSBy -ZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNV -BAMTJEVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBALaVtkNC+sZtKm9I35RMOVcF7sN5EUFo -Nu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYszA9u3g3s+IIRe7bJWKKf4 -4LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOwwCj0Yzfv9 -KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGI -rb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi -94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB -sDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi -gA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo -kORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE -vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA -A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t -O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua -AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP -9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/ -eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m -0vdXcDazv/wor3ElhVsT/h5/WrQ8 ------END CERTIFICATE----- - -# Issuer: CN=GeoTrust Global CA O=GeoTrust Inc. -# Subject: CN=GeoTrust Global CA O=GeoTrust Inc. -# Label: "GeoTrust Global CA" -# Serial: 144470 -# MD5 Fingerprint: f7:75:ab:29:fb:51:4e:b7:77:5e:ff:05:3c:99:8e:f5 -# SHA1 Fingerprint: de:28:f4:a4:ff:e5:b9:2f:a3:c5:03:d1:a3:49:a7:f9:96:2a:82:12 -# SHA256 Fingerprint: ff:85:6a:2d:25:1d:cd:88:d3:66:56:f4:50:12:67:98:cf:ab:aa:de:40:79:9c:72:2d:e4:d2:b5:db:36:a7:3a ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i -YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg -R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 -9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq -fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv -iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU -1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ -bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW -MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA -ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l -uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn -Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS -tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF -PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un -hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV -5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== ------END CERTIFICATE----- - -# Issuer: CN=GeoTrust Global CA 2 O=GeoTrust Inc. -# Subject: CN=GeoTrust Global CA 2 O=GeoTrust Inc. -# Label: "GeoTrust Global CA 2" -# Serial: 1 -# MD5 Fingerprint: 0e:40:a7:6c:de:03:5d:8f:d1:0f:e4:d1:8d:f9:6c:a9 -# SHA1 Fingerprint: a9:e9:78:08:14:37:58:88:f2:05:19:b0:6d:2b:0d:2b:60:16:90:7d -# SHA256 Fingerprint: ca:2d:82:a0:86:77:07:2f:8a:b6:76:4f:f0:35:67:6c:fe:3e:5e:32:5e:01:21:72:df:3f:92:09:6d:b7:9b:85 ------BEGIN CERTIFICATE----- -MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEW -MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFs -IENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3Qg -R2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvPE1A -PRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/NTL8 -Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hL -TytCOb1kLUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL -5mkWRxHCJ1kDs6ZgwiFAVvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7 -S4wMcoKK+xfNAGw6EzywhIdLFnopsk/bHdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe -2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE -FHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNHK266ZUap -EBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6td -EPx7srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv -/NgdRN3ggX+d6YvhZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywN -A0ZF66D0f0hExghAzN4bcLUprbqLOzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0 -abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkCx1YAzUm5s2x7UwQa4qjJqhIF -I8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqFH4z1Ir+rzoPz -4iIprn2DQKi6bA== ------END CERTIFICATE----- - -# Issuer: CN=GeoTrust Universal CA O=GeoTrust Inc. -# Subject: CN=GeoTrust Universal CA O=GeoTrust Inc. -# Label: "GeoTrust Universal CA" -# Serial: 1 -# MD5 Fingerprint: 92:65:58:8b:a2:1a:31:72:73:68:5c:b4:a5:7a:07:48 -# SHA1 Fingerprint: e6:21:f3:35:43:79:05:9a:4b:68:30:9d:8a:2f:74:22:15:87:ec:79 -# SHA256 Fingerprint: a0:45:9b:9f:63:b2:25:59:f5:fa:5d:4c:6d:b3:f9:f7:2f:f1:93:42:03:35:78:f0:73:bf:1d:1b:46:cb:b9:12 ------BEGIN CERTIFICATE----- -MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW -MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVy -c2FsIENBMB4XDTA0MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UE -BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0 -IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKYV -VaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9tJPi8 -cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTT -QjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFh -F7em6fgemdtzbvQKoiFs7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2v -c7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d8Lsrlh/eezJS/R27tQahsiFepdaVaH/w -mZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7VqnJNk22CDtucvc+081xd -VHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3CgaRr0BHdCX -teGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZ -f9hBZ3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfRe -Bi9Fi1jUIxaS5BZuKGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+ -nhutxx9z3SxPGWX9f5NAEC7S8O08ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB -/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0XG0D08DYj3rWMB8GA1UdIwQY -MBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG -9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc -aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX -IwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn -ANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z -uzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN -Pnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja -QI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW -koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9 -ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt -DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm -bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw= ------END CERTIFICATE----- - -# Issuer: CN=GeoTrust Universal CA 2 O=GeoTrust Inc. -# Subject: CN=GeoTrust Universal CA 2 O=GeoTrust Inc. -# Label: "GeoTrust Universal CA 2" -# Serial: 1 -# MD5 Fingerprint: 34:fc:b8:d0:36:db:9e:14:b3:c2:f2:db:8f:e4:94:c7 -# SHA1 Fingerprint: 37:9a:19:7b:41:85:45:35:0c:a6:03:69:f3:3c:2e:af:47:4f:20:79 -# SHA256 Fingerprint: a0:23:4f:3b:c8:52:7c:a5:62:8e:ec:81:ad:5d:69:89:5d:a5:68:0d:c9:1d:1c:b8:47:7f:33:f8:78:b9:5b:0b ------BEGIN CERTIFICATE----- -MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEW -MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVy -c2FsIENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYD -VQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1 -c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC -AQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0DE81 -WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUG -FF+3Qs17j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdq -XbboW0W63MOhBW9Wjo8QJqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxL -se4YuU6W3Nx2/zu+z18DwPw76L5GG//aQMJS9/7jOvdqdzXQ2o3rXhhqMcceujwb -KNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2WP0+GfPtDCapkzj4T8Fd -IgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP20gaXT73 -y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRt -hAAnZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgoc -QIgfksILAAX/8sgCSqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4 -Lt1ZrtmhN79UNdxzMk+MBB4zsslG8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAfBgNV -HSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8EBAMCAYYwDQYJ -KoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z -dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQ -L1EuxBRa3ugZ4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgr -Fg5fNuH8KrUwJM/gYwx7WBr+mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSo -ag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpqA1Ihn0CoZ1Dy81of398j9tx4TuaY -T1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpgY+RdM4kX2TGq2tbz -GDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiPpm8m -1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJV -OCiNUW7dFGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH -6aLcr34YEoP9VhdBLtUpgn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwX -QMAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS ------END CERTIFICATE----- - -# Issuer: CN=America Online Root Certification Authority 1 O=America Online Inc. -# Subject: CN=America Online Root Certification Authority 1 O=America Online Inc. -# Label: "America Online Root Certification Authority 1" -# Serial: 1 -# MD5 Fingerprint: 14:f1:08:ad:9d:fa:64:e2:89:e7:1c:cf:a8:ad:7d:5e -# SHA1 Fingerprint: 39:21:c1:15:c1:5d:0e:ca:5c:cb:5b:c4:f0:7d:21:d8:05:0b:56:6a -# SHA256 Fingerprint: 77:40:73:12:c6:3a:15:3d:5b:c0:0b:4e:51:75:9c:df:da:c2:37:dc:2a:33:b6:79:46:e9:8e:9b:fa:68:0a:e3 ------BEGIN CERTIFICATE----- -MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc -MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP -bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2 -MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft -ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lk -hsmj76CGv2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym -1BW32J/X3HGrfpq/m44zDyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsW -OqMFf6Dch9Wc/HKpoH145LcxVR5lu9RhsCFg7RAycsWSJR74kEoYeEfffjA3PlAb -2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP8c9GsEsPPt2IYriMqQko -O3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAU -AK3Zo/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB -BQUAA4IBAQB8itEfGDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkF -Zu90821fnZmv9ov761KyBZiibyrFVL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAb -LjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft3OJvx8Fi8eNy1gTIdGcL+oir -oQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43gKd8hdIaC2y+C -MMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds -sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 ------END CERTIFICATE----- - -# Issuer: CN=America Online Root Certification Authority 2 O=America Online Inc. -# Subject: CN=America Online Root Certification Authority 2 O=America Online Inc. -# Label: "America Online Root Certification Authority 2" -# Serial: 1 -# MD5 Fingerprint: d6:ed:3c:ca:e2:66:0f:af:10:43:0d:77:9b:04:09:bf -# SHA1 Fingerprint: 85:b5:ff:67:9b:0c:79:96:1f:c8:6e:44:22:00:46:13:db:17:92:84 -# SHA256 Fingerprint: 7d:3b:46:5a:60:14:e5:26:c0:af:fc:ee:21:27:d2:31:17:27:ad:81:1c:26:84:2d:00:6a:f3:73:06:cc:80:bd ------BEGIN CERTIFICATE----- -MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc -MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP -bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2 -MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft -ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP -ADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC -206B89enfHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFci -KtZHgVdEglZTvYYUAQv8f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2 -JxhP7JsowtS013wMPgwr38oE18aO6lhOqKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9 -BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JNRvCAOVIyD+OEsnpD8l7e -Xz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0gBe4lL8B -PeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67 -Xnfn6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEq -Z8A9W6Wa6897GqidFEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZ -o2C7HK2JNDJiuEMhBnIMoVxtRsX6Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3 -+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnjB453cMor9H124HhnAgMBAAGj -YzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3OpaaEg5+31IqEj -FNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE -AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmn -xPBUlgtk87FYT15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2 -LHo1YGwRgJfMqZJS5ivmae2p+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzccc -obGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXgJXUjhx5c3LqdsKyzadsXg8n33gy8 -CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//ZoyzH1kUQ7rVyZ2OuMe -IjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgOZtMA -DjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2F -AjgQ5ANh1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUX -Om/9riW99XJZZLF0KjhfGEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPb -AZO1XB4Y3WRayhgoPmMEEf0cjQAPuDffZ4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQl -Zvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuPcX/9XhmgD0uRuMRUvAaw -RY8mkaKO/qk= ------END CERTIFICATE----- - -# Issuer: CN=AAA Certificate Services O=Comodo CA Limited -# Subject: CN=AAA Certificate Services O=Comodo CA Limited -# Label: "Comodo AAA Services root" -# Serial: 1 -# MD5 Fingerprint: 49:79:04:b0:eb:87:19:ac:47:b0:bc:11:51:9b:74:d0 -# SHA1 Fingerprint: d1:eb:23:a4:6d:17:d6:8f:d9:25:64:c2:f1:f1:60:17:64:d8:e3:49 -# SHA256 Fingerprint: d7:a7:a0:fb:5d:7e:27:31:d7:71:e9:48:4e:bc:de:f7:1d:5f:0c:3e:0a:29:48:78:2b:c8:3e:e0:ea:69:9e:f4 ------BEGIN CERTIFICATE----- -MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj -YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL -MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE -BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM -GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua -BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe -3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 -YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR -rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm -ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU -oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF -MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v -QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t -b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF -AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q -GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz -Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 -G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi -l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 -smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== ------END CERTIFICATE----- - -# Issuer: CN=Secure Certificate Services O=Comodo CA Limited -# Subject: CN=Secure Certificate Services O=Comodo CA Limited -# Label: "Comodo Secure Services root" -# Serial: 1 -# MD5 Fingerprint: d3:d9:bd:ae:9f:ac:67:24:b3:c8:1b:52:e1:b9:a9:bd -# SHA1 Fingerprint: 4a:65:d5:f4:1d:ef:39:b8:b8:90:4a:4a:d3:64:81:33:cf:c7:a1:d1 -# SHA256 Fingerprint: bd:81:ce:3b:4f:65:91:d1:1a:67:b5:fc:7a:47:fd:ef:25:52:1b:f9:aa:4e:18:b9:e3:df:2e:34:a7:80:3b:e8 ------BEGIN CERTIFICATE----- -MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRp -ZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVow -fjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAiBgNV -BAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPM -cm3ye5drswfxdySRXyWP9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3S -HpR7LZQdqnXXs5jLrLxkU0C8j6ysNstcrbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996 -CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rCoznl2yY4rYsK7hljxxwk -3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3Vp6ea5EQz -6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNV -HQ4EFgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1Ud -EwEB/wQFMAMBAf8wgYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2Rv -Y2EuY29tL1NlY3VyZUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRw -Oi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmww -DQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm4J4oqF7Tt/Q0 -5qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj -Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtI -gKvcnDe4IRRLDXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJ -aD61JlfutuC23bkpgHl9j6PwpCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDl -izeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1HRR3B7Hzs/Sk= ------END CERTIFICATE----- - -# Issuer: CN=Trusted Certificate Services O=Comodo CA Limited -# Subject: CN=Trusted Certificate Services O=Comodo CA Limited -# Label: "Comodo Trusted Services root" -# Serial: 1 -# MD5 Fingerprint: 91:1b:3f:6e:cd:9e:ab:ee:07:fe:1f:71:d2:b3:61:27 -# SHA1 Fingerprint: e1:9f:e3:0e:8b:84:60:9e:80:9b:17:0d:72:a8:c5:ba:6e:14:09:bd -# SHA256 Fingerprint: 3f:06:e5:56:81:d4:96:f5:be:16:9e:b5:38:9f:9f:2b:8f:f6:1e:17:08:df:68:81:72:48:49:cd:5d:27:cb:69 ------BEGIN CERTIFICATE----- -MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0 -aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEwMDAwMDBaFw0yODEyMzEyMzU5NTla -MH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO -BgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUwIwYD -VQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWW -fnJSoBVC21ndZHoa0Lh73TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMt -TGo87IvDktJTdyR0nAducPy9C1t2ul/y/9c3S0pgePfw+spwtOpZqqPOSC+pw7IL -fhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6juljatEPmsbS9Is6FARW -1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsSivnkBbA7 -kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0G -A1UdDgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYD -VR0TAQH/BAUwAwEB/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21v -ZG9jYS5jb20vVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRo -dHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMu -Y3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8NtwuleGFTQQuS9/ -HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 -pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxIS -jBc/lDb+XbDABHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+ -xqFx7D+gIIxmOom0jtTYsU0lR+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/Atyjcn -dBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O9y5Xt5hwXsjEeLBi ------END CERTIFICATE----- - -# Issuer: CN=UTN - DATACorp SGC O=The USERTRUST Network OU=http://www.usertrust.com -# Subject: CN=UTN - DATACorp SGC O=The USERTRUST Network OU=http://www.usertrust.com -# Label: "UTN DATACorp SGC Root CA" -# Serial: 91374294542884689855167577680241077609 -# MD5 Fingerprint: b3:a5:3e:77:21:6d:ac:4a:c0:c9:fb:d5:41:3d:ca:06 -# SHA1 Fingerprint: 58:11:9f:0e:12:82:87:ea:50:fd:d9:87:45:6f:4f:78:dc:fa:d6:d4 -# SHA256 Fingerprint: 85:fb:2f:91:dd:12:27:5a:01:45:b6:36:53:4f:84:02:4a:d6:8b:69:b8:ee:88:68:4f:f7:11:37:58:05:b3:48 ------BEGIN CERTIFICATE----- -MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCB -kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug -Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho -dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw -IFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBaMIGTMQswCQYDVQQG -EwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYD -VQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cu -dXNlcnRydXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6 -E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ysraP6LnD43m77VkIVni5c7yPeIbkFdicZ -D0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlowHDyUwDAXlCCpVZvNvlK -4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA9P4yPykq -lXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulW -bfXv33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQAB -o4GrMIGoMAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRT -MtGzz3/64PGgXYVOktKeRR20TzA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js -LnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr -BgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB -AQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft -Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj -j98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH -KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv -2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3 -mfnGV/TJVTl4uix5yaaIK/QI ------END CERTIFICATE----- - -# Issuer: CN=UTN-USERFirst-Hardware O=The USERTRUST Network OU=http://www.usertrust.com -# Subject: CN=UTN-USERFirst-Hardware O=The USERTRUST Network OU=http://www.usertrust.com -# Label: "UTN USERFirst Hardware Root CA" -# Serial: 91374294542884704022267039221184531197 -# MD5 Fingerprint: 4c:56:41:e5:0d:bb:2b:e8:ca:a3:ed:18:08:ad:43:39 -# SHA1 Fingerprint: 04:83:ed:33:99:ac:36:08:05:87:22:ed:bc:5e:46:00:e3:be:f9:d7 -# SHA256 Fingerprint: 6e:a5:47:41:d0:04:66:7e:ed:1b:48:16:63:4a:a3:a7:9e:6e:4b:96:95:0f:82:79:da:fc:8d:9b:d8:81:21:37 ------BEGIN CERTIFICATE----- -MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB -lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug -Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho -dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt -SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG -A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe -MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v -d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh -cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn -0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ -M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a -MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd -oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI -DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy -oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD -VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0 -dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy -bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF -BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM -//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli -CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE -CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t -3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS -KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA== ------END CERTIFICATE----- - -# Issuer: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com -# Subject: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com -# Label: "XRamp Global CA Root" -# Serial: 107108908803651509692980124233745014957 -# MD5 Fingerprint: a1:0b:44:b3:ca:10:d8:00:6e:9d:0f:d8:0f:92:0a:d1 -# SHA1 Fingerprint: b8:01:86:d1:eb:9c:86:a5:41:04:cf:30:54:f3:4c:52:b7:e5:58:c6 -# SHA256 Fingerprint: ce:cd:dc:90:50:99:d8:da:df:c5:b1:d2:09:b7:37:cb:e2:c1:8c:fb:2c:10:c0:ff:0b:cf:0d:32:86:fc:1a:a2 ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB -gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk -MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY -UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx -NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3 -dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy -dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6 -38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP -KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q -DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4 -qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa -JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi -PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P -BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs -jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0 -eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD -ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR -vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt -qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa -IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy -i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ -O+7ETPTsJ3xCwnR8gooJybQDJbw= ------END CERTIFICATE----- - -# Issuer: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority -# Subject: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority -# Label: "Go Daddy Class 2 CA" -# Serial: 0 -# MD5 Fingerprint: 91:de:06:25:ab:da:fd:32:17:0c:bb:25:17:2a:84:67 -# SHA1 Fingerprint: 27:96:ba:e6:3f:18:01:e2:77:26:1b:a0:d7:77:70:02:8f:20:ee:e4 -# SHA256 Fingerprint: c3:84:6b:f2:4b:9e:93:ca:64:27:4c:0e:c6:7c:1e:cc:5e:02:4f:fc:ac:d2:d7:40:19:35:0e:81:fe:54:6a:e4 ------BEGIN CERTIFICATE----- -MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh -MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE -YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3 -MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo -ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg -MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN -ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA -PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w -wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi -EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY -avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+ -YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE -sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h -/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5 -IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD -ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy -OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P -TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ -HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER -dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf -ReYNnyicsbkqWletNw+vHX/bvZ8= ------END CERTIFICATE----- - -# Issuer: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority -# Subject: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority -# Label: "Starfield Class 2 CA" -# Serial: 0 -# MD5 Fingerprint: 32:4a:4b:bb:c8:63:69:9b:be:74:9a:c6:dd:1d:46:24 -# SHA1 Fingerprint: ad:7e:1c:28:b0:64:ef:8f:60:03:40:20:14:c3:d0:e3:37:0e:b5:8a -# SHA256 Fingerprint: 14:65:fa:20:53:97:b8:76:fa:a6:f0:a9:95:8e:55:90:e4:0f:cc:7f:aa:4f:b7:c2:c8:67:75:21:fb:5f:b6:58 ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl -MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp -U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw -NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE -ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp -ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3 -DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf -8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN -+lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0 -X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa -K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA -1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G -A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR -zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0 -YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD -bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w -DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3 -L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D -eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl -xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp -VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY -WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q= ------END CERTIFICATE----- - -# Issuer: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing -# Subject: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing -# Label: "StartCom Certification Authority" -# Serial: 1 -# MD5 Fingerprint: 22:4d:8f:8a:fc:f7:35:c2:bb:57:34:90:7b:8b:22:16 -# SHA1 Fingerprint: 3e:2b:f7:f2:03:1b:96:f3:8c:e6:c4:d8:a8:5d:3e:2d:58:47:6a:0f -# SHA256 Fingerprint: c7:66:a9:be:f2:d4:07:1c:86:3a:31:aa:49:20:e8:13:b2:d1:98:60:8c:b7:b7:cf:e2:11:43:b8:36:df:09:ea ------BEGIN CERTIFICATE----- -MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW -MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg -Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM2WhcNMzYwOTE3MTk0NjM2WjB9 -MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi -U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh -cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk -pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf -OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C -Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT -Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi -HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM -Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w -+2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ -Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 -Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B -26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID -AQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE -FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9j -ZXJ0LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3Js -LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFM -BgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUHAgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0 -Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRwOi8vY2VydC5zdGFy -dGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYgU3Rh -cnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlh -YmlsaXR5LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2Yg -dGhlIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFp -bGFibGUgYXQgaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL3BvbGljeS5wZGYwEQYJ -YIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNT -TCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOCAgEAFmyZ -9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8 -jhvh3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUW -FjgKXlf2Ysd6AgXmvB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJz -ewT4F+irsfMuXGRuczE6Eri8sxHkfY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1 -ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3fsNrarnDy0RLrHiQi+fHLB5L -EUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZEoalHmdkrQYu -L6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq -yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuC -O3NJo2pXh5Tl1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6V -um0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh -NOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14= ------END CERTIFICATE----- - -# Issuer: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com -# Subject: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com -# Label: "DigiCert Assured ID Root CA" -# Serial: 17154717934120587862167794914071425081 -# MD5 Fingerprint: 87:ce:0b:7b:2a:0e:49:00:e1:58:71:9b:37:a8:93:72 -# SHA1 Fingerprint: 05:63:b8:63:0d:62:d7:5a:bb:c8:ab:1e:4b:df:b5:a8:99:b2:4d:43 -# SHA256 Fingerprint: 3e:90:99:b5:01:5e:8f:48:6c:00:bc:ea:9d:11:1e:e7:21:fa:ba:35:5a:89:bc:f1:df:69:56:1e:3d:c6:32:5c ------BEGIN CERTIFICATE----- -MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv -b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl -cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi -MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c -JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP -mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+ -wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4 -VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/ -AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB -AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW -BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun -pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC -dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf -fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm -NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx -H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe -+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== ------END CERTIFICATE----- - -# Issuer: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com -# Subject: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com -# Label: "DigiCert Global Root CA" -# Serial: 10944719598952040374951832963794454346 -# MD5 Fingerprint: 79:e4:a9:84:0d:7d:3a:96:d7:c0:4f:e2:43:4c:89:2e -# SHA1 Fingerprint: a8:98:5d:3a:65:e5:e5:c4:b2:d7:d6:6d:40:c6:dd:2f:b1:9c:54:36 -# SHA256 Fingerprint: 43:48:a0:e9:44:4c:78:cb:26:5e:05:8d:5e:89:44:b4:d8:4f:96:62:bd:26:db:25:7f:89:34:a4:43:c7:01:61 ------BEGIN CERTIFICATE----- -MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD -QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT -MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j -b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB -CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 -nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt -43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P -T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 -gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO -BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR -TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw -DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr -hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg -06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF -PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls -YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk -CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= ------END CERTIFICATE----- - -# Issuer: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com -# Subject: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com -# Label: "DigiCert High Assurance EV Root CA" -# Serial: 3553400076410547919724730734378100087 -# MD5 Fingerprint: d4:74:de:57:5c:39:b2:d3:9c:85:83:c5:c0:65:49:8a -# SHA1 Fingerprint: 5f:b7:ee:06:33:e2:59:db:ad:0c:4c:9a:e6:d3:8f:1a:61:c7:dc:25 -# SHA256 Fingerprint: 74:31:e5:f4:c3:c1:ce:46:90:77:4f:0b:61:e0:54:40:88:3b:a9:a0:1e:d0:0b:a6:ab:d7:80:6e:d3:b1:18:cf ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j -ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL -MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 -LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug -RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm -+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW -PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM -xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB -Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 -hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg -EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF -MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA -FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec -nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z -eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF -hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 -Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe -vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep -+OkuE6N36B9K ------END CERTIFICATE----- - -# Issuer: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc. -# Subject: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc. -# Label: "GeoTrust Primary Certification Authority" -# Serial: 32798226551256963324313806436981982369 -# MD5 Fingerprint: 02:26:c3:01:5e:08:30:37:43:a9:d0:7d:cf:37:e6:bf -# SHA1 Fingerprint: 32:3c:11:8e:1b:f7:b8:b6:52:54:e2:e2:10:0d:d6:02:90:37:f0:96 -# SHA256 Fingerprint: 37:d5:10:06:c5:12:ea:ab:62:64:21:f1:ec:8c:92:01:3f:c5:f8:2a:e9:8e:e5:33:eb:46:19:b8:de:b4:d0:6c ------BEGIN CERTIFICATE----- -MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo -R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx -MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK -Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9 -AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA -ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0 -7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W -kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI -mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G -A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ -KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1 -6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl -4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K -oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj -UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU -AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= ------END CERTIFICATE----- - -# Issuer: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only -# Subject: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only -# Label: "thawte Primary Root CA" -# Serial: 69529181992039203566298953787712940909 -# MD5 Fingerprint: 8c:ca:dc:0b:22:ce:f5:be:72:ac:41:1a:11:a8:d8:12 -# SHA1 Fingerprint: 91:c6:d6:ee:3e:8a:c8:63:84:e5:48:c2:99:29:5c:75:6c:81:7b:81 -# SHA256 Fingerprint: 8d:72:2f:81:a9:c1:13:c0:79:1d:f1:36:a2:96:6d:b2:6c:95:0a:97:1d:b4:6b:41:99:f4:ea:54:b7:8b:fb:9f ------BEGIN CERTIFICATE----- -MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB -qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf -Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw -MDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV -BAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw -NzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j -LjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG -A1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs -W0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta -3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk -6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6 -Sk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J -NqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA -MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP -r87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU -DW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz -YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX -xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2 -/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/ -LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7 -jVaMaA== ------END CERTIFICATE----- - -# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only -# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only -# Label: "VeriSign Class 3 Public Primary Certification Authority - G5" -# Serial: 33037644167568058970164719475676101450 -# MD5 Fingerprint: cb:17:e4:31:67:3e:e2:09:fe:45:57:93:f3:0a:fa:1c -# SHA1 Fingerprint: 4e:b6:d5:78:49:9b:1c:cf:5f:58:1e:ad:56:be:3d:9b:67:44:a5:e5 -# SHA256 Fingerprint: 9a:cf:ab:7e:43:c8:d8:80:d0:6b:26:2a:94:de:ee:e4:b4:65:99:89:c3:d0:ca:f1:9b:af:64:05:e4:1a:b7:df ------BEGIN CERTIFICATE----- -MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW -ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW -ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp -U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y -aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 -nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex -t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz -SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG -BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ -rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ -NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E -BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH -BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy -aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv -MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE -p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y -5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK -WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ -4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N -hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq ------END CERTIFICATE----- - -# Issuer: CN=COMODO Certification Authority O=COMODO CA Limited -# Subject: CN=COMODO Certification Authority O=COMODO CA Limited -# Label: "COMODO Certification Authority" -# Serial: 104350513648249232941998508985834464573 -# MD5 Fingerprint: 5c:48:dc:f7:42:72:ec:56:94:6d:1c:cc:71:35:80:75 -# SHA1 Fingerprint: 66:31:bf:9e:f7:4f:9e:b6:c9:d5:a6:0c:ba:6a:be:d1:f7:bd:ef:7b -# SHA256 Fingerprint: 0c:2c:d6:3d:f7:80:6f:a3:99:ed:e8:09:11:6b:57:5b:f8:79:89:f0:65:18:f9:80:8c:86:05:03:17:8b:af:66 ------BEGIN CERTIFICATE----- -MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB -gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV -BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw -MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl -YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P -RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3 -UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI -2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8 -Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp -+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+ -DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O -nKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW -/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g -PKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u -QXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY -SdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv -IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ -RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4 -zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd -BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB -ZQ== ------END CERTIFICATE----- - -# Issuer: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C. -# Subject: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C. -# Label: "Network Solutions Certificate Authority" -# Serial: 116697915152937497490437556386812487904 -# MD5 Fingerprint: d3:f3:a6:16:c0:fa:6b:1d:59:b1:2d:96:4d:0e:11:2e -# SHA1 Fingerprint: 74:f8:a3:c3:ef:e7:b3:90:06:4b:83:90:3c:21:64:60:20:e5:df:ce -# SHA256 Fingerprint: 15:f0:ba:00:a3:ac:7a:f3:ac:88:4c:07:2b:10:11:a0:77:bd:77:c0:97:f4:01:64:b2:f8:59:8a:bd:83:86:0c ------BEGIN CERTIFICATE----- -MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi -MQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu -MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp -dHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV -UzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO -ZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz -c7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP -OCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl -mGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF -BgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4 -qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw -gZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB -BjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu -bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp -dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8 -6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/ -h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH -/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv -wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN -pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey ------END CERTIFICATE----- - -# Issuer: CN=COMODO ECC Certification Authority O=COMODO CA Limited -# Subject: CN=COMODO ECC Certification Authority O=COMODO CA Limited -# Label: "COMODO ECC Certification Authority" -# Serial: 41578283867086692638256921589707938090 -# MD5 Fingerprint: 7c:62:ff:74:9d:31:53:5e:68:4a:d5:78:aa:1e:bf:23 -# SHA1 Fingerprint: 9f:74:4e:9f:2b:4d:ba:ec:0f:31:2c:50:b6:56:3b:8e:2d:93:c3:11 -# SHA256 Fingerprint: 17:93:92:7a:06:14:54:97:89:ad:ce:2f:8f:34:f7:f0:b6:6d:0f:3a:e3:a3:b8:4d:21:ec:15:db:ba:4f:ad:c7 ------BEGIN CERTIFICATE----- -MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL -MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE -BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT -IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw -MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy -ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N -T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv -biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR -FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J -cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW -BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ -BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm -fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv -GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= ------END CERTIFICATE----- - -# Issuer: CN=TC TrustCenter Class 2 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 2 CA -# Subject: CN=TC TrustCenter Class 2 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 2 CA -# Label: "TC TrustCenter Class 2 CA II" -# Serial: 941389028203453866782103406992443 -# MD5 Fingerprint: ce:78:33:5c:59:78:01:6e:18:ea:b9:36:a0:b9:2e:23 -# SHA1 Fingerprint: ae:50:83:ed:7c:f4:5c:bc:8f:61:c6:21:fe:68:5d:79:42:21:15:6e -# SHA256 Fingerprint: e6:b8:f8:76:64:85:f8:07:ae:7f:8d:ac:16:70:46:1f:07:c0:a1:3e:ef:3a:1f:f7:17:53:8d:7a:ba:d3:91:b4 ------BEGIN CERTIFICATE----- -MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjEL -MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV -BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 -Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYwMTEyMTQzODQzWhcNMjUxMjMxMjI1 -OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i -SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UEAxMc -VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jf -tMjWQ+nEdVl//OEd+DFwIxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKg -uNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2J -XjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQXa7pIXSSTYtZgo+U4+lK -8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7uSNQZu+99 -5OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3 -kUrL84J6E1wIqzCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy -dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6 -Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz -JTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290 -Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u -TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iS -GNn3Bzn1LL4GdXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprt -ZjluS5TmVfwLG4t3wVMTZonZKNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8 -au0WOB9/WIFaGusyiC2y8zl3gK9etmF1KdsjTYjKUCjLhdLTEKJZbtOTVAB6okaV -hgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kPJOzHdiEoZa5X6AeI -dUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfkvQ== ------END CERTIFICATE----- - -# Issuer: CN=TC TrustCenter Class 3 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 3 CA -# Subject: CN=TC TrustCenter Class 3 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 3 CA -# Label: "TC TrustCenter Class 3 CA II" -# Serial: 1506523511417715638772220530020799 -# MD5 Fingerprint: 56:5f:aa:80:61:12:17:f6:67:21:e6:2b:6d:61:56:8e -# SHA1 Fingerprint: 80:25:ef:f4:6e:70:c8:d4:72:24:65:84:fe:40:3b:8a:8d:6a:db:f5 -# SHA256 Fingerprint: 8d:a0:84:fc:f9:9c:e0:77:22:f8:9b:32:05:93:98:06:fa:5c:b8:11:e1:c8:13:f6:a1:08:c7:d3:36:b3:40:8e ------BEGIN CERTIFICATE----- -MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjEL -MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV -BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 -Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYwMTEyMTQ0MTU3WhcNMjUxMjMxMjI1 -OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i -SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UEAxMc -VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJW -Ht4bNwcwIi9v8Qbxq63WyKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+Q -Vl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo6SI7dYnWRBpl8huXJh0obazovVkdKyT2 -1oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZuV3bOx4a+9P/FRQI2Alq -ukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk2ZyqBwi1 -Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NX -XAek0CSnwPIA1DCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy -dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6 -Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz -JTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290 -Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u -TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlN -irTzwppVMXzEO2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8 -TtXqluJucsG7Kv5sbviRmEb8yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6 -g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9IJqDnxrcOfHFcqMRA/07QlIp2+gB -95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal092Y+tTmBvTwtiBj -S+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc5A== ------END CERTIFICATE----- - -# Issuer: CN=TC TrustCenter Universal CA I O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA -# Subject: CN=TC TrustCenter Universal CA I O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA -# Label: "TC TrustCenter Universal CA I" -# Serial: 601024842042189035295619584734726 -# MD5 Fingerprint: 45:e1:a5:72:c5:a9:36:64:40:9e:f5:e4:58:84:67:8c -# SHA1 Fingerprint: 6b:2f:34:ad:89:58:be:62:fd:b0:6b:5c:ce:bb:9d:d9:4f:4e:39:f3 -# SHA256 Fingerprint: eb:f3:c0:2a:87:89:b1:fb:7d:51:19:95:d6:63:b7:29:06:d9:13:ce:0d:5e:10:56:8a:8a:77:e2:58:61:67:e7 ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTEL -MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV -BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1 -c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcNMDYwMzIyMTU1NDI4WhcNMjUxMjMx -MjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIg -R21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYwJAYD -VQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSR -JJZ4Hgmgm5qVSkr1YnwCqMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3T -fCZdzHd55yx4Oagmcw6iXSVphU9VDprvxrlE4Vc93x9UIuVvZaozhDrzznq+VZeu -jRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtwag+1m7Z3W0hZneTvWq3z -wZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9OgdwZu5GQ -fezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYD -VR0jBBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAO -BgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0G -CSqGSIb3DQEBBQUAA4IBAQAo0uCG1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X1 -7caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/CyvwbZ71q+s2IhtNerNXxTPqYn -8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3ghUJGooWMNjs -ydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT -ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/ -2TYcuiUaUj0a7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY ------END CERTIFICATE----- - -# Issuer: CN=Cybertrust Global Root O=Cybertrust, Inc -# Subject: CN=Cybertrust Global Root O=Cybertrust, Inc -# Label: "Cybertrust Global Root" -# Serial: 4835703278459682877484360 -# MD5 Fingerprint: 72:e4:4a:87:e3:69:40:80:77:ea:bc:e3:f4:ff:f0:e1 -# SHA1 Fingerprint: 5f:43:e5:b1:bf:f8:78:8c:ac:1c:c7:ca:4a:9a:c6:22:2b:cc:34:c6 -# SHA256 Fingerprint: 96:0a:df:00:63:e9:63:56:75:0c:29:65:dd:0a:08:67:da:0b:9c:bd:6e:77:71:4a:ea:fb:23:49:ab:39:3d:a3 ------BEGIN CERTIFICATE----- -MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG -A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh -bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE -ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS -b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5 -7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS -J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y -HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP -t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz -FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY -XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/ -MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw -hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js -MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA -A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj -Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx -XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o -omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc -A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW -WL1WMRJOEcgh4LMRkWXbtKaIOM5V ------END CERTIFICATE----- - -# Issuer: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only -# Subject: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only -# Label: "GeoTrust Primary Certification Authority - G3" -# Serial: 28809105769928564313984085209975885599 -# MD5 Fingerprint: b5:e8:34:36:c9:10:44:58:48:70:6d:2e:83:d4:b8:05 -# SHA1 Fingerprint: 03:9e:ed:b8:0b:e7:a0:3c:69:53:89:3b:20:d2:d9:32:3a:4c:2a:fd -# SHA256 Fingerprint: b4:78:b8:12:25:0d:f8:78:63:5c:2a:a7:ec:7d:15:5e:aa:62:5e:e8:29:16:e2:cd:29:43:61:88:6c:d1:fb:d4 ------BEGIN CERTIFICATE----- -MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB -mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT -MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s -eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv -cml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ -BgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg -MjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0 -BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz -+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm -hsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn -5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W -JmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL -DmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC -huOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw -HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB -AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB -zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN -kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD -AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH -SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G -spki4cErx5z481+oghLrGREt ------END CERTIFICATE----- - -# Issuer: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only -# Subject: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only -# Label: "thawte Primary Root CA - G2" -# Serial: 71758320672825410020661621085256472406 -# MD5 Fingerprint: 74:9d:ea:60:24:c4:fd:22:53:3e:cc:3a:72:d9:29:4f -# SHA1 Fingerprint: aa:db:bc:22:23:8f:c4:01:a1:27:bb:38:dd:f4:1d:db:08:9e:f0:12 -# SHA256 Fingerprint: a4:31:0d:50:af:18:a6:44:71:90:37:2a:86:af:af:8b:95:1f:fb:43:1d:83:7f:1e:56:88:b4:59:71:ed:15:57 ------BEGIN CERTIFICATE----- -MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL -MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp -IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi -BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw -MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh -d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig -YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v -dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/ -BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6 -papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K -DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3 -KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox -XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== ------END CERTIFICATE----- - -# Issuer: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only -# Subject: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only -# Label: "thawte Primary Root CA - G3" -# Serial: 127614157056681299805556476275995414779 -# MD5 Fingerprint: fb:1b:5d:43:8a:94:cd:44:c6:76:f2:43:4b:47:e7:31 -# SHA1 Fingerprint: f1:8b:53:8d:1b:e9:03:b6:a6:f0:56:43:5b:17:15:89:ca:f3:6b:f2 -# SHA256 Fingerprint: 4b:03:f4:58:07:ad:70:f2:1b:fc:2c:ae:71:c9:fd:e4:60:4c:06:4c:f5:ff:b6:86:ba:e5:db:aa:d7:fd:d3:4c ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB -rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf -Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw -MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV -BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa -Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl -LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u -MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl -ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm -gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8 -YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf -b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9 -9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S -zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk -OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV -HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA -2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW -oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu -t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c -KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM -m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu -MdRAGmI0Nj81Aa6sY6A= ------END CERTIFICATE----- - -# Issuer: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only -# Subject: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only -# Label: "GeoTrust Primary Certification Authority - G2" -# Serial: 80682863203381065782177908751794619243 -# MD5 Fingerprint: 01:5e:d8:6b:bd:6f:3d:8e:a1:31:f8:12:e0:98:73:6a -# SHA1 Fingerprint: 8d:17:84:d5:37:f3:03:7d:ec:70:fe:57:8b:51:9a:99:e6:10:d7:b0 -# SHA256 Fingerprint: 5e:db:7a:c4:3b:82:a0:6a:87:61:e8:d7:be:49:79:eb:f2:61:1f:7d:d7:9b:f9:1c:1c:6b:56:6a:21:9e:d7:66 ------BEGIN CERTIFICATE----- -MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL -MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj -KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 -MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV -BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw -NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV -BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH -MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL -So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal -tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO -BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG -CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT -qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz -rD6ogRLQy7rQkgu2npaqBA+K ------END CERTIFICATE----- - -# Issuer: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only -# Subject: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only -# Label: "VeriSign Universal Root Certification Authority" -# Serial: 85209574734084581917763752644031726877 -# MD5 Fingerprint: 8e:ad:b5:01:aa:4d:81:e4:8c:1d:d1:e1:14:00:95:19 -# SHA1 Fingerprint: 36:79:ca:35:66:87:72:30:4d:30:a5:fb:87:3b:0f:a7:7b:b7:0d:54 -# SHA256 Fingerprint: 23:99:56:11:27:a5:71:25:de:8c:ef:ea:61:0d:df:2f:a0:78:b5:c8:06:7f:4e:82:82:90:bf:b8:60:e8:4b:3c ------BEGIN CERTIFICATE----- -MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB -vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W -ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe -Fw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJVUzEX -MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0 -IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9y -IGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNh -bCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj1mCOkdeQmIN65lgZOIzF -9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGPMiJhgsWH -H26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+H -LL729fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN -/BMReYTtXlT2NJ8IAfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPT -rJ9VAMf2CGqUuV/c4DPxhGD5WycRtPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0GCCsGAQUFBwEMBGEwX6FdoFsw -WTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs -exkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud -DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4 -sAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+ -seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz -4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+ -BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR -lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3 -7M2CYfE45k+XmCpajQ== ------END CERTIFICATE----- - -# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only -# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only -# Label: "VeriSign Class 3 Public Primary Certification Authority - G4" -# Serial: 63143484348153506665311985501458640051 -# MD5 Fingerprint: 3a:52:e1:e7:fd:6f:3a:e3:6f:f3:6f:99:1b:f9:22:41 -# SHA1 Fingerprint: 22:d5:d8:df:8f:02:31:d1:8d:f7:9d:b7:cf:8a:2d:64:c9:3f:6c:3a -# SHA256 Fingerprint: 69:dd:d7:ea:90:bb:57:c9:3e:13:5d:c8:5e:a6:fc:d5:48:0b:60:32:39:bd:c4:54:fc:75:8b:2a:26:cf:7f:79 ------BEGIN CERTIFICATE----- -MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW -ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp -U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y -aXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJp -U2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwg -SW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln -biBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHm -GUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3ve -fLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUw -AwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJ -aW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj -aHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW -kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC -4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga -FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== ------END CERTIFICATE----- - -# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority -# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority -# Label: "Verisign Class 3 Public Primary Certification Authority" -# Serial: 80507572722862485515306429940691309246 -# MD5 Fingerprint: ef:5a:f1:33:ef:f1:cd:bb:51:02:ee:12:14:4b:96:c4 -# SHA1 Fingerprint: a1:db:63:93:91:6f:17:e4:18:55:09:40:04:15:c7:02:40:b0:ae:6b -# SHA256 Fingerprint: a4:b6:b3:99:6f:c2:f3:06:b3:fd:86:81:bd:63:41:3d:8c:50:09:cc:4f:a3:29:c2:cc:f0:e2:fa:1b:14:03:05 ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz -cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 -MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV -BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE -BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is -I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G -CSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i -2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ -2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ ------END CERTIFICATE----- - -# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3 -# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3 -# Label: "GlobalSign Root CA - R3" -# Serial: 4835703278459759426209954 -# MD5 Fingerprint: c5:df:b8:49:ca:05:13:55:ee:2d:ba:1a:c3:3e:b0:28 -# SHA1 Fingerprint: d6:9b:56:11:48:f0:1c:77:c5:45:78:c1:09:26:df:5b:85:69:76:ad -# SHA256 Fingerprint: cb:b5:22:d7:b7:f1:27:ad:6a:01:13:86:5b:df:1c:d4:10:2e:7d:07:59:af:63:5a:7c:f4:72:0d:c9:63:c5:3b ------BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G -A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp -Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 -MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG -A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 -RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT -gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm -KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd -QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ -XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw -DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o -LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU -RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp -jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK -6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX -mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs -Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH -WD9f ------END CERTIFICATE----- - -# Issuer: CN=TC TrustCenter Universal CA III O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA -# Subject: CN=TC TrustCenter Universal CA III O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA -# Label: "TC TrustCenter Universal CA III" -# Serial: 2010889993983507346460533407902964 -# MD5 Fingerprint: 9f:dd:db:ab:ff:8e:ff:45:21:5f:f0:6c:9d:8f:fe:2b -# SHA1 Fingerprint: 96:56:cd:7b:57:96:98:95:d0:e1:41:46:68:06:fb:b8:c6:11:06:87 -# SHA256 Fingerprint: 30:9b:4a:87:f6:ca:56:c9:31:69:aa:a9:9c:6d:98:88:54:d7:89:2b:d5:43:7e:2d:07:b2:9c:be:da:55:d3:5d ------BEGIN CERTIFICATE----- -MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezEL -MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV -BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1 -c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAeFw0wOTA5MDkwODE1MjdaFw0yOTEy -MzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNUQyBUcnVzdENlbnRl -ciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0ExKDAm -BgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF -5+cvAqBNLaT6hdqbJYUtQCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYv -DIRlzg9uwliT6CwLOunBjvvya8o84pxOjuT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8v -zArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+EutCHnNaYlAJ/Uqwa1D7KRT -yGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1M4BDj5yj -dipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBh -MB8GA1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMB -Af8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI -4jANBgkqhkiG9w0BAQUFAAOCAQEAg8ev6n9NCjw5sWi+e22JLumzCecYV42Fmhfz -dkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+KGwWaODIl0YgoGhnYIg5IFHY -aAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhKBgePxLcHsU0G -DeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV -CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPH -LQNjO9Po5KIqwoIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg== ------END CERTIFICATE----- - -# Issuer: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc. -# Subject: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc. -# Label: "Go Daddy Root Certificate Authority - G2" -# Serial: 0 -# MD5 Fingerprint: 80:3a:bc:22:c1:e6:fb:8d:9b:3b:27:4a:32:1b:9a:01 -# SHA1 Fingerprint: 47:be:ab:c9:22:ea:e8:0e:78:78:34:62:a7:9f:45:c2:54:fd:e6:8b -# SHA256 Fingerprint: 45:14:0b:32:47:eb:9c:c8:c5:b4:f0:d7:b5:30:91:f7:32:92:08:9e:6e:5a:63:e2:74:9d:d3:ac:a9:19:8e:da ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx -EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT -EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp -ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz -NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH -EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE -AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD -E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH -/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy -DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh -GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR -tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA -AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE -FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX -WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu -9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr -gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo -2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO -LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI -4uJEvlz36hz1 ------END CERTIFICATE----- - -# Issuer: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc. -# Subject: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc. -# Label: "Starfield Root Certificate Authority - G2" -# Serial: 0 -# MD5 Fingerprint: d6:39:81:c6:52:7e:96:69:fc:fc:ca:66:ed:05:f2:96 -# SHA1 Fingerprint: b5:1c:06:7c:ee:2b:0c:3d:f8:55:ab:2d:92:f4:fe:39:d4:e7:0f:0e -# SHA256 Fingerprint: 2c:e1:cb:0b:f9:d2:f9:e1:02:99:3f:be:21:51:52:c3:b2:dd:0c:ab:de:1c:68:e5:31:9b:83:91:54:db:b7:f5 ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx -EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT -HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs -ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw -MFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 -b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj -aG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp -Y2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg -nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1 -HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N -Hwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN -dloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0 -HZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO -BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G -CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU -sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3 -4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg -8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K -pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1 -mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 ------END CERTIFICATE----- - -# Issuer: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc. -# Subject: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc. -# Label: "Starfield Services Root Certificate Authority - G2" -# Serial: 0 -# MD5 Fingerprint: 17:35:74:af:7b:61:1c:eb:f4:f9:3c:e2:ee:40:f9:a2 -# SHA1 Fingerprint: 92:5a:8f:8d:2c:6d:04:e0:66:5f:59:6a:ff:22:d8:63:e8:25:6f:3f -# SHA256 Fingerprint: 56:8d:69:05:a2:c8:87:08:a4:b3:02:51:90:ed:cf:ed:b1:97:4a:60:6a:13:c6:e5:29:0f:cb:2a:e6:3e:da:b5 ------BEGIN CERTIFICATE----- -MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx -EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT -HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs -ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 -MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD -VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy -ZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy -dmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p -OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2 -8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K -Ts9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe -hRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk -6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw -DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q -AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI -bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB -ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z -qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd -iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn -0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN -sSi6 ------END CERTIFICATE----- - -# Issuer: CN=AffirmTrust Commercial O=AffirmTrust -# Subject: CN=AffirmTrust Commercial O=AffirmTrust -# Label: "AffirmTrust Commercial" -# Serial: 8608355977964138876 -# MD5 Fingerprint: 82:92:ba:5b:ef:cd:8a:6f:a6:3d:55:f9:84:f6:d6:b7 -# SHA1 Fingerprint: f9:b5:b6:32:45:5f:9c:be:ec:57:5f:80:dc:e9:6e:2c:c7:b2:78:b7 -# SHA256 Fingerprint: 03:76:ab:1d:54:c5:f9:80:3c:e4:b2:e2:01:a0:ee:7e:ef:7b:57:b6:36:e8:a9:3c:9b:8d:48:60:c9:6f:5f:a7 ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE -BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz -dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL -MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp -cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP -Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr -ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL -MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1 -yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr -VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/ -nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ -KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG -XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj -vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt -Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g -N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC -nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= ------END CERTIFICATE----- - -# Issuer: CN=AffirmTrust Networking O=AffirmTrust -# Subject: CN=AffirmTrust Networking O=AffirmTrust -# Label: "AffirmTrust Networking" -# Serial: 8957382827206547757 -# MD5 Fingerprint: 42:65:ca:be:01:9a:9a:4c:a9:8c:41:49:cd:c0:d5:7f -# SHA1 Fingerprint: 29:36:21:02:8b:20:ed:02:f5:66:c5:32:d1:d6:ed:90:9f:45:00:2f -# SHA256 Fingerprint: 0a:81:ec:5a:92:97:77:f1:45:90:4a:f3:8d:5d:50:9f:66:b5:e2:c5:8f:cd:b5:31:05:8b:0e:17:f3:f0:b4:1b ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE -BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz -dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL -MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp -cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y -YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua -kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL -QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp -6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG -yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i -QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ -KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO -tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu -QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ -Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u -olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48 -x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= ------END CERTIFICATE----- - -# Issuer: CN=AffirmTrust Premium O=AffirmTrust -# Subject: CN=AffirmTrust Premium O=AffirmTrust -# Label: "AffirmTrust Premium" -# Serial: 7893706540734352110 -# MD5 Fingerprint: c4:5d:0e:48:b6:ac:28:30:4e:0a:bc:f9:38:16:87:57 -# SHA1 Fingerprint: d8:a6:33:2c:e0:03:6f:b1:85:f6:63:4f:7d:6a:06:65:26:32:28:27 -# SHA256 Fingerprint: 70:a7:3f:7f:37:6b:60:07:42:48:90:45:34:b1:14:82:d5:bf:0e:69:8e:cc:49:8d:f5:25:77:eb:f2:e9:3b:9a ------BEGIN CERTIFICATE----- -MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE -BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz -dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG -A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U -cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf -qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ -JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ -+jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS -s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5 -HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7 -70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG -V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S -qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S -5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia -C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX -OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE -FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ -BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2 -KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg -Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B -8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ -MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc -0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ -u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF -u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH -YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8 -GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO -RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e -KeC2uAloGRwYQw== ------END CERTIFICATE----- - -# Issuer: CN=AffirmTrust Premium ECC O=AffirmTrust -# Subject: CN=AffirmTrust Premium ECC O=AffirmTrust -# Label: "AffirmTrust Premium ECC" -# Serial: 8401224907861490260 -# MD5 Fingerprint: 64:b0:09:55:cf:b1:d5:99:e2:be:13:ab:a6:5d:ea:4d -# SHA1 Fingerprint: b8:23:6b:00:2f:1d:16:86:53:01:55:6c:11:a4:37:ca:eb:ff:c3:bb -# SHA256 Fingerprint: bd:71:fd:f6:da:97:e4:cf:62:d1:64:7a:dd:25:81:b0:7d:79:ad:f8:39:7e:b4:ec:ba:9c:5e:84:88:82:14:23 ------BEGIN CERTIFICATE----- -MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC -VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ -cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ -BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt -VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D -0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9 -ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G -A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G -A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs -aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I -flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ== ------END CERTIFICATE----- - -# Issuer: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing -# Subject: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing -# Label: "StartCom Certification Authority" -# Serial: 45 -# MD5 Fingerprint: c9:3b:0d:84:41:fc:a4:76:79:23:08:57:de:10:19:16 -# SHA1 Fingerprint: a3:f1:33:3f:e2:42:bf:cf:c5:d1:4e:8f:39:42:98:40:68:10:d1:a0 -# SHA256 Fingerprint: e1:78:90:ee:09:a3:fb:f4:f4:8b:9c:41:4a:17:d6:37:b7:a5:06:47:e9:bc:75:23:22:72:7f:cc:17:42:a9:11 ------BEGIN CERTIFICATE----- -MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEW -MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg -Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM3WhcNMzYwOTE3MTk0NjM2WjB9 -MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi -U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh -cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk -pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf -OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C -Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT -Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi -HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM -Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w -+2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ -Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 -Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B -26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID -AQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD -VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFul -F2mHMMo0aEPQQa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCC -ATgwLgYIKwYBBQUHAgEWImh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5w -ZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL2ludGVybWVk -aWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENvbW1lcmNpYWwgKFN0 -YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUg -c2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0 -aWZpY2F0aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93 -d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgG -CWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5fPGFf59Jb2vKXfuM/gTF -wWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWmN3PH/UvS -Ta0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst -0OcNOrg+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNc -pRJvkrKTlMeIFw6Ttn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKl -CcWw0bdT82AUuoVpaiF8H3VhFyAXe2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVF -P0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA2MFrLH9ZXF2RsXAiV+uKa0hK -1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBsHvUwyKMQ5bLm -KhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE -JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ -8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm -fyWl8kgAwKQB2j8= ------END CERTIFICATE----- - -# Issuer: CN=StartCom Certification Authority G2 O=StartCom Ltd. -# Subject: CN=StartCom Certification Authority G2 O=StartCom Ltd. -# Label: "StartCom Certification Authority G2" -# Serial: 59 -# MD5 Fingerprint: 78:4b:fb:9e:64:82:0a:d3:b8:4c:62:f3:64:f2:90:64 -# SHA1 Fingerprint: 31:f1:fd:68:22:63:20:ee:c6:3b:3f:9d:ea:4a:3e:53:7c:7c:39:17 -# SHA256 Fingerprint: c7:ba:65:67:de:93:a7:98:ae:1f:aa:79:1e:71:2d:37:8f:ae:1f:93:c4:39:7f:ea:44:1b:b7:cb:e6:fd:59:95 ------BEGIN CERTIFICATE----- -MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEW -MBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlm -aWNhdGlvbiBBdXRob3JpdHkgRzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1 -OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoG -A1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRzIwggIiMA0G -CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8Oo1XJ -JZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsD -vfOpL9HG4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnoo -D/Uefyf3lLE3PbfHkffiAez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/ -Q0kGi4xDuFby2X8hQxfqp0iVAXV16iulQ5XqFYSdCI0mblWbq9zSOdIxHWDirMxW -RST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbsO+wmETRIjfaAKxojAuuK -HDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8HvKTlXcxN -nw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM -0D4LnMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/i -UUjXuG+v+E5+M5iSFGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9 -Ha90OrInwMEePnWjFqmveiJdnxMaz6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHg -TuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE -AwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJKoZIhvcNAQEL -BQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K -2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfX -UfEpY9Z1zRbkJ4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl -6/2o1PXWT6RbdejF0mCy2wl+JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK -9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG/+gyRr61M3Z3qAFdlsHB1b6uJcDJ -HgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTcnIhT76IxW1hPkWLI -wpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/XldblhY -XzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5l -IxKVCCIcl85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoo -hdVddLHRDiBYmxOlsGOm7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulr -so8uBtjRkcfGEvRM/TAXw8HaOFvjqermobp573PYtlNXLfbQ4ddI ------END CERTIFICATE----- From 7aadf46fdb05b5f595440c41998023e69e1700e5 Mon Sep 17 00:00:00 2001 From: vjpai Date: Mon, 16 Mar 2015 23:58:44 -0700 Subject: [PATCH 47/75] Change to std::chrono and add a test. --- include/grpc++/completion_queue.h | 9 ++-- src/cpp/common/completion_queue.cc | 9 ++-- test/cpp/end2end/async_end2end_test.cc | 58 ++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 6 deletions(-) diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index 4181911b58a..d742d85ef72 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -34,7 +34,7 @@ #ifndef GRPCXX_COMPLETION_QUEUE_H #define GRPCXX_COMPLETION_QUEUE_H -#include +#include #include struct grpc_completion_queue; @@ -81,12 +81,15 @@ class CompletionQueue { // Nonblocking (until deadline) read from queue. // Cannot rely on result of tag or ok if return is TIMEOUT - NextStatus AsyncNext(void **tag, bool *ok, gpr_timespec deadline); + NextStatus AsyncNext(void **tag, bool *ok, + std::chrono::system_clock::time_point deadline); // Blocking (until deadline) read from queue. // Returns false if the queue is ready for destruction, true if event bool Next(void **tag, bool *ok) { - return (AsyncNext(tag,ok,gpr_inf_future) != SHUTDOWN); + return (AsyncNext(tag,ok, + std::chrono::system_clock::time_point::max()) != + SHUTDOWN); } // Shutdown has to be called, and the CompletionQueue can only be diff --git a/src/cpp/common/completion_queue.cc b/src/cpp/common/completion_queue.cc index 2913298afed..fede2da0165 100644 --- a/src/cpp/common/completion_queue.cc +++ b/src/cpp/common/completion_queue.cc @@ -57,12 +57,15 @@ class EventDeleter { } }; -CompletionQueue::NextStatus CompletionQueue::AsyncNext(void** tag, bool* ok, - gpr_timespec deadline) { +CompletionQueue::NextStatus +CompletionQueue::AsyncNext(void** tag, bool* ok, + std::chrono::system_clock::time_point deadline) { std::unique_ptr ev; + gpr_timespec gpr_deadline; + Timepoint2Timespec(deadline, &gpr_deadline); for (;;) { - ev.reset(grpc_completion_queue_next(cq_, deadline)); + ev.reset(grpc_completion_queue_next(cq_, gpr_deadline)); if (!ev) { /* got a NULL back because deadline passed */ return TIMEOUT; } diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 70df9e14b21..e011b788ff0 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -76,6 +76,20 @@ void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { EXPECT_EQ(tag(i), got_tag); } +void verify_timed_ok(CompletionQueue* cq, int i, bool expect_ok, + std::chrono::system_clock::time_point deadline = + std::chrono::system_clock::time_point::max(), + CompletionQueue::NextStatus expected_outcome = + CompletionQueue::GOT_EVENT) { + bool ok; + void* got_tag; + EXPECT_EQ(cq->AsyncNext(&got_tag, &ok, deadline), expected_outcome); + if (expected_outcome == CompletionQueue::GOT_EVENT) { + EXPECT_EQ(expect_ok, ok); + EXPECT_EQ(tag(i), got_tag); + } +} + class AsyncEnd2endTest : public ::testing::Test { protected: AsyncEnd2endTest() : service_(&srv_cq_) {} @@ -166,6 +180,50 @@ TEST_F(AsyncEnd2endTest, SequentialRpcs) { SendRpc(10); } +// Test a simple RPC using the async version of Next +TEST_F(AsyncEnd2endTest, AsyncNextRpc) { + ResetStub(); + + EchoRequest send_request; + EchoRequest recv_request; + EchoResponse send_response; + EchoResponse recv_response; + Status recv_status; + + ClientContext cli_ctx; + ServerContext srv_ctx; + grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); + + send_request.set_message("Hello"); + std::unique_ptr > + response_reader(stub_->AsyncEcho(&cli_ctx, send_request, + &cli_cq_, tag(1))); + + std::chrono::system_clock::time_point + time_now(std::chrono::system_clock::now()), + time_limit(std::chrono::system_clock::now()+std::chrono::seconds(5)); + verify_timed_ok(&srv_cq_, -1, true, time_now, CompletionQueue::TIMEOUT); + verify_timed_ok(&cli_cq_, -1, true, time_now, CompletionQueue::TIMEOUT); + + service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, + tag(2)); + + verify_timed_ok(&srv_cq_, 2, true, time_limit); + EXPECT_EQ(send_request.message(), recv_request.message()); + verify_timed_ok(&cli_cq_, 1, true, time_limit); + + send_response.set_message(recv_request.message()); + response_writer.Finish(send_response, Status::OK, tag(3)); + verify_timed_ok(&srv_cq_, 3, true); + + response_reader->Finish(&recv_response, &recv_status, tag(4)); + verify_timed_ok(&cli_cq_, 4, true); + + EXPECT_EQ(send_response.message(), recv_response.message()); + EXPECT_TRUE(recv_status.IsOk()); + +} + // Two pings and a final pong. TEST_F(AsyncEnd2endTest, SimpleClientStreaming) { ResetStub(); From 6baa9b67ada4f0abadd27a830778463f3e8aabd3 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 17 Mar 2015 10:49:39 -0700 Subject: [PATCH 48/75] clang-format c++ code --- include/grpc++/async_generic_service.h | 5 +- include/grpc++/async_unary_call.h | 7 +- include/grpc++/byte_buffer.h | 4 +- include/grpc++/channel_interface.h | 4 +- include/grpc++/client_context.h | 30 ++++---- include/grpc++/completion_queue.h | 24 +++---- include/grpc++/config.h | 7 +- include/grpc++/credentials.h | 4 +- include/grpc++/generic_stub.h | 2 +- include/grpc++/impl/call.h | 72 +++++++++---------- include/grpc++/impl/client_unary_call.h | 8 +-- src/cpp/client/channel.h | 10 +-- src/cpp/client/channel_arguments.cc | 18 ++--- src/cpp/client/client_context.cc | 8 +-- src/cpp/client/client_unary_call.cc | 8 +-- src/cpp/client/create_channel.cc | 9 +-- src/cpp/client/secure_credentials.cc | 5 +- src/cpp/proto/proto_utils.cc | 22 +++--- src/cpp/proto/proto_utils.h | 6 +- src/cpp/server/async_generic_service.cc | 3 +- src/cpp/server/async_server_context.cc | 16 ++--- src/cpp/server/insecure_server_credentials.cc | 3 +- src/cpp/server/secure_server_credentials.cc | 12 ++-- src/cpp/server/server.cc | 5 +- src/cpp/server/server_builder.cc | 3 +- src/cpp/server/thread_pool.cc | 4 +- src/cpp/server/thread_pool.h | 2 +- src/cpp/util/slice.cc | 4 +- src/cpp/util/status.cc | 4 +- src/cpp/util/time.cc | 4 +- src/cpp/util/time.h | 4 +- test/cpp/client/credentials_test.cc | 2 +- test/cpp/end2end/async_end2end_test.cc | 2 +- test/cpp/end2end/generic_end2end_test.cc | 9 ++- test/cpp/interop/client.cc | 3 +- test/cpp/interop/interop_test.cc | 16 ++--- test/cpp/qps/client_async.cc | 52 +++++++------- test/cpp/qps/qps_driver.cc | 2 +- test/cpp/qps/server.cc | 4 +- test/cpp/qps/server_async.cc | 44 ++++++------ test/cpp/util/create_test_channel.cc | 3 +- test/cpp/util/status_test.cc | 2 +- 42 files changed, 224 insertions(+), 232 deletions(-) diff --git a/include/grpc++/async_generic_service.h b/include/grpc++/async_generic_service.h index d10a56c7f78..911d31cb1f4 100644 --- a/include/grpc++/async_generic_service.h +++ b/include/grpc++/async_generic_service.h @@ -41,7 +41,8 @@ struct grpc_server; namespace grpc { -typedef ServerAsyncReaderWriter GenericServerAsyncReaderWriter; +typedef ServerAsyncReaderWriter + GenericServerAsyncReaderWriter; class GenericServerContext GRPC_FINAL : public ServerContext { public: @@ -74,6 +75,6 @@ class AsyncGenericService GRPC_FINAL { Server* server_; }; -} // namespace grpc +} // namespace grpc #endif // GRPCXX_ASYNC_GENERIC_SERVICE_H diff --git a/include/grpc++/async_unary_call.h b/include/grpc++/async_unary_call.h index 658941bb6d4..d1d5be5b50e 100644 --- a/include/grpc++/async_unary_call.h +++ b/include/grpc++/async_unary_call.h @@ -48,10 +48,9 @@ template class ClientAsyncResponseReader GRPC_FINAL { public: ClientAsyncResponseReader(ChannelInterface* channel, CompletionQueue* cq, - const RpcMethod& method, ClientContext* context, - const grpc::protobuf::Message& request, void* tag) - : context_(context), - call_(channel->CreateCall(method, context, cq)) { + const RpcMethod& method, ClientContext* context, + const grpc::protobuf::Message& request, void* tag) + : context_(context), call_(channel->CreateCall(method, context, cq)) { init_buf_.Reset(tag); init_buf_.AddSendInitialMetadata(&context->send_initial_metadata_); init_buf_.AddSendMessage(request); diff --git a/include/grpc++/byte_buffer.h b/include/grpc++/byte_buffer.h index e864ca3bba2..ceb62622fdb 100644 --- a/include/grpc++/byte_buffer.h +++ b/include/grpc++/byte_buffer.h @@ -72,9 +72,7 @@ class ByteBuffer GRPC_FINAL { buffer_ = buf; } - grpc_byte_buffer* buffer() const { - return buffer_; - } + grpc_byte_buffer* buffer() const { return buffer_; } grpc_byte_buffer* buffer_; }; diff --git a/include/grpc++/channel_interface.h b/include/grpc++/channel_interface.h index 51260aed3d7..7d50b452801 100644 --- a/include/grpc++/channel_interface.h +++ b/include/grpc++/channel_interface.h @@ -51,8 +51,8 @@ class ChannelInterface : public CallHook { public: virtual ~ChannelInterface() {} - virtual Call CreateCall(const RpcMethod &method, ClientContext *context, - CompletionQueue *cq) = 0; + virtual Call CreateCall(const RpcMethod& method, ClientContext* context, + CompletionQueue* cq) = 0; }; } // namespace grpc diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index c55d7c2d586..4e7f5a7be0e 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -74,8 +74,8 @@ class ClientContext { ClientContext(); ~ClientContext(); - void AddMetadata(const grpc::string &meta_key, - const grpc::string &meta_value); + void AddMetadata(const grpc::string& meta_key, + const grpc::string& meta_value); const std::multimap& GetServerInitialMetadata() { GPR_ASSERT(initial_metadata_received_); @@ -87,19 +87,17 @@ class ClientContext { return trailing_metadata_; } - void set_absolute_deadline(const system_clock::time_point &deadline); + void set_absolute_deadline(const system_clock::time_point& deadline); system_clock::time_point absolute_deadline(); - void set_authority(const grpc::string& authority) { - authority_ = authority; - } + void set_authority(const grpc::string& authority) { authority_ = authority; } void TryCancel(); private: // Disallow copy and assign. - ClientContext(const ClientContext &); - ClientContext &operator=(const ClientContext &); + ClientContext(const ClientContext&); + ClientContext& operator=(const ClientContext&); friend class CallOpBuffer; friend class Channel; @@ -118,24 +116,22 @@ class ClientContext { template friend class ::grpc::ClientAsyncResponseReader; - grpc_call *call() { return call_; } - void set_call(grpc_call *call) { + grpc_call* call() { return call_; } + void set_call(grpc_call* call) { GPR_ASSERT(call_ == nullptr); call_ = call; } - grpc_completion_queue *cq() { return cq_; } - void set_cq(grpc_completion_queue *cq) { cq_ = cq; } + grpc_completion_queue* cq() { return cq_; } + void set_cq(grpc_completion_queue* cq) { cq_ = cq; } gpr_timespec RawDeadline() { return absolute_deadline_; } - grpc::string authority() { - return authority_; - } + grpc::string authority() { return authority_; } bool initial_metadata_received_; - grpc_call *call_; - grpc_completion_queue *cq_; + grpc_call* call_; + grpc_completion_queue* cq_; gpr_timespec absolute_deadline_; grpc::string authority_; std::multimap send_initial_metadata_; diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index f741e3c36bb..1caaa8d6cfc 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -65,26 +65,26 @@ class CompletionQueueTag { // to do) // If this function returns false, the tag is dropped and not returned // from the completion queue - virtual bool FinalizeResult(void **tag, bool *status) = 0; + virtual bool FinalizeResult(void** tag, bool* status) = 0; }; // grpc_completion_queue wrapper class class CompletionQueue { public: CompletionQueue(); - explicit CompletionQueue(grpc_completion_queue *take); + explicit CompletionQueue(grpc_completion_queue* take); ~CompletionQueue(); // Blocking read from queue. // Returns true if an event was received, false if the queue is ready // for destruction. - bool Next(void **tag, bool *ok); + bool Next(void** tag, bool* ok); // Shutdown has to be called, and the CompletionQueue can only be // destructed when false is returned from Next(). void Shutdown(); - grpc_completion_queue *cq() { return cq_; } + grpc_completion_queue* cq() { return cq_; } private: // Friend synchronous wrappers so that they can access Pluck(), which is @@ -103,20 +103,20 @@ class CompletionQueue { friend class ::grpc::ServerReaderWriter; friend class ::grpc::Server; friend class ::grpc::ServerContext; - friend Status BlockingUnaryCall(ChannelInterface *channel, - const RpcMethod &method, - ClientContext *context, - const grpc::protobuf::Message &request, - grpc::protobuf::Message *result); + friend Status BlockingUnaryCall(ChannelInterface* channel, + const RpcMethod& method, + ClientContext* context, + const grpc::protobuf::Message& request, + grpc::protobuf::Message* result); // Wraps grpc_completion_queue_pluck. // Cannot be mixed with calls to Next(). - bool Pluck(CompletionQueueTag *tag); + bool Pluck(CompletionQueueTag* tag); // Does a single polling pluck on tag - void TryPluck(CompletionQueueTag *tag); + void TryPluck(CompletionQueueTag* tag); - grpc_completion_queue *cq_; // owned + grpc_completion_queue* cq_; // owned }; } // namespace grpc diff --git a/include/grpc++/config.h b/include/grpc++/config.h index 0267b852159..35bf5073647 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -59,11 +59,12 @@ #ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM #include -#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ::google::protobuf::io::ZeroCopyOutputStream -#define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ::google::protobuf::io::ZeroCopyInputStream +#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM \ + ::google::protobuf::io::ZeroCopyOutputStream +#define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM \ + ::google::protobuf::io::ZeroCopyInputStream #endif - namespace grpc { typedef GRPC_CUSTOM_STRING string; diff --git a/include/grpc++/credentials.h b/include/grpc++/credentials.h index 59ad638f47d..c3f48592cc7 100644 --- a/include/grpc++/credentials.h +++ b/include/grpc++/credentials.h @@ -50,8 +50,8 @@ class Credentials { protected: friend std::unique_ptr CompositeCredentials( - const std::unique_ptr& creds1, - const std::unique_ptr& creds2); + const std::unique_ptr& creds1, + const std::unique_ptr& creds2); virtual SecureCredentials* AsSecureCredentials() = 0; diff --git a/include/grpc++/generic_stub.h b/include/grpc++/generic_stub.h index 6038d7c66cc..d4c8380ad45 100644 --- a/include/grpc++/generic_stub.h +++ b/include/grpc++/generic_stub.h @@ -57,6 +57,6 @@ class GenericStub GRPC_FINAL { std::shared_ptr channel_; }; -} // namespace grpc +} // namespace grpc #endif // GRPCXX_GENERIC_STUB_H diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index a8551ad4595..e117ac6313e 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -55,89 +55,89 @@ class CallOpBuffer : public CompletionQueueTag { CallOpBuffer(); ~CallOpBuffer(); - void Reset(void *next_return_tag); + void Reset(void* next_return_tag); // Does not take ownership. void AddSendInitialMetadata( - std::multimap *metadata); - void AddSendInitialMetadata(ClientContext *ctx); - void AddRecvInitialMetadata(ClientContext *ctx); - void AddSendMessage(const grpc::protobuf::Message &message); + std::multimap* metadata); + void AddSendInitialMetadata(ClientContext* ctx); + void AddRecvInitialMetadata(ClientContext* ctx); + void AddSendMessage(const grpc::protobuf::Message& message); void AddSendMessage(const ByteBuffer& message); - void AddRecvMessage(grpc::protobuf::Message *message); - void AddRecvMessage(ByteBuffer *message); + void AddRecvMessage(grpc::protobuf::Message* message); + void AddRecvMessage(ByteBuffer* message); void AddClientSendClose(); - void AddClientRecvStatus(ClientContext *ctx, Status *status); - void AddServerSendStatus(std::multimap *metadata, - const Status &status); - void AddServerRecvClose(bool *cancelled); + void AddClientRecvStatus(ClientContext* ctx, Status* status); + void AddServerSendStatus(std::multimap* metadata, + const Status& status); + void AddServerRecvClose(bool* cancelled); // INTERNAL API: // Convert to an array of grpc_op elements - void FillOps(grpc_op *ops, size_t *nops); + void FillOps(grpc_op* ops, size_t* nops); // Called by completion queue just prior to returning from Next() or Pluck() - bool FinalizeResult(void **tag, bool *status) GRPC_OVERRIDE; + bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE; bool got_message; private: - void *return_tag_; + void* return_tag_; // Send initial metadata bool send_initial_metadata_; size_t initial_metadata_count_; - grpc_metadata *initial_metadata_; + grpc_metadata* initial_metadata_; // Recv initial metadta - std::multimap *recv_initial_metadata_; + std::multimap* recv_initial_metadata_; grpc_metadata_array recv_initial_metadata_arr_; // Send message - const grpc::protobuf::Message *send_message_; - const ByteBuffer *send_message_buffer_; - grpc_byte_buffer *send_buf_; + const grpc::protobuf::Message* send_message_; + const ByteBuffer* send_message_buffer_; + grpc_byte_buffer* send_buf_; // Recv message - grpc::protobuf::Message *recv_message_; - ByteBuffer *recv_message_buffer_; - grpc_byte_buffer *recv_buf_; + grpc::protobuf::Message* recv_message_; + ByteBuffer* recv_message_buffer_; + grpc_byte_buffer* recv_buf_; // Client send close bool client_send_close_; // Client recv status - std::multimap *recv_trailing_metadata_; - Status *recv_status_; + std::multimap* recv_trailing_metadata_; + Status* recv_status_; grpc_metadata_array recv_trailing_metadata_arr_; grpc_status_code status_code_; - char *status_details_; + char* status_details_; size_t status_details_capacity_; // Server send status - const Status *send_status_; + const Status* send_status_; size_t trailing_metadata_count_; - grpc_metadata *trailing_metadata_; + grpc_metadata* trailing_metadata_; int cancelled_buf_; - bool *recv_closed_; + bool* recv_closed_; }; // Channel and Server implement this to allow them to hook performing ops class CallHook { public: virtual ~CallHook() {} - virtual void PerformOpsOnCall(CallOpBuffer *ops, Call *call) = 0; + virtual void PerformOpsOnCall(CallOpBuffer* ops, Call* call) = 0; }; // Straightforward wrapping of the C call object class Call GRPC_FINAL { public: /* call is owned by the caller */ - Call(grpc_call *call, CallHook *call_hook_, CompletionQueue *cq); + Call(grpc_call* call, CallHook* call_hook_, CompletionQueue* cq); - void PerformOps(CallOpBuffer *buffer); + void PerformOps(CallOpBuffer* buffer); - grpc_call *call() { return call_; } - CompletionQueue *cq() { return cq_; } + grpc_call* call() { return call_; } + CompletionQueue* cq() { return cq_; } private: - CallHook *call_hook_; - CompletionQueue *cq_; - grpc_call *call_; + CallHook* call_hook_; + CompletionQueue* cq_; + grpc_call* call_; }; } // namespace grpc diff --git a/include/grpc++/impl/client_unary_call.h b/include/grpc++/impl/client_unary_call.h index fd9715da504..0e8aeed7816 100644 --- a/include/grpc++/impl/client_unary_call.h +++ b/include/grpc++/impl/client_unary_call.h @@ -45,10 +45,10 @@ class RpcMethod; class Status; // Wrapper that performs a blocking unary call -Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, - ClientContext *context, - const grpc::protobuf::Message &request, - grpc::protobuf::Message *result); +Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, + ClientContext* context, + const grpc::protobuf::Message& request, + grpc::protobuf::Message* result); } // namespace grpc diff --git a/src/cpp/client/channel.h b/src/cpp/client/channel.h index a1de3817e69..3980eba237d 100644 --- a/src/cpp/client/channel.h +++ b/src/cpp/client/channel.h @@ -51,16 +51,16 @@ class StreamContextInterface; class Channel GRPC_FINAL : public ChannelInterface { public: - Channel(const grpc::string &target, grpc_channel *c_channel); + Channel(const grpc::string& target, grpc_channel* c_channel); ~Channel() GRPC_OVERRIDE; - virtual Call CreateCall(const RpcMethod &method, ClientContext *context, - CompletionQueue *cq) GRPC_OVERRIDE; - virtual void PerformOpsOnCall(CallOpBuffer *ops, Call *call) GRPC_OVERRIDE; + virtual Call CreateCall(const RpcMethod& method, ClientContext* context, + CompletionQueue* cq) GRPC_OVERRIDE; + virtual void PerformOpsOnCall(CallOpBuffer* ops, Call* call) GRPC_OVERRIDE; private: const grpc::string target_; - grpc_channel *const c_channel_; // owned + grpc_channel* const c_channel_; // owned }; } // namespace grpc diff --git a/src/cpp/client/channel_arguments.cc b/src/cpp/client/channel_arguments.cc index abf0fc1c0ad..87f8349eefd 100644 --- a/src/cpp/client/channel_arguments.cc +++ b/src/cpp/client/channel_arguments.cc @@ -37,7 +37,7 @@ namespace grpc { -void ChannelArguments::SetSslTargetNameOverride(const grpc::string &name) { +void ChannelArguments::SetSslTargetNameOverride(const grpc::string& name) { SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, name); } @@ -50,32 +50,32 @@ grpc::string ChannelArguments::GetSslTargetNameOverride() const { return ""; } -void ChannelArguments::SetInt(const grpc::string &key, int value) { +void ChannelArguments::SetInt(const grpc::string& key, int value) { grpc_arg arg; arg.type = GRPC_ARG_INTEGER; strings_.push_back(key); - arg.key = const_cast(strings_.back().c_str()); + arg.key = const_cast(strings_.back().c_str()); arg.value.integer = value; args_.push_back(arg); } -void ChannelArguments::SetString(const grpc::string &key, - const grpc::string &value) { +void ChannelArguments::SetString(const grpc::string& key, + const grpc::string& value) { grpc_arg arg; arg.type = GRPC_ARG_STRING; strings_.push_back(key); - arg.key = const_cast(strings_.back().c_str()); + arg.key = const_cast(strings_.back().c_str()); strings_.push_back(value); - arg.value.string = const_cast(strings_.back().c_str()); + arg.value.string = const_cast(strings_.back().c_str()); args_.push_back(arg); } -void ChannelArguments::SetChannelArgs(grpc_channel_args *channel_args) const { +void ChannelArguments::SetChannelArgs(grpc_channel_args* channel_args) const { channel_args->num_args = args_.size(); if (channel_args->num_args > 0) { - channel_args->args = const_cast(&args_[0]); + channel_args->args = const_cast(&args_[0]); } } diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index 9f99f7bcd55..de9f8c7201d 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -53,7 +53,7 @@ ClientContext::~ClientContext() { if (cq_) { grpc_completion_queue_shutdown(cq_); // Drain cq_. - grpc_event *ev; + grpc_event* ev; grpc_completion_type t; do { ev = grpc_completion_queue_next(cq_, gpr_inf_future); @@ -65,7 +65,7 @@ ClientContext::~ClientContext() { } void ClientContext::set_absolute_deadline( - const system_clock::time_point &deadline) { + const system_clock::time_point& deadline) { Timepoint2Timespec(deadline, &absolute_deadline_); } @@ -73,8 +73,8 @@ system_clock::time_point ClientContext::absolute_deadline() { return Timespec2Timepoint(absolute_deadline_); } -void ClientContext::AddMetadata(const grpc::string &meta_key, - const grpc::string &meta_value) { +void ClientContext::AddMetadata(const grpc::string& meta_key, + const grpc::string& meta_value) { send_initial_metadata_.insert(std::make_pair(meta_key, meta_value)); } diff --git a/src/cpp/client/client_unary_call.cc b/src/cpp/client/client_unary_call.cc index 5c179de9d8f..7e7ea78bcde 100644 --- a/src/cpp/client/client_unary_call.cc +++ b/src/cpp/client/client_unary_call.cc @@ -42,10 +42,10 @@ namespace grpc { // Wrapper that performs a blocking unary call -Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, - ClientContext *context, - const grpc::protobuf::Message &request, - grpc::protobuf::Message *result) { +Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, + ClientContext* context, + const grpc::protobuf::Message& request, + grpc::protobuf::Message* result) { CompletionQueue cq; Call call(channel->CreateCall(method, context, &cq)); CallOpBuffer buf; diff --git a/src/cpp/client/create_channel.cc b/src/cpp/client/create_channel.cc index 57d215d0f33..301430572a2 100644 --- a/src/cpp/client/create_channel.cc +++ b/src/cpp/client/create_channel.cc @@ -41,9 +41,10 @@ namespace grpc { class ChannelArguments; std::shared_ptr CreateChannel( - const grpc::string &target, const std::unique_ptr &creds, - const ChannelArguments &args) { - return creds ? creds->CreateChannel(target, args) : - std::shared_ptr(new Channel(target, grpc_lame_client_channel_create())); + const grpc::string& target, const std::unique_ptr& creds, + const ChannelArguments& args) { + return creds ? creds->CreateChannel(target, args) + : std::shared_ptr( + new Channel(target, grpc_lame_client_channel_create())); } } // namespace grpc diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index a2f6a698583..412dc0764ff 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -55,7 +55,8 @@ class SecureCredentials GRPC_FINAL : public Credentials { args.SetChannelArgs(&channel_args); return std::shared_ptr(new Channel( args.GetSslTargetNameOverride().empty() - ? target : args.GetSslTargetNameOverride(), + ? target + : args.GetSslTargetNameOverride(), grpc_secure_channel_create(c_creds_, target.c_str(), &channel_args))); } @@ -111,7 +112,7 @@ std::unique_ptr ServiceAccountCredentials( // Builds JWT credentials. std::unique_ptr JWTCredentials( - const grpc::string &json_key, std::chrono::seconds token_lifetime) { + const grpc::string& json_key, std::chrono::seconds token_lifetime) { if (token_lifetime.count() <= 0) { gpr_log(GPR_ERROR, "Trying to create JWTCredentials with non-positive lifetime"); diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc index 9254e5879f2..b8de2ea1735 100644 --- a/src/cpp/proto/proto_utils.cc +++ b/src/cpp/proto/proto_utils.cc @@ -45,7 +45,7 @@ const int kMaxBufferLength = 8192; class GrpcBufferWriter GRPC_FINAL : public ::grpc::protobuf::io::ZeroCopyOutputStream { public: - explicit GrpcBufferWriter(grpc_byte_buffer **bp, + explicit GrpcBufferWriter(grpc_byte_buffer** bp, int block_size = kMaxBufferLength) : block_size_(block_size), byte_count_(0), have_backup_(false) { *bp = grpc_byte_buffer_create(NULL, 0); @@ -58,7 +58,7 @@ class GrpcBufferWriter GRPC_FINAL } } - bool Next(void **data, int *size) GRPC_OVERRIDE { + bool Next(void** data, int* size) GRPC_OVERRIDE { if (have_backup_) { slice_ = backup_slice_; have_backup_ = false; @@ -89,7 +89,7 @@ class GrpcBufferWriter GRPC_FINAL private: const int block_size_; gpr_int64 byte_count_; - gpr_slice_buffer *slice_buffer_; + gpr_slice_buffer* slice_buffer_; bool have_backup_; gpr_slice backup_slice_; gpr_slice slice_; @@ -98,7 +98,7 @@ class GrpcBufferWriter GRPC_FINAL class GrpcBufferReader GRPC_FINAL : public ::grpc::protobuf::io::ZeroCopyInputStream { public: - explicit GrpcBufferReader(grpc_byte_buffer *buffer) + explicit GrpcBufferReader(grpc_byte_buffer* buffer) : byte_count_(0), backup_count_(0) { reader_ = grpc_byte_buffer_reader_create(buffer); } @@ -106,7 +106,7 @@ class GrpcBufferReader GRPC_FINAL grpc_byte_buffer_reader_destroy(reader_); } - bool Next(const void **data, int *size) GRPC_OVERRIDE { + bool Next(const void** data, int* size) GRPC_OVERRIDE { if (backup_count_ > 0) { *data = GPR_SLICE_START_PTR(slice_) + GPR_SLICE_LENGTH(slice_) - backup_count_; @@ -123,12 +123,10 @@ class GrpcBufferReader GRPC_FINAL return true; } - void BackUp(int count) GRPC_OVERRIDE { - backup_count_ = count; - } + void BackUp(int count) GRPC_OVERRIDE { backup_count_ = count; } bool Skip(int count) GRPC_OVERRIDE { - const void *data; + const void* data; int size; while (Next(&data, &size)) { if (size >= count) { @@ -149,18 +147,18 @@ class GrpcBufferReader GRPC_FINAL private: gpr_int64 byte_count_; gpr_int64 backup_count_; - grpc_byte_buffer_reader *reader_; + grpc_byte_buffer_reader* reader_; gpr_slice slice_; }; namespace grpc { -bool SerializeProto(const grpc::protobuf::Message &msg, grpc_byte_buffer **bp) { +bool SerializeProto(const grpc::protobuf::Message& msg, grpc_byte_buffer** bp) { GrpcBufferWriter writer(bp); return msg.SerializeToZeroCopyStream(&writer); } -bool DeserializeProto(grpc_byte_buffer *buffer, grpc::protobuf::Message *msg) { +bool DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg) { GrpcBufferReader reader(buffer); return msg->ParseFromZeroCopyStream(&reader); } diff --git a/src/cpp/proto/proto_utils.h b/src/cpp/proto/proto_utils.h index 7a1b1f8b7cb..bc60dc99296 100644 --- a/src/cpp/proto/proto_utils.h +++ b/src/cpp/proto/proto_utils.h @@ -43,11 +43,11 @@ namespace grpc { // Serialize the msg into a buffer created inside the function. The caller // should destroy the returned buffer when done with it. If serialization fails, // false is returned and buffer is left unchanged. -bool SerializeProto(const grpc::protobuf::Message &msg, - grpc_byte_buffer **buffer); +bool SerializeProto(const grpc::protobuf::Message& msg, + grpc_byte_buffer** buffer); // The caller keeps ownership of buffer and msg. -bool DeserializeProto(grpc_byte_buffer *buffer, grpc::protobuf::Message *msg); +bool DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg); } // namespace grpc diff --git a/src/cpp/server/async_generic_service.cc b/src/cpp/server/async_generic_service.cc index 2009af7cbd1..07cb9337152 100644 --- a/src/cpp/server/async_generic_service.cc +++ b/src/cpp/server/async_generic_service.cc @@ -47,5 +47,4 @@ CompletionQueue* AsyncGenericService::completion_queue() { return &server_->cq_; } -} // namespace grpc - +} // namespace grpc diff --git a/src/cpp/server/async_server_context.cc b/src/cpp/server/async_server_context.cc index f21efcfb19a..628822a3387 100644 --- a/src/cpp/server/async_server_context.cc +++ b/src/cpp/server/async_server_context.cc @@ -42,7 +42,7 @@ namespace grpc { AsyncServerContext::AsyncServerContext( - grpc_call *call, const grpc::string &method, const grpc::string &host, + grpc_call* call, const grpc::string& method, const grpc::string& host, system_clock::time_point absolute_deadline) : method_(method), host_(host), @@ -52,22 +52,22 @@ AsyncServerContext::AsyncServerContext( AsyncServerContext::~AsyncServerContext() { grpc_call_destroy(call_); } -void AsyncServerContext::Accept(grpc_completion_queue *cq) { +void AsyncServerContext::Accept(grpc_completion_queue* cq) { GPR_ASSERT(grpc_call_server_accept_old(call_, cq, this) == GRPC_CALL_OK); GPR_ASSERT(grpc_call_server_end_initial_metadata_old( call_, GRPC_WRITE_BUFFER_HINT) == GRPC_CALL_OK); } -bool AsyncServerContext::StartRead(grpc::protobuf::Message *request) { +bool AsyncServerContext::StartRead(grpc::protobuf::Message* request) { GPR_ASSERT(request); request_ = request; grpc_call_error err = grpc_call_start_read_old(call_, this); return err == GRPC_CALL_OK; } -bool AsyncServerContext::StartWrite(const grpc::protobuf::Message &response, +bool AsyncServerContext::StartWrite(const grpc::protobuf::Message& response, int flags) { - grpc_byte_buffer *buffer = nullptr; + grpc_byte_buffer* buffer = nullptr; if (!SerializeProto(response, &buffer)) { return false; } @@ -76,16 +76,16 @@ bool AsyncServerContext::StartWrite(const grpc::protobuf::Message &response, return err == GRPC_CALL_OK; } -bool AsyncServerContext::StartWriteStatus(const Status &status) { +bool AsyncServerContext::StartWriteStatus(const Status& status) { grpc_call_error err = grpc_call_start_write_status_old( call_, static_cast(status.code()), status.details().empty() ? nullptr - : const_cast(status.details().c_str()), + : const_cast(status.details().c_str()), this); return err == GRPC_CALL_OK; } -bool AsyncServerContext::ParseRead(grpc_byte_buffer *read_buffer) { +bool AsyncServerContext::ParseRead(grpc_byte_buffer* read_buffer) { GPR_ASSERT(request_); bool success = DeserializeProto(read_buffer, request_); request_ = nullptr; diff --git a/src/cpp/server/insecure_server_credentials.cc b/src/cpp/server/insecure_server_credentials.cc index f5e4732f730..55dd90d7a7e 100644 --- a/src/cpp/server/insecure_server_credentials.cc +++ b/src/cpp/server/insecure_server_credentials.cc @@ -46,7 +46,8 @@ class InsecureServerCredentialsImpl GRPC_FINAL : public ServerCredentials { } // namespace std::shared_ptr InsecureServerCredentials() { - return std::shared_ptr(new InsecureServerCredentialsImpl()); + return std::shared_ptr( + new InsecureServerCredentialsImpl()); } } // namespace grpc diff --git a/src/cpp/server/secure_server_credentials.cc b/src/cpp/server/secure_server_credentials.cc index ff356385034..88f7a9b1a98 100644 --- a/src/cpp/server/secure_server_credentials.cc +++ b/src/cpp/server/secure_server_credentials.cc @@ -40,7 +40,8 @@ namespace grpc { namespace { class SecureServerCredentials GRPC_FINAL : public ServerCredentials { public: - explicit SecureServerCredentials(grpc_server_credentials* creds) : creds_(creds) {} + explicit SecureServerCredentials(grpc_server_credentials* creds) + : creds_(creds) {} ~SecureServerCredentials() GRPC_OVERRIDE { grpc_server_credentials_release(creds_); } @@ -56,16 +57,17 @@ class SecureServerCredentials GRPC_FINAL : public ServerCredentials { } // namespace std::shared_ptr SslServerCredentials( - const SslServerCredentialsOptions &options) { + const SslServerCredentialsOptions& options) { std::vector pem_key_cert_pairs; - for (const auto &key_cert_pair : options.pem_key_cert_pairs) { + for (const auto& key_cert_pair : options.pem_key_cert_pairs) { pem_key_cert_pairs.push_back( {key_cert_pair.private_key.c_str(), key_cert_pair.cert_chain.c_str()}); } - grpc_server_credentials *c_creds = grpc_ssl_server_credentials_create( + grpc_server_credentials* c_creds = grpc_ssl_server_credentials_create( options.pem_root_certs.empty() ? nullptr : options.pem_root_certs.c_str(), &pem_key_cert_pairs[0], pem_key_cert_pairs.size()); - return std::shared_ptr(new SecureServerCredentials(c_creds)); + return std::shared_ptr( + new SecureServerCredentials(c_creds)); } } // namespace grpc diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 4d5e77e6337..4ed4c455073 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -322,11 +322,10 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { payload_(nullptr) { memset(&array_, 0, sizeof(array_)); grpc_call_details_init(&call_details_); - grpc_server_request_call( - server->server_, &call_, &call_details_, &array_, cq->cq(), this); + grpc_server_request_call(server->server_, &call_, &call_details_, &array_, + cq->cq(), this); } - ~AsyncRequest() { if (payload_) { grpc_byte_buffer_destroy(payload_); diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index 835596d393a..2f5a0dc6c8b 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -56,7 +56,8 @@ void ServerBuilder::RegisterAsyncGenericService(AsyncGenericService* service) { if (generic_service_) { gpr_log(GPR_ERROR, "Adding multiple AsyncGenericService is unsupported for now. " - "Dropping the service %p", service); + "Dropping the service %p", + service); return; } generic_service_ = service; diff --git a/src/cpp/server/thread_pool.cc b/src/cpp/server/thread_pool.cc index 5dc9bcf9165..d3013b806c0 100644 --- a/src/cpp/server/thread_pool.cc +++ b/src/cpp/server/thread_pool.cc @@ -66,12 +66,12 @@ ThreadPool::~ThreadPool() { shutdown_ = true; cv_.notify_all(); } - for (auto &t : threads_) { + for (auto& t : threads_) { t.join(); } } -void ThreadPool::ScheduleCallback(const std::function &callback) { +void ThreadPool::ScheduleCallback(const std::function& callback) { std::lock_guard lock(mu_); callbacks_.push(callback); cv_.notify_one(); diff --git a/src/cpp/server/thread_pool.h b/src/cpp/server/thread_pool.h index 6157e403e95..6225d82a0b6 100644 --- a/src/cpp/server/thread_pool.h +++ b/src/cpp/server/thread_pool.h @@ -50,7 +50,7 @@ class ThreadPool GRPC_FINAL : public ThreadPoolInterface { explicit ThreadPool(int num_threads); ~ThreadPool(); - void ScheduleCallback(const std::function &callback) GRPC_OVERRIDE; + void ScheduleCallback(const std::function& callback) GRPC_OVERRIDE; private: std::mutex mu_; diff --git a/src/cpp/util/slice.cc b/src/cpp/util/slice.cc index a549c5008df..57370dabc68 100644 --- a/src/cpp/util/slice.cc +++ b/src/cpp/util/slice.cc @@ -37,9 +37,7 @@ namespace grpc { Slice::Slice() : slice_(gpr_empty_slice()) {} -Slice::~Slice() { - gpr_slice_unref(slice_); -} +Slice::~Slice() { gpr_slice_unref(slice_); } Slice::Slice(gpr_slice slice, AddRef) : slice_(gpr_slice_ref(slice)) {} diff --git a/src/cpp/util/status.cc b/src/cpp/util/status.cc index bbf80306686..b694a513e75 100644 --- a/src/cpp/util/status.cc +++ b/src/cpp/util/status.cc @@ -35,7 +35,7 @@ namespace grpc { -const Status &Status::OK = Status(); -const Status &Status::Cancelled = Status(StatusCode::CANCELLED); +const Status& Status::OK = Status(); +const Status& Status::Cancelled = Status(StatusCode::CANCELLED); } // namespace grpc diff --git a/src/cpp/util/time.cc b/src/cpp/util/time.cc index 919e5623fa3..44d2283e769 100644 --- a/src/cpp/util/time.cc +++ b/src/cpp/util/time.cc @@ -43,8 +43,8 @@ using std::chrono::system_clock; namespace grpc { // TODO(yangg) prevent potential overflow. -void Timepoint2Timespec(const system_clock::time_point &from, - gpr_timespec *to) { +void Timepoint2Timespec(const system_clock::time_point& from, + gpr_timespec* to) { system_clock::duration deadline = from.time_since_epoch(); seconds secs = duration_cast(deadline); nanoseconds nsecs = duration_cast(deadline - secs); diff --git a/src/cpp/util/time.h b/src/cpp/util/time.h index 1994848eb21..8b7fcf55f78 100644 --- a/src/cpp/util/time.h +++ b/src/cpp/util/time.h @@ -41,8 +41,8 @@ namespace grpc { // from and to should be absolute time. -void Timepoint2Timespec(const std::chrono::system_clock::time_point &from, - gpr_timespec *to); +void Timepoint2Timespec(const std::chrono::system_clock::time_point& from, + gpr_timespec* to); std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t); diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 59ca33cc297..24251f297be 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -54,7 +54,7 @@ TEST_F(CredentialsTest, InvalidServiceAccountCreds) { } // namespace testing } // namespace grpc -int main(int argc, char **argv) { +int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); grpc_init(); int ret = RUN_ALL_TESTS(); diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 70df9e14b21..e3471203a01 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -66,7 +66,7 @@ namespace testing { namespace { -void* tag(int i) { return (void*)(gpr_intptr)i; } +void* tag(int i) { return (void*)(gpr_intptr) i; } void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { bool ok; diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index 4a0d2c5c01d..a2faa628657 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -68,7 +68,7 @@ namespace grpc { namespace testing { namespace { -void* tag(int i) { return (void*)(gpr_intptr)i; } +void* tag(int i) { return (void*)(gpr_intptr) i; } void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { bool ok; @@ -91,7 +91,7 @@ bool ParseFromByteBuffer(ByteBuffer* buffer, grpc::protobuf::Message* message) { class GenericEnd2endTest : public ::testing::Test { protected: - GenericEnd2endTest() : generic_service_("*") {} + GenericEnd2endTest() : generic_service_("*") {} void SetUp() GRPC_OVERRIDE { int port = grpc_pick_unused_port_or_die(); @@ -116,8 +116,8 @@ class GenericEnd2endTest : public ::testing::Test { } void ResetStub() { - std::shared_ptr channel = - CreateChannel(server_address_.str(), InsecureCredentials(), ChannelArguments()); + std::shared_ptr channel = CreateChannel( + server_address_.str(), InsecureCredentials(), ChannelArguments()); stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel)); } @@ -238,7 +238,6 @@ TEST_F(GenericEnd2endTest, SimpleBidiStreaming) { client_ok(6); EXPECT_EQ(send_response.message(), recv_response.message()); - cli_stream->WritesDone(tag(7)); client_ok(7); diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index e5645e568e0..ef410671ce0 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -237,8 +237,7 @@ void DoServiceAccountCreds() { } void DoJwtTokenCreds() { - gpr_log(GPR_INFO, - "Sending a large unary rpc with JWT token credentials ..."); + gpr_log(GPR_INFO, "Sending a large unary rpc with JWT token credentials ..."); std::shared_ptr channel = CreateChannelForTestCase("jwt_token_creds"); SimpleRequest request; diff --git a/test/cpp/interop/interop_test.cc b/test/cpp/interop/interop_test.cc index 811e0eb009a..a7a5cc0b2c4 100644 --- a/test/cpp/interop/interop_test.cc +++ b/test/cpp/interop/interop_test.cc @@ -54,13 +54,13 @@ extern "C" { #include #include "test/core/util/port.h" -int test_client(const char *root, const char *host, int port) { +int test_client(const char* root, const char* host, int port) { int status; pid_t cli; cli = fork(); if (cli == 0) { - char *binary_path; - char *port_arg; + char* binary_path; + char* port_arg; gpr_asprintf(&binary_path, "%s/interop_client", root); gpr_asprintf(&port_arg, "--server_port=%d", port); @@ -78,9 +78,9 @@ int test_client(const char *root, const char *host, int port) { return 0; } -int main(int argc, char **argv) { - char *me = argv[0]; - char *lslash = strrchr(me, '/'); +int main(int argc, char** argv) { + char* me = argv[0]; + char* lslash = strrchr(me, '/'); char root[1024]; int port = grpc_pick_unused_port_or_die(); int status; @@ -104,8 +104,8 @@ int main(int argc, char **argv) { /* start the server */ svr = fork(); if (svr == 0) { - char *binary_path; - char *port_arg; + char* binary_path; + char* port_arg; gpr_asprintf(&binary_path, "%s/interop_server", root); gpr_asprintf(&port_arg, "--port=%d", port); diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index c6535bebf88..526f37a1fd6 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -61,23 +61,23 @@ class ClientRpcContext { virtual ~ClientRpcContext() {} virtual bool RunNextState() = 0; // do next state, return false if steps done virtual void StartNewClone() = 0; - static void *tag(ClientRpcContext *c) { return reinterpret_cast(c); } - static ClientRpcContext *detag(void *t) { - return reinterpret_cast(t); + static void* tag(ClientRpcContext* c) { return reinterpret_cast(c); } + static ClientRpcContext* detag(void* t) { + return reinterpret_cast(t); } - virtual void report_stats(Histogram *hist) = 0; + virtual void report_stats(Histogram* hist) = 0; }; template class ClientRpcContextUnaryImpl : public ClientRpcContext { public: ClientRpcContextUnaryImpl( - TestService::Stub *stub, const RequestType &req, + TestService::Stub* stub, const RequestType& req, std::function< std::unique_ptr>( - TestService::Stub *, grpc::ClientContext *, const RequestType &, - void *)> start_req, - std::function on_done) + TestService::Stub*, grpc::ClientContext*, const RequestType&, + void*)> start_req, + std::function on_done) : context_(), stub_(stub), req_(req), @@ -90,7 +90,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { start_req(stub_, &context_, req_, ClientRpcContext::tag(this))) {} ~ClientRpcContextUnaryImpl() GRPC_OVERRIDE {} bool RunNextState() GRPC_OVERRIDE { return (this->*next_state_)(); } - void report_stats(Histogram *hist) GRPC_OVERRIDE { + void report_stats(Histogram* hist) GRPC_OVERRIDE { hist->Add((Timer::Now() - start_) * 1e9); } @@ -113,13 +113,13 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { return false; } grpc::ClientContext context_; - TestService::Stub *stub_; + TestService::Stub* stub_; RequestType req_; ResponseType response_; bool (ClientRpcContextUnaryImpl::*next_state_)(); - std::function callback_; + std::function callback_; std::function>( - TestService::Stub *, grpc::ClientContext *, const RequestType &, void *)> + TestService::Stub*, grpc::ClientContext*, const RequestType&, void*)> start_req_; grpc::Status status_; double start_; @@ -129,13 +129,13 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { class AsyncClient GRPC_FINAL : public Client { public: - explicit AsyncClient(const ClientConfig &config) : Client(config) { + explicit AsyncClient(const ClientConfig& config) : Client(config) { for (int i = 0; i < config.async_client_threads(); i++) { cli_cqs_.emplace_back(new CompletionQueue); } auto payload_size = config.payload_size(); - auto check_done = [payload_size](grpc::Status s, SimpleResponse *response) { + auto check_done = [payload_size](grpc::Status s, SimpleResponse* response) { GPR_ASSERT(s.IsOk() && (response->payload().type() == grpc::testing::PayloadType::COMPRESSABLE) && (response->payload().body().length() == @@ -144,16 +144,16 @@ class AsyncClient GRPC_FINAL : public Client { int t = 0; for (int i = 0; i < config.outstanding_rpcs_per_channel(); i++) { - for (auto &channel : channels_) { - auto *cq = cli_cqs_[t].get(); + for (auto& channel : channels_) { + auto* cq = cli_cqs_[t].get(); t = (t + 1) % cli_cqs_.size(); - auto start_req = [cq](TestService::Stub *stub, grpc::ClientContext *ctx, - const SimpleRequest &request, void *tag) { + auto start_req = [cq](TestService::Stub* stub, grpc::ClientContext* ctx, + const SimpleRequest& request, void* tag) { return stub->AsyncUnaryCall(ctx, request, cq, tag); }; - TestService::Stub *stub = channel.get_stub(); - const SimpleRequest &request = request_; + TestService::Stub* stub = channel.get_stub(); + const SimpleRequest& request = request_; new ClientRpcContextUnaryImpl( stub, request, start_req, check_done); } @@ -165,9 +165,9 @@ class AsyncClient GRPC_FINAL : public Client { ~AsyncClient() GRPC_OVERRIDE { EndThreads(); - for (auto &cq : cli_cqs_) { + for (auto& cq : cli_cqs_) { cq->Shutdown(); - void *got_tag; + void* got_tag; bool ok; while (cq->Next(&got_tag, &ok)) { delete ClientRpcContext::detag(got_tag); @@ -175,12 +175,12 @@ class AsyncClient GRPC_FINAL : public Client { } } - void ThreadFunc(Histogram *histogram, size_t thread_idx) GRPC_OVERRIDE { - void *got_tag; + void ThreadFunc(Histogram* histogram, size_t thread_idx) GRPC_OVERRIDE { + void* got_tag; bool ok; cli_cqs_[thread_idx]->Next(&got_tag, &ok); - ClientRpcContext *ctx = ClientRpcContext::detag(got_tag); + ClientRpcContext* ctx = ClientRpcContext::detag(got_tag); if (ctx->RunNextState() == false) { // call the callback and then delete it ctx->report_stats(histogram); @@ -193,7 +193,7 @@ class AsyncClient GRPC_FINAL : public Client { std::vector> cli_cqs_; }; -std::unique_ptr CreateAsyncClient(const ClientConfig &args) { +std::unique_ptr CreateAsyncClient(const ClientConfig& args) { return std::unique_ptr(new AsyncClient(args)); } diff --git a/test/cpp/qps/qps_driver.cc b/test/cpp/qps/qps_driver.cc index bf51e7408e9..5e9a577f8e6 100644 --- a/test/cpp/qps/qps_driver.cc +++ b/test/cpp/qps/qps_driver.cc @@ -69,7 +69,7 @@ namespace gflags {} using namespace google; using namespace gflags; -int main(int argc, char **argv) { +int main(int argc, char** argv) { grpc_init(); ParseCommandLineFlags(&argc, &argv, true); diff --git a/test/cpp/qps/server.cc b/test/cpp/qps/server.cc index 005f0f9c5e2..6a207d87305 100644 --- a/test/cpp/qps/server.cc +++ b/test/cpp/qps/server.cc @@ -73,8 +73,8 @@ using grpc::Status; // In some distros, gflags is in the namespace google, and in some others, // in gflags. This hack is enabling us to find both. -namespace google { } -namespace gflags { } +namespace google {} +namespace gflags {} using namespace google; using namespace gflags; diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index 19778e5a7cd..fcb5ac6d2ff 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -62,9 +62,9 @@ namespace testing { class AsyncQpsServerTest : public Server { public: - AsyncQpsServerTest(const ServerConfig &config, int port) + AsyncQpsServerTest(const ServerConfig& config, int port) : srv_cq_(), async_service_(&srv_cq_), server_(nullptr) { - char *server_address = NULL; + char* server_address = NULL; gpr_join_host_port(&server_address, "::", port); ServerBuilder builder; @@ -87,10 +87,10 @@ class AsyncQpsServerTest : public Server { threads_.push_back(std::thread([=]() { // Wait until work is available or we are shutting down bool ok; - void *got_tag; + void* got_tag; while (srv_cq_.Next(&got_tag, &ok)) { if (ok) { - ServerRpcContext *ctx = detag(got_tag); + ServerRpcContext* ctx = detag(got_tag); // The tag is a pointer to an RPC context to invoke if (ctx->RunNextState() == false) { // this RPC context is done, so refresh it @@ -105,7 +105,7 @@ class AsyncQpsServerTest : public Server { ~AsyncQpsServerTest() { server_->Shutdown(); srv_cq_.Shutdown(); - for (auto &thr : threads_) { + for (auto& thr : threads_) { thr.join(); } while (!contexts_.empty()) { @@ -122,21 +122,21 @@ class AsyncQpsServerTest : public Server { virtual bool RunNextState() = 0; // do next state, return false if all done virtual void Reset() = 0; // start this back at a clean state }; - static void *tag(ServerRpcContext *func) { - return reinterpret_cast(func); + static void* tag(ServerRpcContext* func) { + return reinterpret_cast(func); } - static ServerRpcContext *detag(void *tag) { - return reinterpret_cast(tag); + static ServerRpcContext* detag(void* tag) { + return reinterpret_cast(tag); } template class ServerRpcContextUnaryImpl : public ServerRpcContext { public: ServerRpcContextUnaryImpl( - std::function *, - void *)> request_method, - std::function + std::function*, + void*)> request_method, + std::function invoke_method) : next_state_(&ServerRpcContextUnaryImpl::invoker), request_method_(request_method), @@ -175,16 +175,16 @@ class AsyncQpsServerTest : public Server { ServerContext srv_ctx_; RequestType req_; bool (ServerRpcContextUnaryImpl::*next_state_)(); - std::function *, void *)> + std::function*, void*)> request_method_; - std::function + std::function invoke_method_; grpc::ServerAsyncResponseWriter response_writer_; }; - static Status UnaryCall(const SimpleRequest *request, - SimpleResponse *response) { + static Status UnaryCall(const SimpleRequest* request, + SimpleResponse* response) { if (request->has_response_size() && request->response_size() > 0) { if (!SetPayload(request->response_type(), request->response_size(), response->mutable_payload())) { @@ -197,13 +197,13 @@ class AsyncQpsServerTest : public Server { TestService::AsyncService async_service_; std::vector threads_; std::unique_ptr server_; - std::function *, void *)> + std::function*, void*)> request_unary_; - std::forward_list contexts_; + std::forward_list contexts_; }; -std::unique_ptr CreateAsyncServer(const ServerConfig &config, +std::unique_ptr CreateAsyncServer(const ServerConfig& config, int port) { return std::unique_ptr(new AsyncQpsServerTest(config, port)); } diff --git a/test/cpp/util/create_test_channel.cc b/test/cpp/util/create_test_channel.cc index d3b84b29653..f040acc4b1f 100644 --- a/test/cpp/util/create_test_channel.cc +++ b/test/cpp/util/create_test_channel.cc @@ -72,8 +72,7 @@ std::shared_ptr CreateTestChannel( const grpc::string& connect_to = server.empty() ? override_hostname : server; if (creds.get()) { - channel_creds = - CompositeCredentials(creds, channel_creds); + channel_creds = CompositeCredentials(creds, channel_creds); } return CreateChannel(connect_to, channel_creds, channel_args); } else { diff --git a/test/cpp/util/status_test.cc b/test/cpp/util/status_test.cc index 8c6a3354fe4..17b92ab06a2 100644 --- a/test/cpp/util/status_test.cc +++ b/test/cpp/util/status_test.cc @@ -36,7 +36,7 @@ #include // Make sure the existing grpc_status_code match with grpc::Code. -int main(int argc, char **argv) { +int main(int argc, char** argv) { GPR_ASSERT(grpc::StatusCode::OK == static_cast(GRPC_STATUS_OK)); GPR_ASSERT(grpc::StatusCode::CANCELLED == From 65af063ad736642ba1ec62bb4fbb9b439b61561d Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Tue, 17 Mar 2015 11:46:58 -0700 Subject: [PATCH 49/75] Fix Python test ignorance of build config --- tools/run_tests/build_python.sh | 2 +- tools/run_tests/run_python.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index 0eba1c63779..b14597804fe 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -38,5 +38,5 @@ rm -rf python2.7_virtual_environment virtualenv -p /usr/bin/python2.7 python2.7_virtual_environment source python2.7_virtual_environment/bin/activate pip install enum34==1.0.4 futures==2.2.0 protobuf==3.0.0-alpha-1 -CFLAGS=-I$root/include LDFLAGS=-L$root/libs/opt pip install src/python/src +CFLAGS=-I$root/include LDFLAGS=-L$root/libs/$CONFIG pip install src/python/src pip install src/python/interop diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index fa1497aee47..f0e091f47a1 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -34,6 +34,6 @@ set -ex cd $(dirname $0)/../.. root=`pwd` -export LD_LIBRARY_PATH=$root/libs/opt +export LD_LIBRARY_PATH=$root/libs/$CONFIG source python2.7_virtual_environment/bin/activate python2.7 -B $* From 3c220dfc32c0af5cf8d634f5827d798855b69d07 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 17 Mar 2015 11:47:54 -0700 Subject: [PATCH 50/75] Print out status when it is not ok in interop tests --- test/cpp/interop/client.cc | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index e5645e568e0..3bf299b1b5d 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -161,6 +161,15 @@ std::shared_ptr CreateChannelForTestCase( } } +void AssertOkOrPrintErrorStatus(const grpc::Status& s) { + if (s.IsOk()) { + return; + } + gpr_log(GPR_INFO, "Error status code: %d, message: %s", + s.code(), s.details().c_str()); + GPR_ASSERT(0); +} + void DoEmpty() { gpr_log(GPR_INFO, "Sending an empty rpc..."); std::shared_ptr channel = @@ -172,8 +181,8 @@ void DoEmpty() { ClientContext context; grpc::Status s = stub->EmptyCall(&context, request, &response); + AssertOkOrPrintErrorStatus(s); - GPR_ASSERT(s.IsOk()); gpr_log(GPR_INFO, "Empty rpc done."); } @@ -190,7 +199,7 @@ void PerformLargeUnary(std::shared_ptr channel, grpc::Status s = stub->UnaryCall(&context, *request, response); - GPR_ASSERT(s.IsOk()); + AssertOkOrPrintErrorStatus(s); GPR_ASSERT(response->payload().type() == grpc::testing::PayloadType::COMPRESSABLE); GPR_ASSERT(response->payload().body() == @@ -285,7 +294,7 @@ void DoRequestStreaming() { grpc::Status s = stream->Finish(); GPR_ASSERT(response.aggregated_payload_size() == aggregated_payload_size); - GPR_ASSERT(s.IsOk()); + AssertOkOrPrintErrorStatus(s); gpr_log(GPR_INFO, "Request streaming done."); } @@ -314,7 +323,7 @@ void DoResponseStreaming() { GPR_ASSERT(response_stream_sizes.size() == i); grpc::Status s = stream->Finish(); - GPR_ASSERT(s.IsOk()); + AssertOkOrPrintErrorStatus(s); gpr_log(GPR_INFO, "Response streaming done."); } @@ -346,7 +355,7 @@ void DoResponseStreamingWithSlowConsumer() { GPR_ASSERT(kNumResponseMessages == i); grpc::Status s = stream->Finish(); - GPR_ASSERT(s.IsOk()); + AssertOkOrPrintErrorStatus(s); gpr_log(GPR_INFO, "Response streaming done."); } @@ -379,7 +388,7 @@ void DoHalfDuplex() { } GPR_ASSERT(response_stream_sizes.size() == i); grpc::Status s = stream->Finish(); - GPR_ASSERT(s.IsOk()); + AssertOkOrPrintErrorStatus(s); gpr_log(GPR_INFO, "Half-duplex streaming rpc done."); } @@ -412,7 +421,7 @@ void DoPingPong() { stream->WritesDone(); GPR_ASSERT(!stream->Read(&response)); grpc::Status s = stream->Finish(); - GPR_ASSERT(s.IsOk()); + AssertOkOrPrintErrorStatus(s); gpr_log(GPR_INFO, "Ping pong streaming done."); } From 051a28ff84bb8b09035d1b0e0f4776be0d8225ca Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Tue, 17 Mar 2015 22:54:54 +0100 Subject: [PATCH 51/75] Implements #276 Adds a Makefile target called 'test_python' that first builds grpc, then call run_tests.py to run the python tests for the current configuration. --- Makefile | 5 +++++ templates/Makefile.template | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index f63926b02e0..8be6c5fd0a4 100644 --- a/Makefile +++ b/Makefile @@ -1837,6 +1837,11 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/thread_pool_test || ( echo test thread_pool_test failed ; exit 1 ) +test_python: static_c + $(E) "[RUN] Testing python code" + $(Q) tools/run_tests/run_tests.py -lpython -c$(CONFIG) + + tools: privatelibs $(BINDIR)/$(CONFIG)/gen_hpack_tables $(BINDIR)/$(CONFIG)/grpc_create_jwt $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token buildbenchmarks: privatelibs $(BINDIR)/$(CONFIG)/grpc_completion_queue_benchmark $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark diff --git a/templates/Makefile.template b/templates/Makefile.template index 148fa7cd633..6845b911aa1 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -653,6 +653,11 @@ test_cxx: buildtests_cxx % endfor +test_python: static_c + $(E) "[RUN] Testing python code" + $(Q) tools/run_tests/run_tests.py -lpython -c$(CONFIG) + + tools: privatelibs\ % for tgt in targets: % if tgt.build == 'tool': From 757afaeb3072a3f3d30d2054ce1a53af168c48ce Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 17 Mar 2015 15:49:26 -0700 Subject: [PATCH 52/75] clang-format new changes --- include/grpc++/completion_queue.h | 13 ++++++------- test/cpp/end2end/async_end2end_test.cc | 26 ++++++++++++-------------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index 8a36b09a7f6..d98a8bbd5ff 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -77,19 +77,18 @@ class CompletionQueue { ~CompletionQueue(); // Tri-state return for AsyncNext: SHUTDOWN, GOT_EVENT, TIMEOUT - enum NextStatus {SHUTDOWN, GOT_EVENT, TIMEOUT}; + enum NextStatus { SHUTDOWN, GOT_EVENT, TIMEOUT }; // Nonblocking (until deadline) read from queue. // Cannot rely on result of tag or ok if return is TIMEOUT - NextStatus AsyncNext(void **tag, bool *ok, - std::chrono::system_clock::time_point deadline); + NextStatus AsyncNext(void** tag, bool* ok, + std::chrono::system_clock::time_point deadline); // Blocking (until deadline) read from queue. // Returns false if the queue is ready for destruction, true if event - bool Next(void **tag, bool *ok) { - return (AsyncNext(tag,ok, - std::chrono::system_clock::time_point::max()) != - SHUTDOWN); + bool Next(void** tag, bool* ok) { + return (AsyncNext(tag, ok, std::chrono::system_clock::time_point::max()) != + SHUTDOWN); } // Shutdown has to be called, and the CompletionQueue can only be diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 44b8899bf76..4a71a84eeba 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -76,11 +76,11 @@ void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { EXPECT_EQ(tag(i), got_tag); } -void verify_timed_ok(CompletionQueue* cq, int i, bool expect_ok, - std::chrono::system_clock::time_point deadline = - std::chrono::system_clock::time_point::max(), - CompletionQueue::NextStatus expected_outcome = - CompletionQueue::GOT_EVENT) { +void verify_timed_ok( + CompletionQueue* cq, int i, bool expect_ok, + std::chrono::system_clock::time_point deadline = + std::chrono::system_clock::time_point::max(), + CompletionQueue::NextStatus expected_outcome = CompletionQueue::GOT_EVENT) { bool ok; void* got_tag; EXPECT_EQ(cq->AsyncNext(&got_tag, &ok, deadline), expected_outcome); @@ -195,18 +195,17 @@ TEST_F(AsyncEnd2endTest, AsyncNextRpc) { grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); send_request.set_message("Hello"); - std::unique_ptr > - response_reader(stub_->AsyncEcho(&cli_ctx, send_request, - &cli_cq_, tag(1))); + std::unique_ptr > response_reader( + stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); - std::chrono::system_clock::time_point - time_now(std::chrono::system_clock::now()), - time_limit(std::chrono::system_clock::now()+std::chrono::seconds(5)); + std::chrono::system_clock::time_point time_now( + std::chrono::system_clock::now()), + time_limit(std::chrono::system_clock::now() + std::chrono::seconds(5)); verify_timed_ok(&srv_cq_, -1, true, time_now, CompletionQueue::TIMEOUT); verify_timed_ok(&cli_cq_, -1, true, time_now, CompletionQueue::TIMEOUT); service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, - tag(2)); + tag(2)); verify_timed_ok(&srv_cq_, 2, true, time_limit); EXPECT_EQ(send_request.message(), recv_request.message()); @@ -221,9 +220,8 @@ TEST_F(AsyncEnd2endTest, AsyncNextRpc) { EXPECT_EQ(send_response.message(), recv_response.message()); EXPECT_TRUE(recv_status.IsOk()); - } - + // Two pings and a final pong. TEST_F(AsyncEnd2endTest, SimpleClientStreaming) { ResetStub(); From 5ebd6c76a27f1445d1ed5f52e27008ff83070565 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 17 Mar 2015 16:22:32 -0700 Subject: [PATCH 53/75] wrap refresh token credentials in c++ --- include/grpc++/credentials.h | 10 ++++++++-- src/cpp/client/secure_credentials.cc | 12 ++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/include/grpc++/credentials.h b/include/grpc++/credentials.h index 59ad638f47d..2ac3eec95cd 100644 --- a/include/grpc++/credentials.h +++ b/include/grpc++/credentials.h @@ -50,8 +50,8 @@ class Credentials { protected: friend std::unique_ptr CompositeCredentials( - const std::unique_ptr& creds1, - const std::unique_ptr& creds2); + const std::unique_ptr& creds1, + const std::unique_ptr& creds2); virtual SecureCredentials* AsSecureCredentials() = 0; @@ -113,6 +113,12 @@ std::unique_ptr ServiceAccountCredentials( std::unique_ptr JWTCredentials( const grpc::string& json_key, std::chrono::seconds token_lifetime); +// Builds refresh token credentials. +// json_refresh_token is the JSON string containing the refresh token along +// with a client_id and client_secret. +std::unique_ptr RefreshTokenCredentials( + const grpc::string& json_refresh_token); + // Builds IAM credentials. std::unique_ptr IAMCredentials( const grpc::string& authorization_token, diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index a2f6a698583..e3c66376236 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -55,7 +55,8 @@ class SecureCredentials GRPC_FINAL : public Credentials { args.SetChannelArgs(&channel_args); return std::shared_ptr(new Channel( args.GetSslTargetNameOverride().empty() - ? target : args.GetSslTargetNameOverride(), + ? target + : args.GetSslTargetNameOverride(), grpc_secure_channel_create(c_creds_, target.c_str(), &channel_args))); } @@ -111,7 +112,7 @@ std::unique_ptr ServiceAccountCredentials( // Builds JWT credentials. std::unique_ptr JWTCredentials( - const grpc::string &json_key, std::chrono::seconds token_lifetime) { + const grpc::string& json_key, std::chrono::seconds token_lifetime) { if (token_lifetime.count() <= 0) { gpr_log(GPR_ERROR, "Trying to create JWTCredentials with non-positive lifetime"); @@ -122,6 +123,13 @@ std::unique_ptr JWTCredentials( grpc_jwt_credentials_create(json_key.c_str(), lifetime)); } +// Builds refresh token credentials. +std::unique_ptr RefreshTokenCredentials( + const grpc::string& json_refresh_token) { + return WrapCredentials( + grpc_refresh_token_credentials_create(json_refresh_token.c_str())); +} + // Builds IAM credentials. std::unique_ptr IAMCredentials( const grpc::string& authorization_token, From 4e6fd0a3aee0cedf22579ad02be82eac2798d25b Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Wed, 18 Mar 2015 00:19:07 +0000 Subject: [PATCH 54/75] Merge the base and base.packets packages They were two halves of the same whole. --- .../src/grpc/_adapter/_face_test_case.py | 6 +- src/python/src/grpc/_adapter/_links_test.py | 60 ++++---- .../grpc/_adapter/_lonely_rear_link_test.py | 11 +- src/python/src/grpc/_adapter/_test_links.py | 2 +- src/python/src/grpc/_adapter/fore.py | 62 +++++---- src/python/src/grpc/_adapter/rear.py | 43 +++--- .../src/grpc/early_adopter/implementations.py | 6 +- .../base/{packets => }/_cancellation.py | 9 +- .../base/{packets => }/_constants.py | 0 .../framework/base/{packets => }/_context.py | 16 +-- .../framework/base/{packets => }/_emission.py | 15 +- .../framework/base/{packets => }/_ends.py | 74 +++++----- .../base/{packets => }/_expiration.py | 8 +- .../base/{packets => }/_ingestion.py | 5 +- .../base/{packets => }/_interfaces.py | 13 +- .../base/{packets => }/_reception.py | 71 +++++----- .../base/{packets => }/_termination.py | 4 +- .../base/{packets => }/_transmission.py | 51 ++++--- .../base/{packets => }/implementations.py | 44 +++--- .../{packets => }/implementations_test.py | 8 +- .../framework/base/{packets => }/in_memory.py | 4 +- .../src/grpc/framework/base/interfaces.py | 131 ++++++++++++++++++ .../grpc/framework/base/{packets => }/null.py | 2 +- .../grpc/framework/base/packets/__init__.py | 30 ---- .../grpc/framework/base/packets/interfaces.py | 84 ----------- .../grpc/framework/base/packets/packets.py | 118 ---------------- .../src/grpc/framework/face/demonstration.py | 6 +- .../grpc/framework/face/testing/base_util.py | 10 +- src/python/src/setup.py | 1 - tools/dockerfile/grpc_python/Dockerfile | 2 +- tools/run_tests/python_tests.json | 2 +- 31 files changed, 394 insertions(+), 504 deletions(-) rename src/python/src/grpc/framework/base/{packets => }/_cancellation.py (89%) rename src/python/src/grpc/framework/base/{packets => }/_constants.py (100%) rename src/python/src/grpc/framework/base/{packets => }/_context.py (86%) rename src/python/src/grpc/framework/base/{packets => }/_emission.py (89%) rename src/python/src/grpc/framework/base/{packets => }/_ends.py (86%) rename src/python/src/grpc/framework/base/{packets => }/_expiration.py (95%) rename src/python/src/grpc/framework/base/{packets => }/_ingestion.py (99%) rename src/python/src/grpc/framework/base/{packets => }/_interfaces.py (93%) rename src/python/src/grpc/framework/base/{packets => }/_reception.py (85%) rename src/python/src/grpc/framework/base/{packets => }/_termination.py (98%) rename src/python/src/grpc/framework/base/{packets => }/_transmission.py (91%) rename src/python/src/grpc/framework/base/{packets => }/implementations.py (77%) rename src/python/src/grpc/framework/base/{packets => }/implementations_test.py (94%) rename src/python/src/grpc/framework/base/{packets => }/in_memory.py (97%) rename src/python/src/grpc/framework/base/{packets => }/null.py (97%) delete mode 100644 src/python/src/grpc/framework/base/packets/__init__.py delete mode 100644 src/python/src/grpc/framework/base/packets/interfaces.py delete mode 100644 src/python/src/grpc/framework/base/packets/packets.py diff --git a/src/python/src/grpc/_adapter/_face_test_case.py b/src/python/src/grpc/_adapter/_face_test_case.py index 2542eb6da4d..923e889844d 100644 --- a/src/python/src/grpc/_adapter/_face_test_case.py +++ b/src/python/src/grpc/_adapter/_face_test_case.py @@ -34,7 +34,7 @@ import unittest from grpc._adapter import fore from grpc._adapter import rear from grpc.framework.base import util -from grpc.framework.base.packets import implementations as tickets_implementations +from grpc.framework.base import implementations as base_implementations from grpc.framework.face import implementations as face_implementations from grpc.framework.face.testing import coverage from grpc.framework.face.testing import serial @@ -69,8 +69,8 @@ class FaceTestCase(test_case.FaceTestCase, coverage.BlockingCoverage): serialization.request_serializers, serialization.response_deserializers, False, None, None, None) rear_link.start() - front = tickets_implementations.front(pool, pool, pool) - back = tickets_implementations.back( + front = base_implementations.front_link(pool, pool, pool) + back = base_implementations.back_link( servicer, pool, pool, pool, _TIMEOUT, _MAXIMUM_TIMEOUT) fore_link.join_rear_link(back) back.join_fore_link(fore_link) diff --git a/src/python/src/grpc/_adapter/_links_test.py b/src/python/src/grpc/_adapter/_links_test.py index 49fd1f7a1ca..dc8ad15487e 100644 --- a/src/python/src/grpc/_adapter/_links_test.py +++ b/src/python/src/grpc/_adapter/_links_test.py @@ -37,7 +37,6 @@ from grpc._adapter import _test_links from grpc._adapter import fore from grpc._adapter import rear from grpc.framework.base import interfaces -from grpc.framework.base.packets import packets as tickets from grpc.framework.foundation import logging_pool _IDENTITY = lambda x: x @@ -60,11 +59,11 @@ class RoundTripTest(unittest.TestCase): test_fore_link = _test_links.ForeLink(None, None) def rear_action(front_to_back_ticket, fore_link): if front_to_back_ticket.kind in ( - tickets.FrontToBackPacket.Kind.COMPLETION, - tickets.FrontToBackPacket.Kind.ENTIRE): - back_to_front_ticket = tickets.BackToFrontPacket( + interfaces.FrontToBackPacket.Kind.COMPLETION, + interfaces.FrontToBackPacket.Kind.ENTIRE): + back_to_front_ticket = interfaces.BackToFrontPacket( front_to_back_ticket.operation_id, 0, - tickets.BackToFrontPacket.Kind.COMPLETION, None) + interfaces.BackToFrontPacket.Kind.COMPLETION, None) fore_link.accept_back_to_front_ticket(back_to_front_ticket) test_rear_link = _test_links.RearLink(rear_action, None) @@ -82,8 +81,8 @@ class RoundTripTest(unittest.TestCase): test_fore_link.join_rear_link(rear_link) rear_link.start() - front_to_back_ticket = tickets.FrontToBackPacket( - test_operation_id, 0, tickets.FrontToBackPacket.Kind.ENTIRE, + front_to_back_ticket = interfaces.FrontToBackPacket( + test_operation_id, 0, interfaces.FrontToBackPacket.Kind.ENTIRE, test_method, interfaces.ServicedSubscription.Kind.FULL, None, None, _TIMEOUT) rear_link.accept_front_to_back_ticket(front_to_back_ticket) @@ -91,7 +90,7 @@ class RoundTripTest(unittest.TestCase): with test_fore_link.condition: while (not test_fore_link.tickets or test_fore_link.tickets[-1].kind is - tickets.BackToFrontPacket.Kind.CONTINUATION): + interfaces.BackToFrontPacket.Kind.CONTINUATION): test_fore_link.condition.wait() rear_link.stop() @@ -100,7 +99,7 @@ class RoundTripTest(unittest.TestCase): with test_fore_link.condition: self.assertIs( test_fore_link.tickets[-1].kind, - tickets.BackToFrontPacket.Kind.COMPLETION) + interfaces.BackToFrontPacket.Kind.COMPLETION) def testEntireRoundTrip(self): test_operation_id = object() @@ -115,14 +114,14 @@ class RoundTripTest(unittest.TestCase): else: payload = test_back_to_front_datum terminal = front_to_back_ticket.kind in ( - tickets.FrontToBackPacket.Kind.COMPLETION, - tickets.FrontToBackPacket.Kind.ENTIRE) + interfaces.FrontToBackPacket.Kind.COMPLETION, + interfaces.FrontToBackPacket.Kind.ENTIRE) if payload is not None or terminal: if terminal: - kind = tickets.BackToFrontPacket.Kind.COMPLETION + kind = interfaces.BackToFrontPacket.Kind.COMPLETION else: - kind = tickets.BackToFrontPacket.Kind.CONTINUATION - back_to_front_ticket = tickets.BackToFrontPacket( + kind = interfaces.BackToFrontPacket.Kind.CONTINUATION + back_to_front_ticket = interfaces.BackToFrontPacket( front_to_back_ticket.operation_id, rear_sequence_number[0], kind, payload) rear_sequence_number[0] += 1 @@ -144,8 +143,8 @@ class RoundTripTest(unittest.TestCase): test_fore_link.join_rear_link(rear_link) rear_link.start() - front_to_back_ticket = tickets.FrontToBackPacket( - test_operation_id, 0, tickets.FrontToBackPacket.Kind.ENTIRE, + front_to_back_ticket = interfaces.FrontToBackPacket( + test_operation_id, 0, interfaces.FrontToBackPacket.Kind.ENTIRE, test_method, interfaces.ServicedSubscription.Kind.FULL, None, test_front_to_back_datum, _TIMEOUT) rear_link.accept_front_to_back_ticket(front_to_back_ticket) @@ -153,7 +152,7 @@ class RoundTripTest(unittest.TestCase): with test_fore_link.condition: while (not test_fore_link.tickets or test_fore_link.tickets[-1].kind is not - tickets.BackToFrontPacket.Kind.COMPLETION): + interfaces.BackToFrontPacket.Kind.COMPLETION): test_fore_link.condition.wait() rear_link.stop() @@ -183,14 +182,14 @@ class RoundTripTest(unittest.TestCase): else: response = None terminal = front_to_back_ticket.kind in ( - tickets.FrontToBackPacket.Kind.COMPLETION, - tickets.FrontToBackPacket.Kind.ENTIRE) + interfaces.FrontToBackPacket.Kind.COMPLETION, + interfaces.FrontToBackPacket.Kind.ENTIRE) if response is not None or terminal: if terminal: - kind = tickets.BackToFrontPacket.Kind.COMPLETION + kind = interfaces.BackToFrontPacket.Kind.COMPLETION else: - kind = tickets.BackToFrontPacket.Kind.CONTINUATION - back_to_front_ticket = tickets.BackToFrontPacket( + kind = interfaces.BackToFrontPacket.Kind.CONTINUATION + back_to_front_ticket = interfaces.BackToFrontPacket( front_to_back_ticket.operation_id, rear_sequence_number[0], kind, response) rear_sequence_number[0] += 1 @@ -213,22 +212,23 @@ class RoundTripTest(unittest.TestCase): test_fore_link.join_rear_link(rear_link) rear_link.start() - commencement_ticket = tickets.FrontToBackPacket( - test_operation_id, 0, tickets.FrontToBackPacket.Kind.COMMENCEMENT, - test_method, interfaces.ServicedSubscription.Kind.FULL, None, None, + commencement_ticket = interfaces.FrontToBackPacket( + test_operation_id, 0, + interfaces.FrontToBackPacket.Kind.COMMENCEMENT, test_method, + interfaces.ServicedSubscription.Kind.FULL, None, None, _TIMEOUT) fore_sequence_number = 1 rear_link.accept_front_to_back_ticket(commencement_ticket) for request in scenario.requests(): - continuation_ticket = tickets.FrontToBackPacket( + continuation_ticket = interfaces.FrontToBackPacket( test_operation_id, fore_sequence_number, - tickets.FrontToBackPacket.Kind.CONTINUATION, None, None, None, + interfaces.FrontToBackPacket.Kind.CONTINUATION, None, None, None, request, None) fore_sequence_number += 1 rear_link.accept_front_to_back_ticket(continuation_ticket) - completion_ticket = tickets.FrontToBackPacket( + completion_ticket = interfaces.FrontToBackPacket( test_operation_id, fore_sequence_number, - tickets.FrontToBackPacket.Kind.COMPLETION, None, None, None, None, + interfaces.FrontToBackPacket.Kind.COMPLETION, None, None, None, None, None) fore_sequence_number += 1 rear_link.accept_front_to_back_ticket(completion_ticket) @@ -236,7 +236,7 @@ class RoundTripTest(unittest.TestCase): with test_fore_link.condition: while (not test_fore_link.tickets or test_fore_link.tickets[-1].kind is not - tickets.BackToFrontPacket.Kind.COMPLETION): + interfaces.BackToFrontPacket.Kind.COMPLETION): test_fore_link.condition.wait() rear_link.stop() diff --git a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py b/src/python/src/grpc/_adapter/_lonely_rear_link_test.py index ead0b9eb383..4417f57e59e 100644 --- a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py +++ b/src/python/src/grpc/_adapter/_lonely_rear_link_test.py @@ -34,7 +34,6 @@ import unittest from grpc._adapter import _test_links from grpc._adapter import rear from grpc.framework.base import interfaces -from grpc.framework.base.packets import packets from grpc.framework.foundation import logging_pool _IDENTITY = lambda x: x @@ -68,7 +67,7 @@ class LonelyRearLinkTest(unittest.TestCase): rear_link.join_fore_link(fore_link) rear_link.start() - front_to_back_ticket = packets.FrontToBackPacket( + front_to_back_ticket = interfaces.FrontToBackPacket( test_operation_id, 0, front_to_back_ticket_kind, test_method, interfaces.ServicedSubscription.Kind.FULL, None, None, _TIMEOUT) rear_link.accept_front_to_back_ticket(front_to_back_ticket) @@ -77,7 +76,7 @@ class LonelyRearLinkTest(unittest.TestCase): while True: if (fore_link.tickets and fore_link.tickets[-1].kind is not - packets.BackToFrontPacket.Kind.CONTINUATION): + interfaces.BackToFrontPacket.Kind.CONTINUATION): break fore_link.condition.wait() @@ -86,15 +85,15 @@ class LonelyRearLinkTest(unittest.TestCase): with fore_link.condition: self.assertIsNot( fore_link.tickets[-1].kind, - packets.BackToFrontPacket.Kind.COMPLETION) + interfaces.BackToFrontPacket.Kind.COMPLETION) def testLonelyClientCommencementPacket(self): self._perform_lonely_client_test_with_ticket_kind( - packets.FrontToBackPacket.Kind.COMMENCEMENT) + interfaces.FrontToBackPacket.Kind.COMMENCEMENT) def testLonelyClientEntirePacket(self): self._perform_lonely_client_test_with_ticket_kind( - packets.FrontToBackPacket.Kind.ENTIRE) + interfaces.FrontToBackPacket.Kind.ENTIRE) if __name__ == '__main__': diff --git a/src/python/src/grpc/_adapter/_test_links.py b/src/python/src/grpc/_adapter/_test_links.py index ac0d6e20b69..86c7e61b17d 100644 --- a/src/python/src/grpc/_adapter/_test_links.py +++ b/src/python/src/grpc/_adapter/_test_links.py @@ -31,7 +31,7 @@ import threading -from grpc.framework.base.packets import interfaces +from grpc.framework.base import interfaces class ForeLink(interfaces.ForeLink): diff --git a/src/python/src/grpc/_adapter/fore.py b/src/python/src/grpc/_adapter/fore.py index 16e5a2018cb..85b1359e848 100644 --- a/src/python/src/grpc/_adapter/fore.py +++ b/src/python/src/grpc/_adapter/fore.py @@ -36,10 +36,8 @@ import time from grpc._adapter import _common from grpc._adapter import _low -from grpc.framework.base import interfaces -from grpc.framework.base.packets import interfaces as ticket_interfaces -from grpc.framework.base.packets import null -from grpc.framework.base.packets import packets as tickets +from grpc.framework.base import interfaces as base_interfaces +from grpc.framework.base import null from grpc.framework.foundation import activated from grpc.framework.foundation import logging_pool @@ -69,7 +67,7 @@ def _status(call, rpc_state): rpc_state.write.low = _LowWrite.CLOSED -class ForeLink(ticket_interfaces.ForeLink, activated.Activated): +class ForeLink(base_interfaces.ForeLink, activated.Activated): """A service-side bridge between RPC Framework and the C-ish _low code.""" def __init__( @@ -127,9 +125,9 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): self._request_deserializers[method], self._response_serializers[method]) - ticket = tickets.FrontToBackPacket( - call, 0, tickets.FrontToBackPacket.Kind.COMMENCEMENT, method, - interfaces.ServicedSubscription.Kind.FULL, None, None, + ticket = base_interfaces.FrontToBackPacket( + call, 0, base_interfaces.FrontToBackPacket.Kind.COMMENCEMENT, method, + base_interfaces.ServicedSubscription.Kind.FULL, None, None, service_acceptance.deadline - time.time()) self._rear_link.accept_front_to_back_ticket(ticket) @@ -145,14 +143,16 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): sequence_number = rpc_state.sequence_number rpc_state.sequence_number += 1 if event.bytes is None: - ticket = tickets.FrontToBackPacket( - call, sequence_number, tickets.FrontToBackPacket.Kind.COMPLETION, - None, None, None, None, None) + ticket = base_interfaces.FrontToBackPacket( + call, sequence_number, + base_interfaces.FrontToBackPacket.Kind.COMPLETION, None, None, None, + None, None) else: call.read(call) - ticket = tickets.FrontToBackPacket( - call, sequence_number, tickets.FrontToBackPacket.Kind.CONTINUATION, - None, None, None, rpc_state.deserializer(event.bytes), None) + ticket = base_interfaces.FrontToBackPacket( + call, sequence_number, + base_interfaces.FrontToBackPacket.Kind.CONTINUATION, None, None, + None, rpc_state.deserializer(event.bytes), None) self._rear_link.accept_front_to_back_ticket(ticket) @@ -180,10 +180,10 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): sequence_number = rpc_state.sequence_number rpc_state.sequence_number += 1 - ticket = tickets.FrontToBackPacket( + ticket = base_interfaces.FrontToBackPacket( call, sequence_number, - tickets.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, None, None, - None, None, None) + base_interfaces.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, None, + None, None, None, None) self._rear_link.accept_front_to_back_ticket(ticket) def _on_finish_event(self, event): @@ -200,19 +200,21 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): sequence_number = rpc_state.sequence_number rpc_state.sequence_number += 1 if code is _low.Code.CANCELLED: - ticket = tickets.FrontToBackPacket( - call, sequence_number, tickets.FrontToBackPacket.Kind.CANCELLATION, - None, None, None, None, None) + ticket = base_interfaces.FrontToBackPacket( + call, sequence_number, + base_interfaces.FrontToBackPacket.Kind.CANCELLATION, None, None, + None, None, None) elif code is _low.Code.EXPIRED: - ticket = tickets.FrontToBackPacket( - call, sequence_number, tickets.FrontToBackPacket.Kind.EXPIRATION, - None, None, None, None, None) + ticket = base_interfaces.FrontToBackPacket( + call, sequence_number, + base_interfaces.FrontToBackPacket.Kind.EXPIRATION, None, None, None, + None, None) else: # TODO(nathaniel): Better mapping of codes to ticket-categories - ticket = tickets.FrontToBackPacket( + ticket = base_interfaces.FrontToBackPacket( call, sequence_number, - tickets.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, None, None, - None, None, None) + base_interfaces.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, None, + None, None, None, None) self._rear_link.accept_front_to_back_ticket(ticket) def _spin(self, completion_queue, server): @@ -268,7 +270,7 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): self._rpc_states.pop(call, None) def join_rear_link(self, rear_link): - """See ticket_interfaces.ForeLink.join_rear_link for specification.""" + """See base_interfaces.ForeLink.join_rear_link for specification.""" self._rear_link = null.NULL_REAR_LINK if rear_link is None else rear_link def _start(self): @@ -348,14 +350,14 @@ class ForeLink(ticket_interfaces.ForeLink, activated.Activated): return self._port def accept_back_to_front_ticket(self, ticket): - """See ticket_interfaces.ForeLink.accept_back_to_front_ticket for spec.""" + """See base_interfaces.ForeLink.accept_back_to_front_ticket for spec.""" with self._condition: if self._server is None: return - if ticket.kind is tickets.BackToFrontPacket.Kind.CONTINUATION: + if ticket.kind is base_interfaces.BackToFrontPacket.Kind.CONTINUATION: self._continue(ticket.operation_id, ticket.payload) - elif ticket.kind is tickets.BackToFrontPacket.Kind.COMPLETION: + elif ticket.kind is base_interfaces.BackToFrontPacket.Kind.COMPLETION: self._complete(ticket.operation_id, ticket.payload) else: self._cancel(ticket.operation_id) diff --git a/src/python/src/grpc/_adapter/rear.py b/src/python/src/grpc/_adapter/rear.py index eee008e4dfa..f2d9aae8ab3 100644 --- a/src/python/src/grpc/_adapter/rear.py +++ b/src/python/src/grpc/_adapter/rear.py @@ -36,9 +36,8 @@ import time from grpc._adapter import _common from grpc._adapter import _low -from grpc.framework.base.packets import interfaces as ticket_interfaces -from grpc.framework.base.packets import null -from grpc.framework.base.packets import packets as tickets +from grpc.framework.base import interfaces as base_interfaces +from grpc.framework.base import null from grpc.framework.foundation import activated from grpc.framework.foundation import logging_pool @@ -88,7 +87,7 @@ def _write(operation_id, call, outstanding, write_state, serialized_payload): raise ValueError('Write attempted after writes completed!') -class RearLink(ticket_interfaces.RearLink, activated.Activated): +class RearLink(base_interfaces.RearLink, activated.Activated): """An invocation-side bridge between RPC Framework and the C-ish _low code.""" def __init__( @@ -152,9 +151,9 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): else: logging.error('RPC write not accepted! Event: %s', (event,)) rpc_state.active = False - ticket = tickets.BackToFrontPacket( + ticket = base_interfaces.BackToFrontPacket( operation_id, rpc_state.common.sequence_number, - tickets.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, None) + base_interfaces.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, None) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -163,9 +162,9 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): rpc_state.call.read(operation_id) rpc_state.outstanding.add(_low.Event.Kind.READ_ACCEPTED) - ticket = tickets.BackToFrontPacket( + ticket = base_interfaces.BackToFrontPacket( operation_id, rpc_state.common.sequence_number, - tickets.BackToFrontPacket.Kind.CONTINUATION, + base_interfaces.BackToFrontPacket.Kind.CONTINUATION, rpc_state.common.deserializer(event.bytes)) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -174,9 +173,9 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): if not event.complete_accepted: logging.error('RPC complete not accepted! Event: %s', (event,)) rpc_state.active = False - ticket = tickets.BackToFrontPacket( + ticket = base_interfaces.BackToFrontPacket( operation_id, rpc_state.common.sequence_number, - tickets.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, None) + base_interfaces.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, None) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -189,14 +188,14 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): """Handle termination of an RPC.""" # TODO(nathaniel): Cover all statuses. if event.status.code is _low.Code.OK: - kind = tickets.BackToFrontPacket.Kind.COMPLETION + kind = base_interfaces.BackToFrontPacket.Kind.COMPLETION elif event.status.code is _low.Code.CANCELLED: - kind = tickets.BackToFrontPacket.Kind.CANCELLATION + kind = base_interfaces.BackToFrontPacket.Kind.CANCELLATION elif event.status.code is _low.Code.EXPIRED: - kind = tickets.BackToFrontPacket.Kind.EXPIRATION + kind = base_interfaces.BackToFrontPacket.Kind.EXPIRATION else: - kind = tickets.BackToFrontPacket.Kind.TRANSMISSION_FAILURE - ticket = tickets.BackToFrontPacket( + kind = base_interfaces.BackToFrontPacket.Kind.TRANSMISSION_FAILURE + ticket = base_interfaces.BackToFrontPacket( operation_id, rpc_state.common.sequence_number, kind, None) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -317,7 +316,7 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): rpc_state.active = False def join_fore_link(self, fore_link): - """See ticket_interfaces.RearLink.join_fore_link for specification.""" + """See base_interfaces.RearLink.join_fore_link for specification.""" with self._condition: self._fore_link = null.NULL_FORE_LINK if fore_link is None else fore_link @@ -366,22 +365,22 @@ class RearLink(ticket_interfaces.RearLink, activated.Activated): self._stop() def accept_front_to_back_ticket(self, ticket): - """See ticket_interfaces.RearLink.accept_front_to_back_ticket for spec.""" + """See base_interfaces.RearLink.accept_front_to_back_ticket for spec.""" with self._condition: if self._completion_queue is None: return - if ticket.kind is tickets.FrontToBackPacket.Kind.COMMENCEMENT: + if ticket.kind is base_interfaces.FrontToBackPacket.Kind.COMMENCEMENT: self._commence( ticket.operation_id, ticket.name, ticket.payload, ticket.timeout) - elif ticket.kind is tickets.FrontToBackPacket.Kind.CONTINUATION: + elif ticket.kind is base_interfaces.FrontToBackPacket.Kind.CONTINUATION: self._continue(ticket.operation_id, ticket.payload) - elif ticket.kind is tickets.FrontToBackPacket.Kind.COMPLETION: + elif ticket.kind is base_interfaces.FrontToBackPacket.Kind.COMPLETION: self._complete(ticket.operation_id, ticket.payload) - elif ticket.kind is tickets.FrontToBackPacket.Kind.ENTIRE: + elif ticket.kind is base_interfaces.FrontToBackPacket.Kind.ENTIRE: self._entire( ticket.operation_id, ticket.name, ticket.payload, ticket.timeout) - elif ticket.kind is tickets.FrontToBackPacket.Kind.CANCELLATION: + elif ticket.kind is base_interfaces.FrontToBackPacket.Kind.CANCELLATION: self._cancel(ticket.operation_id) else: # NOTE(nathaniel): All other categories are treated as cancellation. diff --git a/src/python/src/grpc/early_adopter/implementations.py b/src/python/src/grpc/early_adopter/implementations.py index 7c50d7d8b26..9cadb58d0f0 100644 --- a/src/python/src/grpc/early_adopter/implementations.py +++ b/src/python/src/grpc/early_adopter/implementations.py @@ -36,8 +36,8 @@ from grpc._adapter import rear as _rear from grpc.early_adopter import _face_utilities from grpc.early_adopter import _reexport from grpc.early_adopter import interfaces +from grpc.framework.base import implementations as _base_implementations from grpc.framework.base import util as _base_utilities -from grpc.framework.base.packets import implementations as _tickets_implementations from grpc.framework.face import implementations as _face_implementations from grpc.framework.foundation import logging_pool @@ -66,7 +66,7 @@ class _Server(interfaces.Server): self._pool = logging_pool.pool(_THREAD_POOL_SIZE) servicer = _face_implementations.servicer( self._pool, self._breakdown.implementations, None) - self._back = _tickets_implementations.back( + self._back = _base_implementations.back_link( servicer, self._pool, self._pool, self._pool, _ONE_DAY_IN_SECONDS, _ONE_DAY_IN_SECONDS) self._fore_link = _fore.ForeLink( @@ -134,7 +134,7 @@ class _Stub(interfaces.Stub): with self._lock: if self._pool is None: self._pool = logging_pool.pool(_THREAD_POOL_SIZE) - self._front = _tickets_implementations.front( + self._front = _base_implementations.front_link( self._pool, self._pool, self._pool) self._rear_link = _rear.RearLink( self._host, self._port, self._pool, diff --git a/src/python/src/grpc/framework/base/packets/_cancellation.py b/src/python/src/grpc/framework/base/_cancellation.py similarity index 89% rename from src/python/src/grpc/framework/base/packets/_cancellation.py rename to src/python/src/grpc/framework/base/_cancellation.py index 4a0ced1440c..ffbc90668fb 100644 --- a/src/python/src/grpc/framework/base/packets/_cancellation.py +++ b/src/python/src/grpc/framework/base/_cancellation.py @@ -29,9 +29,8 @@ """State and behavior for operation cancellation.""" -from grpc.framework.base import interfaces as base_interfaces -from grpc.framework.base.packets import _interfaces -from grpc.framework.base.packets import packets +from grpc.framework.base import _interfaces +from grpc.framework.base import interfaces class CancellationManager(_interfaces.CancellationManager): @@ -59,7 +58,7 @@ class CancellationManager(_interfaces.CancellationManager): def cancel(self): """See _interfaces.CancellationManager.cancel for specification.""" with self._lock: - self._termination_manager.abort(base_interfaces.Outcome.CANCELLED) - self._transmission_manager.abort(base_interfaces.Outcome.CANCELLED) + self._termination_manager.abort(interfaces.Outcome.CANCELLED) + self._transmission_manager.abort(interfaces.Outcome.CANCELLED) self._ingestion_manager.abort() self._expiration_manager.abort() diff --git a/src/python/src/grpc/framework/base/packets/_constants.py b/src/python/src/grpc/framework/base/_constants.py similarity index 100% rename from src/python/src/grpc/framework/base/packets/_constants.py rename to src/python/src/grpc/framework/base/_constants.py diff --git a/src/python/src/grpc/framework/base/packets/_context.py b/src/python/src/grpc/framework/base/_context.py similarity index 86% rename from src/python/src/grpc/framework/base/packets/_context.py rename to src/python/src/grpc/framework/base/_context.py index 45241c639e8..d84871d6399 100644 --- a/src/python/src/grpc/framework/base/packets/_context.py +++ b/src/python/src/grpc/framework/base/_context.py @@ -32,12 +32,12 @@ import time # _interfaces is referenced from specification in this module. -from grpc.framework.base import interfaces as base_interfaces -from grpc.framework.base.packets import _interfaces # pylint: disable=unused-import +from grpc.framework.base import interfaces +from grpc.framework.base import _interfaces # pylint: disable=unused-import -class OperationContext(base_interfaces.OperationContext): - """An implementation of base_interfaces.OperationContext.""" +class OperationContext(interfaces.OperationContext): + """An implementation of interfaces.OperationContext.""" def __init__( self, lock, operation_id, local_failure, termination_manager, @@ -47,8 +47,8 @@ class OperationContext(base_interfaces.OperationContext): Args: lock: The operation-wide lock. operation_id: An object identifying the operation. - local_failure: Whichever one of base_interfaces.Outcome.SERVICED_FAILURE - or base_interfaces.Outcome.SERVICER_FAILURE describes local failure of + local_failure: Whichever one of interfaces.Outcome.SERVICED_FAILURE or + interfaces.Outcome.SERVICER_FAILURE describes local failure of customer code. termination_manager: The _interfaces.TerminationManager for the operation. transmission_manager: The _interfaces.TransmissionManager for the @@ -75,12 +75,12 @@ class OperationContext(base_interfaces.OperationContext): self._expiration_manager = expiration_manager def is_active(self): - """See base_interfaces.OperationContext.is_active for specification.""" + """See interfaces.OperationContext.is_active for specification.""" with self._lock: return self._termination_manager.is_active() def add_termination_callback(self, callback): - """See base_interfaces.OperationContext.add_termination_callback.""" + """See interfaces.OperationContext.add_termination_callback.""" with self._lock: self._termination_manager.add_callback(callback) diff --git a/src/python/src/grpc/framework/base/packets/_emission.py b/src/python/src/grpc/framework/base/_emission.py similarity index 89% rename from src/python/src/grpc/framework/base/packets/_emission.py rename to src/python/src/grpc/framework/base/_emission.py index cfc9e40a242..1829669a72b 100644 --- a/src/python/src/grpc/framework/base/packets/_emission.py +++ b/src/python/src/grpc/framework/base/_emission.py @@ -29,8 +29,8 @@ """State and behavior for handling emitted values.""" -from grpc.framework.base import interfaces as base_interfaces -from grpc.framework.base.packets import _interfaces +from grpc.framework.base import interfaces +from grpc.framework.base import _interfaces class _EmissionManager(_interfaces.EmissionManager): @@ -42,10 +42,9 @@ class _EmissionManager(_interfaces.EmissionManager): Args: lock: The operation-wide lock. - failure_outcome: Whichever one of - base_interfaces.Outcome.SERVICED_FAILURE or - base_interfaces.Outcome.SERVICER_FAILURE describes this object's - methods being called inappropriately by customer code. + failure_outcome: Whichever one of interfaces.Outcome.SERVICED_FAILURE or + interfaces.Outcome.SERVICER_FAILURE describes this object's methods + being called inappropriately by customer code. termination_manager: The _interfaces.TerminationManager for the operation. transmission_manager: The _interfaces.TransmissionManager for the operation. @@ -106,7 +105,7 @@ def front_emission_manager(lock, termination_manager, transmission_manager): An _interfaces.EmissionManager appropriate for front-side use. """ return _EmissionManager( - lock, base_interfaces.Outcome.SERVICED_FAILURE, termination_manager, + lock, interfaces.Outcome.SERVICED_FAILURE, termination_manager, transmission_manager) @@ -122,5 +121,5 @@ def back_emission_manager(lock, termination_manager, transmission_manager): An _interfaces.EmissionManager appropriate for back-side use. """ return _EmissionManager( - lock, base_interfaces.Outcome.SERVICER_FAILURE, termination_manager, + lock, interfaces.Outcome.SERVICER_FAILURE, termination_manager, transmission_manager) diff --git a/src/python/src/grpc/framework/base/packets/_ends.py b/src/python/src/grpc/framework/base/_ends.py similarity index 86% rename from src/python/src/grpc/framework/base/packets/_ends.py rename to src/python/src/grpc/framework/base/_ends.py index 614d1f666e0..e774b49df3a 100644 --- a/src/python/src/grpc/framework/base/packets/_ends.py +++ b/src/python/src/grpc/framework/base/_ends.py @@ -27,32 +27,30 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""Implementations of Fronts and Backs.""" +"""Implementations of FrontLinks and BackLinks.""" import collections import threading import uuid -# _interfaces and packets are referenced from specification in this module. -from grpc.framework.base import interfaces as base_interfaces -from grpc.framework.base.packets import _cancellation -from grpc.framework.base.packets import _context -from grpc.framework.base.packets import _emission -from grpc.framework.base.packets import _expiration -from grpc.framework.base.packets import _ingestion -from grpc.framework.base.packets import _interfaces # pylint: disable=unused-import -from grpc.framework.base.packets import _reception -from grpc.framework.base.packets import _termination -from grpc.framework.base.packets import _transmission -from grpc.framework.base.packets import interfaces -from grpc.framework.base.packets import packets # pylint: disable=unused-import +# _interfaces is referenced from specification in this module. +from grpc.framework.base import _cancellation +from grpc.framework.base import _context +from grpc.framework.base import _emission +from grpc.framework.base import _expiration +from grpc.framework.base import _ingestion +from grpc.framework.base import _interfaces # pylint: disable=unused-import +from grpc.framework.base import _reception +from grpc.framework.base import _termination +from grpc.framework.base import _transmission +from grpc.framework.base import interfaces from grpc.framework.foundation import callable_util _IDLE_ACTION_EXCEPTION_LOG_MESSAGE = 'Exception calling idle action!' -class _EasyOperation(base_interfaces.Operation): - """A trivial implementation of base_interfaces.Operation.""" +class _EasyOperation(interfaces.Operation): + """A trivial implementation of interfaces.Operation.""" def __init__(self, emission_manager, context, cancellation_manager): """Constructor. @@ -60,7 +58,7 @@ class _EasyOperation(base_interfaces.Operation): Args: emission_manager: The _interfaces.EmissionManager for the operation that will accept values emitted by customer code. - context: The base_interfaces.OperationContext for use by the customer + context: The interfaces.OperationContext for use by the customer during the operation. cancellation_manager: The _interfaces.CancellationManager for the operation. @@ -88,7 +86,7 @@ class _Endlette(object): # indicates an in-progress fire-and-forget operation for which the customer # has chosen to ignore results. self._operations = {} - self._stats = {outcome: 0 for outcome in base_interfaces.Outcome} + self._stats = {outcome: 0 for outcome in interfaces.Outcome} self._idle_actions = [] def terminal_action(self, operation_id): @@ -152,9 +150,9 @@ def _front_operate( """Constructs objects necessary for front-side operation management. Args: - callback: A callable that accepts packets.FrontToBackPackets and delivers - them to the other side of the operation. Execution of this callable may - take any arbitrary length of time. + callback: A callable that accepts interfaces.FrontToBackPackets and + delivers them to the other side of the operation. Execution of this + callable may take any arbitrary length of time. work_pool: A thread pool in which to execute customer code. transmission_pool: A thread pool to use for transmitting to the other side of the operation. @@ -169,7 +167,7 @@ def _front_operate( complete: A boolean indicating whether or not additional payloads will be supplied by the customer. timeout: A length of time in seconds to allow for the operation. - subscription: A base_interfaces.ServicedSubscription describing the + subscription: A interfaces.ServicedSubscription describing the customer's interest in the results of the operation. trace_id: A uuid.UUID identifying a set of related operations to which this operation belongs. May be None. @@ -188,7 +186,7 @@ def _front_operate( lock, transmission_pool, callback, operation_id, name, subscription.kind, trace_id, timeout, termination_manager) operation_context = _context.OperationContext( - lock, operation_id, base_interfaces.Outcome.SERVICED_FAILURE, + lock, operation_id, interfaces.Outcome.SERVICED_FAILURE, termination_manager, transmission_manager) emission_manager = _emission.front_emission_manager( lock, termination_manager, transmission_manager) @@ -216,7 +214,7 @@ def _front_operate( transmission_manager.inmit(payload, complete) - if subscription.kind is base_interfaces.ServicedSubscription.Kind.NONE: + if subscription.kind is interfaces.ServicedSubscription.Kind.NONE: returned_reception_manager = None else: returned_reception_manager = reception_manager @@ -226,8 +224,8 @@ def _front_operate( cancellation_manager) -class Front(interfaces.Front): - """An implementation of interfaces.Front.""" +class FrontLink(interfaces.FrontLink): + """An implementation of interfaces.FrontLink.""" def __init__(self, work_pool, transmission_pool, utility_pool): """Constructor. @@ -252,16 +250,16 @@ class Front(interfaces.Front): self._callback = rear_link.accept_front_to_back_ticket def operation_stats(self): - """See base_interfaces.End.operation_stats for specification.""" + """See interfaces.End.operation_stats for specification.""" return self._endlette.operation_stats() def add_idle_action(self, action): - """See base_interfaces.End.add_idle_action for specification.""" + """See interfaces.End.add_idle_action for specification.""" self._endlette.add_idle_action(action) def operate( self, name, payload, complete, timeout, subscription, trace_id): - """See base_interfaces.Front.operate for specification.""" + """See interfaces.Front.operate for specification.""" operation_id = uuid.uuid4() with self._endlette: management = _front_operate( @@ -291,16 +289,16 @@ def _back_operate( Args: servicer: An interfaces.Servicer for servicing operations. - callback: A callable that accepts packets.BackToFrontPackets and delivers - them to the other side of the operation. Execution of this callable may - take any arbitrary length of time. + callback: A callable that accepts interfaces.BackToFrontPackets and + delivers them to the other side of the operation. Execution of this + callable may take any arbitrary length of time. work_pool: A thread pool in which to execute customer code. transmission_pool: A thread pool to use for transmitting to the other side of the operation. utility_pool: A thread pool for utility tasks. termination_action: A no-arg behavior to be called upon operation completion. - ticket: The first packets.FrontToBackPacket received for the operation. + ticket: The first interfaces.FrontToBackPacket received for the operation. default_timeout: A length of time in seconds to be used as the default time alloted for a single operation. maximum_timeout: A length of time in seconds to be used as the maximum @@ -317,7 +315,7 @@ def _back_operate( lock, transmission_pool, callback, ticket.operation_id, termination_manager, ticket.subscription) operation_context = _context.OperationContext( - lock, ticket.operation_id, base_interfaces.Outcome.SERVICER_FAILURE, + lock, ticket.operation_id, interfaces.Outcome.SERVICER_FAILURE, termination_manager, transmission_manager) emission_manager = _emission.back_emission_manager( lock, termination_manager, transmission_manager) @@ -345,8 +343,8 @@ def _back_operate( return reception_manager -class Back(interfaces.Back): - """An implementation of interfaces.Back.""" +class BackLink(interfaces.BackLink): + """An implementation of interfaces.BackLink.""" def __init__( self, servicer, work_pool, transmission_pool, utility_pool, @@ -393,9 +391,9 @@ class Back(interfaces.Back): reception_manager.receive_packet(ticket) def operation_stats(self): - """See base_interfaces.End.operation_stats for specification.""" + """See interfaces.End.operation_stats for specification.""" return self._endlette.operation_stats() def add_idle_action(self, action): - """See base_interfaces.End.add_idle_action for specification.""" + """See interfaces.End.add_idle_action for specification.""" self._endlette.add_idle_action(action) diff --git a/src/python/src/grpc/framework/base/packets/_expiration.py b/src/python/src/grpc/framework/base/_expiration.py similarity index 95% rename from src/python/src/grpc/framework/base/packets/_expiration.py rename to src/python/src/grpc/framework/base/_expiration.py index a9ecaeaa63c..17acbef4c11 100644 --- a/src/python/src/grpc/framework/base/packets/_expiration.py +++ b/src/python/src/grpc/framework/base/_expiration.py @@ -31,8 +31,8 @@ import time -from grpc.framework.base import interfaces as base_interfaces -from grpc.framework.base.packets import _interfaces +from grpc.framework.base import _interfaces +from grpc.framework.base import interfaces from grpc.framework.foundation import later @@ -73,8 +73,8 @@ class _ExpirationManager(_interfaces.ExpirationManager): with self._lock: if self._future is not None and index == self._index: self._future = None - self._termination_manager.abort(base_interfaces.Outcome.EXPIRED) - self._transmission_manager.abort(base_interfaces.Outcome.EXPIRED) + self._termination_manager.abort(interfaces.Outcome.EXPIRED) + self._transmission_manager.abort(interfaces.Outcome.EXPIRED) self._ingestion_manager.abort() def start(self): diff --git a/src/python/src/grpc/framework/base/packets/_ingestion.py b/src/python/src/grpc/framework/base/_ingestion.py similarity index 99% rename from src/python/src/grpc/framework/base/packets/_ingestion.py rename to src/python/src/grpc/framework/base/_ingestion.py index c5c08fd98e4..06d5b92f0b3 100644 --- a/src/python/src/grpc/framework/base/packets/_ingestion.py +++ b/src/python/src/grpc/framework/base/_ingestion.py @@ -32,11 +32,10 @@ import abc import collections +from grpc.framework.base import _constants +from grpc.framework.base import _interfaces from grpc.framework.base import exceptions from grpc.framework.base import interfaces -from grpc.framework.base.packets import _constants -from grpc.framework.base.packets import _interfaces -from grpc.framework.base.packets import packets from grpc.framework.foundation import abandonment from grpc.framework.foundation import callable_util from grpc.framework.foundation import stream diff --git a/src/python/src/grpc/framework/base/packets/_interfaces.py b/src/python/src/grpc/framework/base/_interfaces.py similarity index 93% rename from src/python/src/grpc/framework/base/packets/_interfaces.py rename to src/python/src/grpc/framework/base/_interfaces.py index 64184bdf7c9..801420e4aca 100644 --- a/src/python/src/grpc/framework/base/packets/_interfaces.py +++ b/src/python/src/grpc/framework/base/_interfaces.py @@ -31,9 +31,8 @@ import abc -# base_interfaces and packets are referenced from specification in this module. -from grpc.framework.base import interfaces as base_interfaces # pylint: disable=unused-import -from grpc.framework.base.packets import packets # pylint: disable=unused-import +# interfaces is referenced from specification in this module. +from grpc.framework.base import interfaces # pylint: disable=unused-import from grpc.framework.foundation import stream @@ -63,7 +62,7 @@ class TerminationManager(object): immediately. Args: - callback: A callable that will be passed a base_interfaces.Outcome value. + callback: A callable that will be passed an interfaces.Outcome value. """ raise NotImplementedError() @@ -87,7 +86,7 @@ class TerminationManager(object): """Indicates that the operation must abort for the indicated reason. Args: - outcome: A base_interfaces.Outcome indicating operation abortion. + outcome: An interfaces.Outcome indicating operation abortion. """ raise NotImplementedError() @@ -113,7 +112,7 @@ class TransmissionManager(object): """Indicates that the operation has aborted for the indicated reason. Args: - outcome: A base_interfaces.Outcome indicating operation abortion. + outcome: An interfaces.Outcome indicating operation abortion. """ raise NotImplementedError() @@ -256,7 +255,7 @@ class ReceptionManager(object): """Handle a packet from the other side of the operation. Args: - packet: A packets.BackToFrontPacket or packets.FrontToBackPacket + packet: An interfaces.BackToFrontPacket or interfaces.FrontToBackPacket appropriate to this end of the operation and this object. """ raise NotImplementedError() diff --git a/src/python/src/grpc/framework/base/packets/_reception.py b/src/python/src/grpc/framework/base/_reception.py similarity index 85% rename from src/python/src/grpc/framework/base/packets/_reception.py rename to src/python/src/grpc/framework/base/_reception.py index ef10c7f8fe5..f523800d86b 100644 --- a/src/python/src/grpc/framework/base/packets/_reception.py +++ b/src/python/src/grpc/framework/base/_reception.py @@ -31,13 +31,12 @@ import abc -from grpc.framework.base import interfaces as base_interfaces -from grpc.framework.base.packets import _interfaces -from grpc.framework.base.packets import packets +from grpc.framework.base import interfaces +from grpc.framework.base import _interfaces _INITIAL_FRONT_TO_BACK_PACKET_KINDS = ( - packets.FrontToBackPacket.Kind.COMMENCEMENT, - packets.FrontToBackPacket.Kind.ENTIRE, + interfaces.FrontToBackPacket.Kind.COMMENCEMENT, + interfaces.FrontToBackPacket.Kind.ENTIRE, ) @@ -94,9 +93,9 @@ def _abort_if_abortive( Args: packet: A just-arrived packet. - abortive: A callable that takes a packet and returns a - base_interfaces.Outcome indicating that the operation should be aborted - or None indicating that the operation should not be aborted. + abortive: A callable that takes a packet and returns an interfaces.Outcome + indicating that the operation should be aborted or None indicating that + the operation should not be aborted. termination_manager: The operation's _interfaces.TerminationManager. transmission_manager: The operation's _interfaces.TransmissionManager. ingestion_manager: The operation's _interfaces.IngestionManager. @@ -120,7 +119,7 @@ def _reception_failure( expiration_manager): """Aborts the operation with an indication of reception failure.""" _abort( - base_interfaces.Outcome.RECEPTION_FAILURE, termination_manager, + interfaces.Outcome.RECEPTION_FAILURE, termination_manager, transmission_manager, ingestion_manager, expiration_manager) @@ -153,22 +152,22 @@ class _BackReceiver(_Receiver): packet: A just-arrived packet. Returns: - A base_interfaces.Outcome value describing operation abortion if the + An interfaces.Outcome value describing operation abortion if the packet is abortive or None if the packet is not abortive. """ - if packet.kind is packets.FrontToBackPacket.Kind.CANCELLATION: - return base_interfaces.Outcome.CANCELLED - elif packet.kind is packets.FrontToBackPacket.Kind.EXPIRATION: - return base_interfaces.Outcome.EXPIRED - elif packet.kind is packets.FrontToBackPacket.Kind.SERVICED_FAILURE: - return base_interfaces.Outcome.SERVICED_FAILURE - elif packet.kind is packets.FrontToBackPacket.Kind.RECEPTION_FAILURE: - return base_interfaces.Outcome.SERVICED_FAILURE + if packet.kind is interfaces.FrontToBackPacket.Kind.CANCELLATION: + return interfaces.Outcome.CANCELLED + elif packet.kind is interfaces.FrontToBackPacket.Kind.EXPIRATION: + return interfaces.Outcome.EXPIRED + elif packet.kind is interfaces.FrontToBackPacket.Kind.SERVICED_FAILURE: + return interfaces.Outcome.SERVICED_FAILURE + elif packet.kind is interfaces.FrontToBackPacket.Kind.RECEPTION_FAILURE: + return interfaces.Outcome.SERVICED_FAILURE elif (packet.kind in _INITIAL_FRONT_TO_BACK_PACKET_KINDS and self._first_packet_seen): - return base_interfaces.Outcome.RECEPTION_FAILURE + return interfaces.Outcome.RECEPTION_FAILURE elif self._last_packet_seen: - return base_interfaces.Outcome.RECEPTION_FAILURE + return interfaces.Outcome.RECEPTION_FAILURE else: return None @@ -184,14 +183,14 @@ class _BackReceiver(_Receiver): if packet.timeout is not None: self._expiration_manager.change_timeout(packet.timeout) - if packet.kind is packets.FrontToBackPacket.Kind.COMMENCEMENT: + if packet.kind is interfaces.FrontToBackPacket.Kind.COMMENCEMENT: self._first_packet_seen = True self._ingestion_manager.start(packet.name) if packet.payload is not None: self._ingestion_manager.consume(packet.payload) - elif packet.kind is packets.FrontToBackPacket.Kind.CONTINUATION: + elif packet.kind is interfaces.FrontToBackPacket.Kind.CONTINUATION: self._ingestion_manager.consume(packet.payload) - elif packet.kind is packets.FrontToBackPacket.Kind.COMPLETION: + elif packet.kind is interfaces.FrontToBackPacket.Kind.COMPLETION: self._last_packet_seen = True if packet.payload is None: self._ingestion_manager.terminate() @@ -241,19 +240,19 @@ class _FrontReceiver(_Receiver): packet: A just-arrived packet. Returns: - A base_interfaces.Outcome value describing operation abortion if the - packet is abortive or None if the packet is not abortive. + An interfaces.Outcome value describing operation abortion if the packet + is abortive or None if the packet is not abortive. """ - if packet.kind is packets.BackToFrontPacket.Kind.CANCELLATION: - return base_interfaces.Outcome.CANCELLED - elif packet.kind is packets.BackToFrontPacket.Kind.EXPIRATION: - return base_interfaces.Outcome.EXPIRED - elif packet.kind is packets.BackToFrontPacket.Kind.SERVICER_FAILURE: - return base_interfaces.Outcome.SERVICER_FAILURE - elif packet.kind is packets.BackToFrontPacket.Kind.RECEPTION_FAILURE: - return base_interfaces.Outcome.SERVICER_FAILURE + if packet.kind is interfaces.BackToFrontPacket.Kind.CANCELLATION: + return interfaces.Outcome.CANCELLED + elif packet.kind is interfaces.BackToFrontPacket.Kind.EXPIRATION: + return interfaces.Outcome.EXPIRED + elif packet.kind is interfaces.BackToFrontPacket.Kind.SERVICER_FAILURE: + return interfaces.Outcome.SERVICER_FAILURE + elif packet.kind is interfaces.BackToFrontPacket.Kind.RECEPTION_FAILURE: + return interfaces.Outcome.SERVICER_FAILURE elif self._last_packet_seen: - return base_interfaces.Outcome.RECEPTION_FAILURE + return interfaces.Outcome.RECEPTION_FAILURE else: return None @@ -266,9 +265,9 @@ class _FrontReceiver(_Receiver): def receive(self, packet): """See _Receiver.receive for specification.""" - if packet.kind is packets.BackToFrontPacket.Kind.CONTINUATION: + if packet.kind is interfaces.BackToFrontPacket.Kind.CONTINUATION: self._ingestion_manager.consume(packet.payload) - elif packet.kind is packets.BackToFrontPacket.Kind.COMPLETION: + elif packet.kind is interfaces.BackToFrontPacket.Kind.COMPLETION: self._last_packet_seen = True if packet.payload is None: self._ingestion_manager.terminate() diff --git a/src/python/src/grpc/framework/base/packets/_termination.py b/src/python/src/grpc/framework/base/_termination.py similarity index 98% rename from src/python/src/grpc/framework/base/packets/_termination.py rename to src/python/src/grpc/framework/base/_termination.py index 6afba88fc41..ddcbc60293d 100644 --- a/src/python/src/grpc/framework/base/packets/_termination.py +++ b/src/python/src/grpc/framework/base/_termination.py @@ -31,9 +31,9 @@ import enum +from grpc.framework.base import _constants +from grpc.framework.base import _interfaces from grpc.framework.base import interfaces -from grpc.framework.base.packets import _constants -from grpc.framework.base.packets import _interfaces from grpc.framework.foundation import callable_util _CALLBACK_EXCEPTION_LOG_MESSAGE = 'Exception calling termination callback!' diff --git a/src/python/src/grpc/framework/base/packets/_transmission.py b/src/python/src/grpc/framework/base/_transmission.py similarity index 91% rename from src/python/src/grpc/framework/base/packets/_transmission.py rename to src/python/src/grpc/framework/base/_transmission.py index 1b18204ec51..510ca11c612 100644 --- a/src/python/src/grpc/framework/base/packets/_transmission.py +++ b/src/python/src/grpc/framework/base/_transmission.py @@ -31,10 +31,9 @@ import abc +from grpc.framework.base import _constants +from grpc.framework.base import _interfaces from grpc.framework.base import interfaces -from grpc.framework.base.packets import _constants -from grpc.framework.base.packets import _interfaces -from grpc.framework.base.packets import packets from grpc.framework.foundation import callable_util _TRANSMISSION_EXCEPTION_LOG_MESSAGE = 'Exception during transmission!' @@ -49,32 +48,32 @@ _BACK_TO_FRONT_NO_TRANSMISSION_OUTCOMES = ( _ABORTION_OUTCOME_TO_FRONT_TO_BACK_PACKET_KIND = { interfaces.Outcome.CANCELLED: - packets.FrontToBackPacket.Kind.CANCELLATION, + interfaces.FrontToBackPacket.Kind.CANCELLATION, interfaces.Outcome.EXPIRED: - packets.FrontToBackPacket.Kind.EXPIRATION, + interfaces.FrontToBackPacket.Kind.EXPIRATION, interfaces.Outcome.RECEPTION_FAILURE: - packets.FrontToBackPacket.Kind.RECEPTION_FAILURE, + interfaces.FrontToBackPacket.Kind.RECEPTION_FAILURE, interfaces.Outcome.TRANSMISSION_FAILURE: - packets.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, + interfaces.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, interfaces.Outcome.SERVICED_FAILURE: - packets.FrontToBackPacket.Kind.SERVICED_FAILURE, + interfaces.FrontToBackPacket.Kind.SERVICED_FAILURE, interfaces.Outcome.SERVICER_FAILURE: - packets.FrontToBackPacket.Kind.SERVICER_FAILURE, + interfaces.FrontToBackPacket.Kind.SERVICER_FAILURE, } _ABORTION_OUTCOME_TO_BACK_TO_FRONT_PACKET_KIND = { interfaces.Outcome.CANCELLED: - packets.BackToFrontPacket.Kind.CANCELLATION, + interfaces.BackToFrontPacket.Kind.CANCELLATION, interfaces.Outcome.EXPIRED: - packets.BackToFrontPacket.Kind.EXPIRATION, + interfaces.BackToFrontPacket.Kind.EXPIRATION, interfaces.Outcome.RECEPTION_FAILURE: - packets.BackToFrontPacket.Kind.RECEPTION_FAILURE, + interfaces.BackToFrontPacket.Kind.RECEPTION_FAILURE, interfaces.Outcome.TRANSMISSION_FAILURE: - packets.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, + interfaces.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, interfaces.Outcome.SERVICED_FAILURE: - packets.BackToFrontPacket.Kind.SERVICED_FAILURE, + interfaces.BackToFrontPacket.Kind.SERVICED_FAILURE, interfaces.Outcome.SERVICER_FAILURE: - packets.BackToFrontPacket.Kind.SERVICER_FAILURE, + interfaces.BackToFrontPacket.Kind.SERVICER_FAILURE, } @@ -141,18 +140,18 @@ class _FrontPacketizer(_Packetizer): """See _Packetizer.packetize for specification.""" if sequence_number: if complete: - kind = packets.FrontToBackPacket.Kind.COMPLETION + kind = interfaces.FrontToBackPacket.Kind.COMPLETION else: - kind = packets.FrontToBackPacket.Kind.CONTINUATION - return packets.FrontToBackPacket( + kind = interfaces.FrontToBackPacket.Kind.CONTINUATION + return interfaces.FrontToBackPacket( operation_id, sequence_number, kind, self._name, self._subscription_kind, self._trace_id, payload, self._timeout) else: if complete: - kind = packets.FrontToBackPacket.Kind.ENTIRE + kind = interfaces.FrontToBackPacket.Kind.ENTIRE else: - kind = packets.FrontToBackPacket.Kind.COMMENCEMENT - return packets.FrontToBackPacket( + kind = interfaces.FrontToBackPacket.Kind.COMMENCEMENT + return interfaces.FrontToBackPacket( operation_id, 0, kind, self._name, self._subscription_kind, self._trace_id, payload, self._timeout) @@ -162,7 +161,7 @@ class _FrontPacketizer(_Packetizer): return None else: kind = _ABORTION_OUTCOME_TO_FRONT_TO_BACK_PACKET_KIND[outcome] - return packets.FrontToBackPacket( + return interfaces.FrontToBackPacket( operation_id, sequence_number, kind, None, None, None, None, None) @@ -172,10 +171,10 @@ class _BackPacketizer(_Packetizer): def packetize(self, operation_id, sequence_number, payload, complete): """See _Packetizer.packetize for specification.""" if complete: - kind = packets.BackToFrontPacket.Kind.COMPLETION + kind = interfaces.BackToFrontPacket.Kind.COMPLETION else: - kind = packets.BackToFrontPacket.Kind.CONTINUATION - return packets.BackToFrontPacket( + kind = interfaces.BackToFrontPacket.Kind.CONTINUATION + return interfaces.BackToFrontPacket( operation_id, sequence_number, kind, payload) def packetize_abortion(self, operation_id, sequence_number, outcome): @@ -184,7 +183,7 @@ class _BackPacketizer(_Packetizer): return None else: kind = _ABORTION_OUTCOME_TO_BACK_TO_FRONT_PACKET_KIND[outcome] - return packets.BackToFrontPacket( + return interfaces.BackToFrontPacket( operation_id, sequence_number, kind, None) diff --git a/src/python/src/grpc/framework/base/packets/implementations.py b/src/python/src/grpc/framework/base/implementations.py similarity index 77% rename from src/python/src/grpc/framework/base/packets/implementations.py rename to src/python/src/grpc/framework/base/implementations.py index 28688bcc0f9..70fb9942b24 100644 --- a/src/python/src/grpc/framework/base/packets/implementations.py +++ b/src/python/src/grpc/framework/base/implementations.py @@ -30,48 +30,48 @@ """Entry points into the packet-exchange-based implementation the base layer.""" # interfaces is referenced from specification in this module. -from grpc.framework.base.packets import _ends -from grpc.framework.base.packets import interfaces # pylint: disable=unused-import +from grpc.framework.base import _ends +from grpc.framework.base import interfaces # pylint: disable=unused-import -def front(work_pool, transmission_pool, utility_pool): - """Factory function for creating interfaces.Fronts. +def front_link(work_pool, transmission_pool, utility_pool): + """Factory function for creating interfaces.FrontLinks. Args: - work_pool: A thread pool to be used for doing work within the created Front - object. - transmission_pool: A thread pool to be used within the created Front object - for transmitting values to some Back object. - utility_pool: A thread pool to be used within the created Front object for - utility tasks. + work_pool: A thread pool to be used for doing work within the created + FrontLink object. + transmission_pool: A thread pool to be used within the created FrontLink + object for transmitting values to a joined RearLink object. + utility_pool: A thread pool to be used within the created FrontLink object + for utility tasks. Returns: - An interfaces.Front. + An interfaces.FrontLink. """ - return _ends.Front(work_pool, transmission_pool, utility_pool) + return _ends.FrontLink(work_pool, transmission_pool, utility_pool) -def back( +def back_link( servicer, work_pool, transmission_pool, utility_pool, default_timeout, maximum_timeout): - """Factory function for creating interfaces.Backs. + """Factory function for creating interfaces.BackLinks. Args: servicer: An interfaces.Servicer for servicing operations. - work_pool: A thread pool to be used for doing work within the created Back - object. - transmission_pool: A thread pool to be used within the created Back object - for transmitting values to some Front object. - utility_pool: A thread pool to be used within the created Back object for - utility tasks. + work_pool: A thread pool to be used for doing work within the created + BackLink object. + transmission_pool: A thread pool to be used within the created BackLink + object for transmitting values to a joined ForeLink object. + utility_pool: A thread pool to be used within the created BackLink object + for utility tasks. default_timeout: A length of time in seconds to be used as the default time alloted for a single operation. maximum_timeout: A length of time in seconds to be used as the maximum time alloted for a single operation. Returns: - An interfaces.Back. + An interfaces.BackLink. """ - return _ends.Back( + return _ends.BackLink( servicer, work_pool, transmission_pool, utility_pool, default_timeout, maximum_timeout) diff --git a/src/python/src/grpc/framework/base/packets/implementations_test.py b/src/python/src/grpc/framework/base/implementations_test.py similarity index 94% rename from src/python/src/grpc/framework/base/packets/implementations_test.py rename to src/python/src/grpc/framework/base/implementations_test.py index e5855700c72..11e49caf756 100644 --- a/src/python/src/grpc/framework/base/packets/implementations_test.py +++ b/src/python/src/grpc/framework/base/implementations_test.py @@ -27,13 +27,13 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""Tests for _framework.base.packets.implementations.""" +"""Tests for grpc.framework.base.implementations.""" import unittest +from grpc.framework.base import implementations from grpc.framework.base import interfaces_test_case from grpc.framework.base import util -from grpc.framework.base.packets import implementations from grpc.framework.foundation import logging_pool POOL_MAX_WORKERS = 100 @@ -54,10 +54,10 @@ class ImplementationsTest( self.back_utility_pool = logging_pool.pool(POOL_MAX_WORKERS) self.test_pool = logging_pool.pool(POOL_MAX_WORKERS) self.test_servicer = interfaces_test_case.TestServicer(self.test_pool) - self.front = implementations.front( + self.front = implementations.front_link( self.front_work_pool, self.front_transmission_pool, self.front_utility_pool) - self.back = implementations.back( + self.back = implementations.back_link( self.test_servicer, self.back_work_pool, self.back_transmission_pool, self.back_utility_pool, DEFAULT_TIMEOUT, MAXIMUM_TIMEOUT) self.front.join_rear_link(self.back) diff --git a/src/python/src/grpc/framework/base/packets/in_memory.py b/src/python/src/grpc/framework/base/in_memory.py similarity index 97% rename from src/python/src/grpc/framework/base/packets/in_memory.py rename to src/python/src/grpc/framework/base/in_memory.py index 453fd3b38aa..9ed62f8e0a8 100644 --- a/src/python/src/grpc/framework/base/packets/in_memory.py +++ b/src/python/src/grpc/framework/base/in_memory.py @@ -31,8 +31,8 @@ import threading -from grpc.framework.base.packets import _constants -from grpc.framework.base.packets import interfaces +from grpc.framework.base import _constants +from grpc.framework.base import interfaces from grpc.framework.foundation import callable_util diff --git a/src/python/src/grpc/framework/base/interfaces.py b/src/python/src/grpc/framework/base/interfaces.py index ed43b253fe5..7be13b3f45d 100644 --- a/src/python/src/grpc/framework/base/interfaces.py +++ b/src/python/src/grpc/framework/base/interfaces.py @@ -30,6 +30,7 @@ """Interfaces defined and used by the base layer of RPC Framework.""" import abc +import collections import enum # stream is referenced from specification in this module. @@ -230,3 +231,133 @@ class Front(End): class Back(End): """Serverish objects that perform the work of operations.""" __metaclass__ = abc.ABCMeta + + +class FrontToBackPacket( + collections.namedtuple( + 'FrontToBackPacket', + ['operation_id', 'sequence_number', 'kind', 'name', 'subscription', + 'trace_id', 'payload', 'timeout'])): + """A sum type for all values sent from a front to a back. + + Attributes: + operation_id: A unique-with-respect-to-equality hashable object identifying + a particular operation. + sequence_number: A zero-indexed integer sequence number identifying the + packet's place among all the packets sent from front to back for this + particular operation. Must be zero if kind is Kind.COMMENCEMENT or + Kind.ENTIRE. Must be positive for any other kind. + kind: A Kind value describing the overall kind of ticket. + name: The name of an operation. Must be present if kind is Kind.COMMENCEMENT + or Kind.ENTIRE. Must be None for any other kind. + subscription: An ServicedSubscription.Kind value describing the interest + the front has in packets sent from the back. Must be present if + kind is Kind.COMMENCEMENT or Kind.ENTIRE. Must be None for any other kind. + trace_id: A uuid.UUID identifying a set of related operations to which this + operation belongs. May be None. + payload: A customer payload object. Must be present if kind is + Kind.CONTINUATION. Must be None if kind is Kind.CANCELLATION. May be None + for any other kind. + timeout: An optional length of time (measured from the beginning of the + operation) to allow for the entire operation. If None, a default value on + the back will be used. If present and excessively large, the back may + limit the operation to a smaller duration of its choice. May be present + for any ticket kind; setting a value on a later ticket allows fronts + to request time extensions (or even time reductions!) on in-progress + operations. + """ + + @enum.unique + class Kind(enum.Enum): + """Identifies the overall kind of a FrontToBackPacket.""" + + COMMENCEMENT = 'commencement' + CONTINUATION = 'continuation' + COMPLETION = 'completion' + ENTIRE = 'entire' + CANCELLATION = 'cancellation' + EXPIRATION = 'expiration' + SERVICER_FAILURE = 'servicer failure' + SERVICED_FAILURE = 'serviced failure' + RECEPTION_FAILURE = 'reception failure' + TRANSMISSION_FAILURE = 'transmission failure' + + +class BackToFrontPacket( + collections.namedtuple( + 'BackToFrontPacket', + ['operation_id', 'sequence_number', 'kind', 'payload'])): + """A sum type for all values sent from a back to a front. + + Attributes: + operation_id: A unique-with-respect-to-equality hashable object identifying + a particular operation. + sequence_number: A zero-indexed integer sequence number identifying the + packet's place among all the packets sent from back to front for this + particular operation. + kind: A Kind value describing the overall kind of ticket. + payload: A customer payload object. Must be present if kind is + Kind.CONTINUATION. May be None if kind is Kind.COMPLETION. Must be None + otherwise. + """ + + @enum.unique + class Kind(enum.Enum): + """Identifies the overall kind of a BackToFrontPacket.""" + + CONTINUATION = 'continuation' + COMPLETION = 'completion' + CANCELLATION = 'cancellation' + EXPIRATION = 'expiration' + SERVICER_FAILURE = 'servicer failure' + SERVICED_FAILURE = 'serviced failure' + RECEPTION_FAILURE = 'reception failure' + TRANSMISSION_FAILURE = 'transmission failure' + + +class ForeLink(object): + """Accepts back-to-front tickets and emits front-to-back tickets.""" + __metaclass__ = abc.ABCMeta + + @abc.abstractmethod + def accept_back_to_front_ticket(self, ticket): + """Accept a BackToFrontPacket. + + Args: + ticket: Any BackToFrontPacket. + """ + raise NotImplementedError() + + @abc.abstractmethod + def join_rear_link(self, rear_link): + """Mates this object with a peer with which it will exchange tickets.""" + raise NotImplementedError() + + +class RearLink(object): + """Accepts front-to-back tickets and emits back-to-front tickets.""" + __metaclass__ = abc.ABCMeta + + @abc.abstractmethod + def accept_front_to_back_ticket(self, ticket): + """Accepts a FrontToBackPacket. + + Args: + ticket: Any FrontToBackPacket. + """ + raise NotImplementedError() + + @abc.abstractmethod + def join_fore_link(self, fore_link): + """Mates this object with a peer with which it will exchange tickets.""" + raise NotImplementedError() + + +class FrontLink(Front, ForeLink): + """Clientish objects that operate by sending and receiving tickets.""" + __metaclass__ = abc.ABCMeta + + +class BackLink(Back, RearLink): + """Serverish objects that operate by sending and receiving tickets.""" + __metaclass__ = abc.ABCMeta diff --git a/src/python/src/grpc/framework/base/packets/null.py b/src/python/src/grpc/framework/base/null.py similarity index 97% rename from src/python/src/grpc/framework/base/packets/null.py rename to src/python/src/grpc/framework/base/null.py index 5a2121243bf..1e30d4557b1 100644 --- a/src/python/src/grpc/framework/base/packets/null.py +++ b/src/python/src/grpc/framework/base/null.py @@ -29,7 +29,7 @@ """Null links that ignore tickets passed to them.""" -from grpc.framework.base.packets import interfaces +from grpc.framework.base import interfaces class _NullForeLink(interfaces.ForeLink): diff --git a/src/python/src/grpc/framework/base/packets/__init__.py b/src/python/src/grpc/framework/base/packets/__init__.py deleted file mode 100644 index 70865191060..00000000000 --- a/src/python/src/grpc/framework/base/packets/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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. - - diff --git a/src/python/src/grpc/framework/base/packets/interfaces.py b/src/python/src/grpc/framework/base/packets/interfaces.py deleted file mode 100644 index 7c48956ba59..00000000000 --- a/src/python/src/grpc/framework/base/packets/interfaces.py +++ /dev/null @@ -1,84 +0,0 @@ -# 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. - -"""Interfaces defined and used by the base layer of RPC Framework.""" - -import abc - -# packets is referenced from specifications in this module. -from grpc.framework.base import interfaces -from grpc.framework.base.packets import packets # pylint: disable=unused-import - - -class ForeLink(object): - """Accepts back-to-front tickets and emits front-to-back tickets.""" - __metaclass__ = abc.ABCMeta - - @abc.abstractmethod - def accept_back_to_front_ticket(self, ticket): - """Accept a packets.BackToFrontPacket. - - Args: - ticket: Any packets.BackToFrontPacket. - """ - raise NotImplementedError() - - @abc.abstractmethod - def join_rear_link(self, rear_link): - """Mates this object with a peer with which it will exchange tickets.""" - raise NotImplementedError() - - -class RearLink(object): - """Accepts front-to-back tickets and emits back-to-front tickets.""" - __metaclass__ = abc.ABCMeta - - @abc.abstractmethod - def accept_front_to_back_ticket(self, ticket): - """Accepts a packets.FrontToBackPacket. - - Args: - ticket: Any packets.FrontToBackPacket. - """ - raise NotImplementedError() - - @abc.abstractmethod - def join_fore_link(self, fore_link): - """Mates this object with a peer with which it will exchange tickets.""" - raise NotImplementedError() - - -class Front(ForeLink, interfaces.Front): - """Clientish objects that operate by sending and receiving tickets.""" - __metaclass__ = abc.ABCMeta - - -class Back(RearLink, interfaces.Back): - """Serverish objects that operate by sending and receiving tickets.""" - __metaclass__ = abc.ABCMeta diff --git a/src/python/src/grpc/framework/base/packets/packets.py b/src/python/src/grpc/framework/base/packets/packets.py deleted file mode 100644 index 1b140481f0e..00000000000 --- a/src/python/src/grpc/framework/base/packets/packets.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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. - -"""Packets used between fronts and backs.""" - -import collections -import enum - -# interfaces is referenced from specifications in this module. -from grpc.framework.base import interfaces # pylint: disable=unused-import - - -class FrontToBackPacket( - collections.namedtuple( - 'FrontToBackPacket', - ['operation_id', 'sequence_number', 'kind', 'name', 'subscription', - 'trace_id', 'payload', 'timeout'])): - """A sum type for all values sent from a front to a back. - - Attributes: - operation_id: A unique-with-respect-to-equality hashable object identifying - a particular operation. - sequence_number: A zero-indexed integer sequence number identifying the - packet's place among all the packets sent from front to back for this - particular operation. Must be zero if kind is Kind.COMMENCEMENT or - Kind.ENTIRE. Must be positive for any other kind. - kind: A Kind value describing the overall kind of ticket. - name: The name of an operation. Must be present if kind is Kind.COMMENCEMENT - or Kind.ENTIRE. Must be None for any other kind. - subscription: An interfaces.ServicedSubscription.Kind value describing the - interest the front has in packets sent from the back. Must be present if - kind is Kind.COMMENCEMENT or Kind.ENTIRE. Must be None for any other kind. - trace_id: A uuid.UUID identifying a set of related operations to which this - operation belongs. May be None. - payload: A customer payload object. Must be present if kind is - Kind.CONTINUATION. Must be None if kind is Kind.CANCELLATION. May be None - for any other kind. - timeout: An optional length of time (measured from the beginning of the - operation) to allow for the entire operation. If None, a default value on - the back will be used. If present and excessively large, the back may - limit the operation to a smaller duration of its choice. May be present - for any ticket kind; setting a value on a later ticket allows fronts - to request time extensions (or even time reductions!) on in-progress - operations. - """ - - @enum.unique - class Kind(enum.Enum): - """Identifies the overall kind of a FrontToBackPacket.""" - - COMMENCEMENT = 'commencement' - CONTINUATION = 'continuation' - COMPLETION = 'completion' - ENTIRE = 'entire' - CANCELLATION = 'cancellation' - EXPIRATION = 'expiration' - SERVICER_FAILURE = 'servicer failure' - SERVICED_FAILURE = 'serviced failure' - RECEPTION_FAILURE = 'reception failure' - TRANSMISSION_FAILURE = 'transmission failure' - - -class BackToFrontPacket( - collections.namedtuple( - 'BackToFrontPacket', - ['operation_id', 'sequence_number', 'kind', 'payload'])): - """A sum type for all values sent from a back to a front. - - Attributes: - operation_id: A unique-with-respect-to-equality hashable object identifying - a particular operation. - sequence_number: A zero-indexed integer sequence number identifying the - packet's place among all the packets sent from back to front for this - particular operation. - kind: A Kind value describing the overall kind of ticket. - payload: A customer payload object. Must be present if kind is - Kind.CONTINUATION. May be None if kind is Kind.COMPLETION. Must be None - otherwise. - """ - - @enum.unique - class Kind(enum.Enum): - """Identifies the overall kind of a BackToFrontPacket.""" - - CONTINUATION = 'continuation' - COMPLETION = 'completion' - CANCELLATION = 'cancellation' - EXPIRATION = 'expiration' - SERVICER_FAILURE = 'servicer failure' - SERVICED_FAILURE = 'serviced failure' - RECEPTION_FAILURE = 'reception failure' - TRANSMISSION_FAILURE = 'transmission failure' diff --git a/src/python/src/grpc/framework/face/demonstration.py b/src/python/src/grpc/framework/face/demonstration.py index d922f6e5ef0..eabeac45697 100644 --- a/src/python/src/grpc/framework/face/demonstration.py +++ b/src/python/src/grpc/framework/face/demonstration.py @@ -30,7 +30,7 @@ """Demonstration-suitable implementation of the face layer of RPC Framework.""" from grpc.framework.base import util as _base_util -from grpc.framework.base.packets import implementations as _tickets_implementations +from grpc.framework.base import implementations as _base_implementations from grpc.framework.face import implementations from grpc.framework.foundation import logging_pool @@ -105,9 +105,9 @@ def server_and_stub( event_stream_in_stream_out_methods=event_stream_in_stream_out_methods, multi_method=multi_method) - front = _tickets_implementations.front( + front = _base_implementations.front_link( front_work_pool, front_transmission_pool, front_utility_pool) - back = _tickets_implementations.back( + back = _base_implementations.back_link( servicer, back_work_pool, back_transmission_pool, back_utility_pool, default_timeout, _MAXIMUM_TIMEOUT) front.join_rear_link(back) diff --git a/src/python/src/grpc/framework/face/testing/base_util.py b/src/python/src/grpc/framework/face/testing/base_util.py index 7872a6b9e94..151d0ef793c 100644 --- a/src/python/src/grpc/framework/face/testing/base_util.py +++ b/src/python/src/grpc/framework/face/testing/base_util.py @@ -33,9 +33,9 @@ import abc # interfaces is referenced from specification in this module. from grpc.framework.base import util as _base_util -from grpc.framework.base.packets import implementations -from grpc.framework.base.packets import in_memory -from grpc.framework.base.packets import interfaces # pylint: disable=unused-import +from grpc.framework.base import implementations +from grpc.framework.base import in_memory +from grpc.framework.base import interfaces # pylint: disable=unused-import from grpc.framework.foundation import logging_pool _POOL_SIZE_LIMIT = 20 @@ -89,9 +89,9 @@ def linked_pair(servicer, default_timeout): back_work_pool, back_transmission_pool, back_utility_pool) link = in_memory.Link(link_pool) - front = implementations.front( + front = implementations.front_link( front_work_pool, front_transmission_pool, front_utility_pool) - back = implementations.back( + back = implementations.back_link( servicer, back_work_pool, back_transmission_pool, back_utility_pool, default_timeout, _MAXIMUM_TIMEOUT) front.join_rear_link(link) diff --git a/src/python/src/setup.py b/src/python/src/setup.py index 7d93aa7ded0..63731212c70 100644 --- a/src/python/src/setup.py +++ b/src/python/src/setup.py @@ -65,7 +65,6 @@ _PACKAGES = ( 'grpc.early_adopter', 'grpc.framework', 'grpc.framework.base', - 'grpc.framework.base.packets', 'grpc.framework.common', 'grpc.framework.face', 'grpc.framework.face.testing', diff --git a/tools/dockerfile/grpc_python/Dockerfile b/tools/dockerfile/grpc_python/Dockerfile index fd07e9cc6a9..62ef785a318 100644 --- a/tools/dockerfile/grpc_python/Dockerfile +++ b/tools/dockerfile/grpc_python/Dockerfile @@ -54,7 +54,7 @@ RUN cd /var/local/git/grpc \ && python2.7 -B -m grpc._adapter._lonely_rear_link_test \ && python2.7 -B -m grpc._adapter._low_test \ && python2.7 -B -m grpc.early_adopter.implementations_test \ - && python2.7 -B -m grpc.framework.base.packets.implementations_test \ + && python2.7 -B -m grpc.framework.base.implementations_test \ && python2.7 -B -m grpc.framework.face.blocking_invocation_inline_service_test \ && python2.7 -B -m grpc.framework.face.event_invocation_synchronous_event_service_test \ && python2.7 -B -m grpc.framework.face.future_invocation_asynchronous_event_service_test \ diff --git a/tools/run_tests/python_tests.json b/tools/run_tests/python_tests.json index ef483d9799c..dff053784db 100755 --- a/tools/run_tests/python_tests.json +++ b/tools/run_tests/python_tests.json @@ -27,7 +27,7 @@ "module": "grpc.early_adopter.implementations_test" }, { - "module": "grpc.framework.base.packets.implementations_test" + "module": "grpc.framework.base.implementations_test" }, { "module": "grpc.framework.face.blocking_invocation_inline_service_test" From 492dfdb950f5fec33be79b67ea12005d20ca7e3a Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Wed, 18 Mar 2015 00:23:51 +0000 Subject: [PATCH 55/75] Correct a package name in a doc string --- src/python/src/grpc/framework/foundation/_logging_pool_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/src/grpc/framework/foundation/_logging_pool_test.py b/src/python/src/grpc/framework/foundation/_logging_pool_test.py index 11463a8bece..c92cf8c0ab6 100644 --- a/src/python/src/grpc/framework/foundation/_logging_pool_test.py +++ b/src/python/src/grpc/framework/foundation/_logging_pool_test.py @@ -27,7 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""Tests for _framework.foundation.logging_pool.""" +"""Tests for grpc.framework.foundation.logging_pool.""" import unittest From de5490c15c90c5276f8c4e40fa55c3e1537e53df Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Wed, 18 Mar 2015 00:37:19 +0000 Subject: [PATCH 56/75] Change remaining "packet" names to "ticket" This renaming has been incrementally happening for the last several weeks and this change finishes it. --- src/python/src/grpc/_adapter/_links_test.py | 56 ++--- .../grpc/_adapter/_lonely_rear_link_test.py | 14 +- src/python/src/grpc/_adapter/fore.py | 32 +-- src/python/src/grpc/_adapter/rear.py | 32 +-- src/python/src/grpc/framework/base/_ends.py | 12 +- .../src/grpc/framework/base/_interfaces.py | 8 +- .../src/grpc/framework/base/_reception.py | 208 +++++++++--------- .../src/grpc/framework/base/_transmission.py | 190 ++++++++-------- .../grpc/framework/base/implementations.py | 2 +- .../src/grpc/framework/base/in_memory.py | 2 +- .../src/grpc/framework/base/interfaces.py | 26 +-- .../framework/base/interfaces_test_case.py | 24 +- 12 files changed, 303 insertions(+), 303 deletions(-) diff --git a/src/python/src/grpc/_adapter/_links_test.py b/src/python/src/grpc/_adapter/_links_test.py index dc8ad15487e..cfdcc2c4bc9 100644 --- a/src/python/src/grpc/_adapter/_links_test.py +++ b/src/python/src/grpc/_adapter/_links_test.py @@ -59,11 +59,11 @@ class RoundTripTest(unittest.TestCase): test_fore_link = _test_links.ForeLink(None, None) def rear_action(front_to_back_ticket, fore_link): if front_to_back_ticket.kind in ( - interfaces.FrontToBackPacket.Kind.COMPLETION, - interfaces.FrontToBackPacket.Kind.ENTIRE): - back_to_front_ticket = interfaces.BackToFrontPacket( + interfaces.FrontToBackTicket.Kind.COMPLETION, + interfaces.FrontToBackTicket.Kind.ENTIRE): + back_to_front_ticket = interfaces.BackToFrontTicket( front_to_back_ticket.operation_id, 0, - interfaces.BackToFrontPacket.Kind.COMPLETION, None) + interfaces.BackToFrontTicket.Kind.COMPLETION, None) fore_link.accept_back_to_front_ticket(back_to_front_ticket) test_rear_link = _test_links.RearLink(rear_action, None) @@ -81,8 +81,8 @@ class RoundTripTest(unittest.TestCase): test_fore_link.join_rear_link(rear_link) rear_link.start() - front_to_back_ticket = interfaces.FrontToBackPacket( - test_operation_id, 0, interfaces.FrontToBackPacket.Kind.ENTIRE, + front_to_back_ticket = interfaces.FrontToBackTicket( + test_operation_id, 0, interfaces.FrontToBackTicket.Kind.ENTIRE, test_method, interfaces.ServicedSubscription.Kind.FULL, None, None, _TIMEOUT) rear_link.accept_front_to_back_ticket(front_to_back_ticket) @@ -90,7 +90,7 @@ class RoundTripTest(unittest.TestCase): with test_fore_link.condition: while (not test_fore_link.tickets or test_fore_link.tickets[-1].kind is - interfaces.BackToFrontPacket.Kind.CONTINUATION): + interfaces.BackToFrontTicket.Kind.CONTINUATION): test_fore_link.condition.wait() rear_link.stop() @@ -99,7 +99,7 @@ class RoundTripTest(unittest.TestCase): with test_fore_link.condition: self.assertIs( test_fore_link.tickets[-1].kind, - interfaces.BackToFrontPacket.Kind.COMPLETION) + interfaces.BackToFrontTicket.Kind.COMPLETION) def testEntireRoundTrip(self): test_operation_id = object() @@ -114,14 +114,14 @@ class RoundTripTest(unittest.TestCase): else: payload = test_back_to_front_datum terminal = front_to_back_ticket.kind in ( - interfaces.FrontToBackPacket.Kind.COMPLETION, - interfaces.FrontToBackPacket.Kind.ENTIRE) + interfaces.FrontToBackTicket.Kind.COMPLETION, + interfaces.FrontToBackTicket.Kind.ENTIRE) if payload is not None or terminal: if terminal: - kind = interfaces.BackToFrontPacket.Kind.COMPLETION + kind = interfaces.BackToFrontTicket.Kind.COMPLETION else: - kind = interfaces.BackToFrontPacket.Kind.CONTINUATION - back_to_front_ticket = interfaces.BackToFrontPacket( + kind = interfaces.BackToFrontTicket.Kind.CONTINUATION + back_to_front_ticket = interfaces.BackToFrontTicket( front_to_back_ticket.operation_id, rear_sequence_number[0], kind, payload) rear_sequence_number[0] += 1 @@ -143,8 +143,8 @@ class RoundTripTest(unittest.TestCase): test_fore_link.join_rear_link(rear_link) rear_link.start() - front_to_back_ticket = interfaces.FrontToBackPacket( - test_operation_id, 0, interfaces.FrontToBackPacket.Kind.ENTIRE, + front_to_back_ticket = interfaces.FrontToBackTicket( + test_operation_id, 0, interfaces.FrontToBackTicket.Kind.ENTIRE, test_method, interfaces.ServicedSubscription.Kind.FULL, None, test_front_to_back_datum, _TIMEOUT) rear_link.accept_front_to_back_ticket(front_to_back_ticket) @@ -152,7 +152,7 @@ class RoundTripTest(unittest.TestCase): with test_fore_link.condition: while (not test_fore_link.tickets or test_fore_link.tickets[-1].kind is not - interfaces.BackToFrontPacket.Kind.COMPLETION): + interfaces.BackToFrontTicket.Kind.COMPLETION): test_fore_link.condition.wait() rear_link.stop() @@ -182,14 +182,14 @@ class RoundTripTest(unittest.TestCase): else: response = None terminal = front_to_back_ticket.kind in ( - interfaces.FrontToBackPacket.Kind.COMPLETION, - interfaces.FrontToBackPacket.Kind.ENTIRE) + interfaces.FrontToBackTicket.Kind.COMPLETION, + interfaces.FrontToBackTicket.Kind.ENTIRE) if response is not None or terminal: if terminal: - kind = interfaces.BackToFrontPacket.Kind.COMPLETION + kind = interfaces.BackToFrontTicket.Kind.COMPLETION else: - kind = interfaces.BackToFrontPacket.Kind.CONTINUATION - back_to_front_ticket = interfaces.BackToFrontPacket( + kind = interfaces.BackToFrontTicket.Kind.CONTINUATION + back_to_front_ticket = interfaces.BackToFrontTicket( front_to_back_ticket.operation_id, rear_sequence_number[0], kind, response) rear_sequence_number[0] += 1 @@ -212,23 +212,23 @@ class RoundTripTest(unittest.TestCase): test_fore_link.join_rear_link(rear_link) rear_link.start() - commencement_ticket = interfaces.FrontToBackPacket( + commencement_ticket = interfaces.FrontToBackTicket( test_operation_id, 0, - interfaces.FrontToBackPacket.Kind.COMMENCEMENT, test_method, + interfaces.FrontToBackTicket.Kind.COMMENCEMENT, test_method, interfaces.ServicedSubscription.Kind.FULL, None, None, _TIMEOUT) fore_sequence_number = 1 rear_link.accept_front_to_back_ticket(commencement_ticket) for request in scenario.requests(): - continuation_ticket = interfaces.FrontToBackPacket( + continuation_ticket = interfaces.FrontToBackTicket( test_operation_id, fore_sequence_number, - interfaces.FrontToBackPacket.Kind.CONTINUATION, None, None, None, + interfaces.FrontToBackTicket.Kind.CONTINUATION, None, None, None, request, None) fore_sequence_number += 1 rear_link.accept_front_to_back_ticket(continuation_ticket) - completion_ticket = interfaces.FrontToBackPacket( + completion_ticket = interfaces.FrontToBackTicket( test_operation_id, fore_sequence_number, - interfaces.FrontToBackPacket.Kind.COMPLETION, None, None, None, None, + interfaces.FrontToBackTicket.Kind.COMPLETION, None, None, None, None, None) fore_sequence_number += 1 rear_link.accept_front_to_back_ticket(completion_ticket) @@ -236,7 +236,7 @@ class RoundTripTest(unittest.TestCase): with test_fore_link.condition: while (not test_fore_link.tickets or test_fore_link.tickets[-1].kind is not - interfaces.BackToFrontPacket.Kind.COMPLETION): + interfaces.BackToFrontTicket.Kind.COMPLETION): test_fore_link.condition.wait() rear_link.stop() diff --git a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py b/src/python/src/grpc/_adapter/_lonely_rear_link_test.py index 4417f57e59e..25799d679c7 100644 --- a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py +++ b/src/python/src/grpc/_adapter/_lonely_rear_link_test.py @@ -67,7 +67,7 @@ class LonelyRearLinkTest(unittest.TestCase): rear_link.join_fore_link(fore_link) rear_link.start() - front_to_back_ticket = interfaces.FrontToBackPacket( + front_to_back_ticket = interfaces.FrontToBackTicket( test_operation_id, 0, front_to_back_ticket_kind, test_method, interfaces.ServicedSubscription.Kind.FULL, None, None, _TIMEOUT) rear_link.accept_front_to_back_ticket(front_to_back_ticket) @@ -76,7 +76,7 @@ class LonelyRearLinkTest(unittest.TestCase): while True: if (fore_link.tickets and fore_link.tickets[-1].kind is not - interfaces.BackToFrontPacket.Kind.CONTINUATION): + interfaces.BackToFrontTicket.Kind.CONTINUATION): break fore_link.condition.wait() @@ -85,15 +85,15 @@ class LonelyRearLinkTest(unittest.TestCase): with fore_link.condition: self.assertIsNot( fore_link.tickets[-1].kind, - interfaces.BackToFrontPacket.Kind.COMPLETION) + interfaces.BackToFrontTicket.Kind.COMPLETION) - def testLonelyClientCommencementPacket(self): + def testLonelyClientCommencementTicket(self): self._perform_lonely_client_test_with_ticket_kind( - interfaces.FrontToBackPacket.Kind.COMMENCEMENT) + interfaces.FrontToBackTicket.Kind.COMMENCEMENT) - def testLonelyClientEntirePacket(self): + def testLonelyClientEntireTicket(self): self._perform_lonely_client_test_with_ticket_kind( - interfaces.FrontToBackPacket.Kind.ENTIRE) + interfaces.FrontToBackTicket.Kind.ENTIRE) if __name__ == '__main__': diff --git a/src/python/src/grpc/_adapter/fore.py b/src/python/src/grpc/_adapter/fore.py index 85b1359e848..05016cdaf31 100644 --- a/src/python/src/grpc/_adapter/fore.py +++ b/src/python/src/grpc/_adapter/fore.py @@ -125,8 +125,8 @@ class ForeLink(base_interfaces.ForeLink, activated.Activated): self._request_deserializers[method], self._response_serializers[method]) - ticket = base_interfaces.FrontToBackPacket( - call, 0, base_interfaces.FrontToBackPacket.Kind.COMMENCEMENT, method, + ticket = base_interfaces.FrontToBackTicket( + call, 0, base_interfaces.FrontToBackTicket.Kind.COMMENCEMENT, method, base_interfaces.ServicedSubscription.Kind.FULL, None, None, service_acceptance.deadline - time.time()) self._rear_link.accept_front_to_back_ticket(ticket) @@ -143,15 +143,15 @@ class ForeLink(base_interfaces.ForeLink, activated.Activated): sequence_number = rpc_state.sequence_number rpc_state.sequence_number += 1 if event.bytes is None: - ticket = base_interfaces.FrontToBackPacket( + ticket = base_interfaces.FrontToBackTicket( call, sequence_number, - base_interfaces.FrontToBackPacket.Kind.COMPLETION, None, None, None, + base_interfaces.FrontToBackTicket.Kind.COMPLETION, None, None, None, None, None) else: call.read(call) - ticket = base_interfaces.FrontToBackPacket( + ticket = base_interfaces.FrontToBackTicket( call, sequence_number, - base_interfaces.FrontToBackPacket.Kind.CONTINUATION, None, None, + base_interfaces.FrontToBackTicket.Kind.CONTINUATION, None, None, None, rpc_state.deserializer(event.bytes), None) self._rear_link.accept_front_to_back_ticket(ticket) @@ -180,9 +180,9 @@ class ForeLink(base_interfaces.ForeLink, activated.Activated): sequence_number = rpc_state.sequence_number rpc_state.sequence_number += 1 - ticket = base_interfaces.FrontToBackPacket( + ticket = base_interfaces.FrontToBackTicket( call, sequence_number, - base_interfaces.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, None, + base_interfaces.FrontToBackTicket.Kind.TRANSMISSION_FAILURE, None, None, None, None, None) self._rear_link.accept_front_to_back_ticket(ticket) @@ -200,20 +200,20 @@ class ForeLink(base_interfaces.ForeLink, activated.Activated): sequence_number = rpc_state.sequence_number rpc_state.sequence_number += 1 if code is _low.Code.CANCELLED: - ticket = base_interfaces.FrontToBackPacket( + ticket = base_interfaces.FrontToBackTicket( call, sequence_number, - base_interfaces.FrontToBackPacket.Kind.CANCELLATION, None, None, + base_interfaces.FrontToBackTicket.Kind.CANCELLATION, None, None, None, None, None) elif code is _low.Code.EXPIRED: - ticket = base_interfaces.FrontToBackPacket( + ticket = base_interfaces.FrontToBackTicket( call, sequence_number, - base_interfaces.FrontToBackPacket.Kind.EXPIRATION, None, None, None, + base_interfaces.FrontToBackTicket.Kind.EXPIRATION, None, None, None, None, None) else: # TODO(nathaniel): Better mapping of codes to ticket-categories - ticket = base_interfaces.FrontToBackPacket( + ticket = base_interfaces.FrontToBackTicket( call, sequence_number, - base_interfaces.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, None, + base_interfaces.FrontToBackTicket.Kind.TRANSMISSION_FAILURE, None, None, None, None, None) self._rear_link.accept_front_to_back_ticket(ticket) @@ -355,9 +355,9 @@ class ForeLink(base_interfaces.ForeLink, activated.Activated): if self._server is None: return - if ticket.kind is base_interfaces.BackToFrontPacket.Kind.CONTINUATION: + if ticket.kind is base_interfaces.BackToFrontTicket.Kind.CONTINUATION: self._continue(ticket.operation_id, ticket.payload) - elif ticket.kind is base_interfaces.BackToFrontPacket.Kind.COMPLETION: + elif ticket.kind is base_interfaces.BackToFrontTicket.Kind.COMPLETION: self._complete(ticket.operation_id, ticket.payload) else: self._cancel(ticket.operation_id) diff --git a/src/python/src/grpc/_adapter/rear.py b/src/python/src/grpc/_adapter/rear.py index f2d9aae8ab3..f19321c4266 100644 --- a/src/python/src/grpc/_adapter/rear.py +++ b/src/python/src/grpc/_adapter/rear.py @@ -151,9 +151,9 @@ class RearLink(base_interfaces.RearLink, activated.Activated): else: logging.error('RPC write not accepted! Event: %s', (event,)) rpc_state.active = False - ticket = base_interfaces.BackToFrontPacket( + ticket = base_interfaces.BackToFrontTicket( operation_id, rpc_state.common.sequence_number, - base_interfaces.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, None) + base_interfaces.BackToFrontTicket.Kind.TRANSMISSION_FAILURE, None) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -162,9 +162,9 @@ class RearLink(base_interfaces.RearLink, activated.Activated): rpc_state.call.read(operation_id) rpc_state.outstanding.add(_low.Event.Kind.READ_ACCEPTED) - ticket = base_interfaces.BackToFrontPacket( + ticket = base_interfaces.BackToFrontTicket( operation_id, rpc_state.common.sequence_number, - base_interfaces.BackToFrontPacket.Kind.CONTINUATION, + base_interfaces.BackToFrontTicket.Kind.CONTINUATION, rpc_state.common.deserializer(event.bytes)) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -173,9 +173,9 @@ class RearLink(base_interfaces.RearLink, activated.Activated): if not event.complete_accepted: logging.error('RPC complete not accepted! Event: %s', (event,)) rpc_state.active = False - ticket = base_interfaces.BackToFrontPacket( + ticket = base_interfaces.BackToFrontTicket( operation_id, rpc_state.common.sequence_number, - base_interfaces.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, None) + base_interfaces.BackToFrontTicket.Kind.TRANSMISSION_FAILURE, None) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -188,14 +188,14 @@ class RearLink(base_interfaces.RearLink, activated.Activated): """Handle termination of an RPC.""" # TODO(nathaniel): Cover all statuses. if event.status.code is _low.Code.OK: - kind = base_interfaces.BackToFrontPacket.Kind.COMPLETION + kind = base_interfaces.BackToFrontTicket.Kind.COMPLETION elif event.status.code is _low.Code.CANCELLED: - kind = base_interfaces.BackToFrontPacket.Kind.CANCELLATION + kind = base_interfaces.BackToFrontTicket.Kind.CANCELLATION elif event.status.code is _low.Code.EXPIRED: - kind = base_interfaces.BackToFrontPacket.Kind.EXPIRATION + kind = base_interfaces.BackToFrontTicket.Kind.EXPIRATION else: - kind = base_interfaces.BackToFrontPacket.Kind.TRANSMISSION_FAILURE - ticket = base_interfaces.BackToFrontPacket( + kind = base_interfaces.BackToFrontTicket.Kind.TRANSMISSION_FAILURE + ticket = base_interfaces.BackToFrontTicket( operation_id, rpc_state.common.sequence_number, kind, None) rpc_state.common.sequence_number += 1 self._fore_link.accept_back_to_front_ticket(ticket) @@ -370,17 +370,17 @@ class RearLink(base_interfaces.RearLink, activated.Activated): if self._completion_queue is None: return - if ticket.kind is base_interfaces.FrontToBackPacket.Kind.COMMENCEMENT: + if ticket.kind is base_interfaces.FrontToBackTicket.Kind.COMMENCEMENT: self._commence( ticket.operation_id, ticket.name, ticket.payload, ticket.timeout) - elif ticket.kind is base_interfaces.FrontToBackPacket.Kind.CONTINUATION: + elif ticket.kind is base_interfaces.FrontToBackTicket.Kind.CONTINUATION: self._continue(ticket.operation_id, ticket.payload) - elif ticket.kind is base_interfaces.FrontToBackPacket.Kind.COMPLETION: + elif ticket.kind is base_interfaces.FrontToBackTicket.Kind.COMPLETION: self._complete(ticket.operation_id, ticket.payload) - elif ticket.kind is base_interfaces.FrontToBackPacket.Kind.ENTIRE: + elif ticket.kind is base_interfaces.FrontToBackTicket.Kind.ENTIRE: self._entire( ticket.operation_id, ticket.name, ticket.payload, ticket.timeout) - elif ticket.kind is base_interfaces.FrontToBackPacket.Kind.CANCELLATION: + elif ticket.kind is base_interfaces.FrontToBackTicket.Kind.CANCELLATION: self._cancel(ticket.operation_id) else: # NOTE(nathaniel): All other categories are treated as cancellation. diff --git a/src/python/src/grpc/framework/base/_ends.py b/src/python/src/grpc/framework/base/_ends.py index e774b49df3a..176f3ac06e3 100644 --- a/src/python/src/grpc/framework/base/_ends.py +++ b/src/python/src/grpc/framework/base/_ends.py @@ -150,7 +150,7 @@ def _front_operate( """Constructs objects necessary for front-side operation management. Args: - callback: A callable that accepts interfaces.FrontToBackPackets and + callback: A callable that accepts interfaces.FrontToBackTickets and delivers them to the other side of the operation. Execution of this callable may take any arbitrary length of time. work_pool: A thread pool in which to execute customer code. @@ -276,7 +276,7 @@ class FrontLink(interfaces.FrontLink): with self._endlette: reception_manager = self._endlette.get_operation(ticket.operation_id) if reception_manager: - reception_manager.receive_packet(ticket) + reception_manager.receive_ticket(ticket) def _back_operate( @@ -289,7 +289,7 @@ def _back_operate( Args: servicer: An interfaces.Servicer for servicing operations. - callback: A callable that accepts interfaces.BackToFrontPackets and + callback: A callable that accepts interfaces.BackToFrontTickets and delivers them to the other side of the operation. Execution of this callable may take any arbitrary length of time. work_pool: A thread pool in which to execute customer code. @@ -298,7 +298,7 @@ def _back_operate( utility_pool: A thread pool for utility tasks. termination_action: A no-arg behavior to be called upon operation completion. - ticket: The first interfaces.FrontToBackPacket received for the operation. + ticket: The first interfaces.FrontToBackTicket received for the operation. default_timeout: A length of time in seconds to be used as the default time alloted for a single operation. maximum_timeout: A length of time in seconds to be used as the maximum @@ -338,7 +338,7 @@ def _back_operate( ingestion_manager, expiration_manager) ingestion_manager.set_expiration_manager(expiration_manager) - reception_manager.receive_packet(ticket) + reception_manager.receive_ticket(ticket) return reception_manager @@ -388,7 +388,7 @@ class BackLink(interfaces.BackLink): self._default_timeout, self._maximum_timeout) self._endlette.add_operation(ticket.operation_id, reception_manager) else: - reception_manager.receive_packet(ticket) + reception_manager.receive_ticket(ticket) def operation_stats(self): """See interfaces.End.operation_stats for specification.""" diff --git a/src/python/src/grpc/framework/base/_interfaces.py b/src/python/src/grpc/framework/base/_interfaces.py index 801420e4aca..d88cf76590e 100644 --- a/src/python/src/grpc/framework/base/_interfaces.py +++ b/src/python/src/grpc/framework/base/_interfaces.py @@ -247,15 +247,15 @@ class ExpirationManager(object): class ReceptionManager(object): - """A manager responsible for receiving packets from the other end.""" + """A manager responsible for receiving tickets from the other end.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod - def receive_packet(self, packet): - """Handle a packet from the other side of the operation. + def receive_ticket(self, ticket): + """Handle a ticket from the other side of the operation. Args: - packet: An interfaces.BackToFrontPacket or interfaces.FrontToBackPacket + ticket: An interfaces.BackToFrontTicket or interfaces.FrontToBackTicket appropriate to this end of the operation and this object. """ raise NotImplementedError() diff --git a/src/python/src/grpc/framework/base/_reception.py b/src/python/src/grpc/framework/base/_reception.py index f523800d86b..dd428964f15 100644 --- a/src/python/src/grpc/framework/base/_reception.py +++ b/src/python/src/grpc/framework/base/_reception.py @@ -27,46 +27,46 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""State and behavior for packet reception.""" +"""State and behavior for ticket reception.""" import abc from grpc.framework.base import interfaces from grpc.framework.base import _interfaces -_INITIAL_FRONT_TO_BACK_PACKET_KINDS = ( - interfaces.FrontToBackPacket.Kind.COMMENCEMENT, - interfaces.FrontToBackPacket.Kind.ENTIRE, +_INITIAL_FRONT_TO_BACK_TICKET_KINDS = ( + interfaces.FrontToBackTicket.Kind.COMMENCEMENT, + interfaces.FrontToBackTicket.Kind.ENTIRE, ) class _Receiver(object): - """Common specification of different packet-handling behavior.""" + """Common specification of different ticket-handling behavior.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod - def abort_if_abortive(self, packet): - """Aborts the operation if the packet is abortive. + def abort_if_abortive(self, ticket): + """Aborts the operation if the ticket is abortive. Args: - packet: A just-arrived packet. + ticket: A just-arrived ticket. Returns: A boolean indicating whether or not this Receiver aborted the operation - based on the packet. + based on the ticket. """ raise NotImplementedError() @abc.abstractmethod - def receive(self, packet): - """Handles a just-arrived packet. + def receive(self, ticket): + """Handles a just-arrived ticket. Args: - packet: A just-arrived packet. + ticket: A just-arrived ticket. Returns: - A boolean indicating whether or not the packet was terminal (i.e. whether - or not non-abortive packets are legal after this one). + A boolean indicating whether or not the ticket was terminal (i.e. whether + or not non-abortive tickets are legal after this one). """ raise NotImplementedError() @@ -87,13 +87,13 @@ def _abort( def _abort_if_abortive( - packet, abortive, termination_manager, transmission_manager, + ticket, abortive, termination_manager, transmission_manager, ingestion_manager, expiration_manager): - """Determines a packet's being abortive and if so aborts the operation. + """Determines a ticket's being abortive and if so aborts the operation. Args: - packet: A just-arrived packet. - abortive: A callable that takes a packet and returns an interfaces.Outcome + ticket: A just-arrived ticket. + abortive: A callable that takes a ticket and returns an interfaces.Outcome indicating that the operation should be aborted or None indicating that the operation should not be aborted. termination_manager: The operation's _interfaces.TerminationManager. @@ -104,7 +104,7 @@ def _abort_if_abortive( Returns: True if the operation was aborted; False otherwise. """ - abortion_outcome = abortive(packet) + abortion_outcome = abortive(ticket) if abortion_outcome is None: return False else: @@ -124,7 +124,7 @@ def _reception_failure( class _BackReceiver(_Receiver): - """Packet-handling specific to the back side of an operation.""" + """Ticket-handling specific to the back side of an operation.""" def __init__( self, termination_manager, transmission_manager, ingestion_manager, @@ -142,68 +142,68 @@ class _BackReceiver(_Receiver): self._ingestion_manager = ingestion_manager self._expiration_manager = expiration_manager - self._first_packet_seen = False - self._last_packet_seen = False + self._first_ticket_seen = False + self._last_ticket_seen = False - def _abortive(self, packet): - """Determines whether or not (and if so, how) a packet is abortive. + def _abortive(self, ticket): + """Determines whether or not (and if so, how) a ticket is abortive. Args: - packet: A just-arrived packet. + ticket: A just-arrived ticket. Returns: An interfaces.Outcome value describing operation abortion if the - packet is abortive or None if the packet is not abortive. + ticket is abortive or None if the ticket is not abortive. """ - if packet.kind is interfaces.FrontToBackPacket.Kind.CANCELLATION: + if ticket.kind is interfaces.FrontToBackTicket.Kind.CANCELLATION: return interfaces.Outcome.CANCELLED - elif packet.kind is interfaces.FrontToBackPacket.Kind.EXPIRATION: + elif ticket.kind is interfaces.FrontToBackTicket.Kind.EXPIRATION: return interfaces.Outcome.EXPIRED - elif packet.kind is interfaces.FrontToBackPacket.Kind.SERVICED_FAILURE: + elif ticket.kind is interfaces.FrontToBackTicket.Kind.SERVICED_FAILURE: return interfaces.Outcome.SERVICED_FAILURE - elif packet.kind is interfaces.FrontToBackPacket.Kind.RECEPTION_FAILURE: + elif ticket.kind is interfaces.FrontToBackTicket.Kind.RECEPTION_FAILURE: return interfaces.Outcome.SERVICED_FAILURE - elif (packet.kind in _INITIAL_FRONT_TO_BACK_PACKET_KINDS and - self._first_packet_seen): + elif (ticket.kind in _INITIAL_FRONT_TO_BACK_TICKET_KINDS and + self._first_ticket_seen): return interfaces.Outcome.RECEPTION_FAILURE - elif self._last_packet_seen: + elif self._last_ticket_seen: return interfaces.Outcome.RECEPTION_FAILURE else: return None - def abort_if_abortive(self, packet): + def abort_if_abortive(self, ticket): """See _Receiver.abort_if_abortive for specification.""" return _abort_if_abortive( - packet, self._abortive, self._termination_manager, + ticket, self._abortive, self._termination_manager, self._transmission_manager, self._ingestion_manager, self._expiration_manager) - def receive(self, packet): + def receive(self, ticket): """See _Receiver.receive for specification.""" - if packet.timeout is not None: - self._expiration_manager.change_timeout(packet.timeout) - - if packet.kind is interfaces.FrontToBackPacket.Kind.COMMENCEMENT: - self._first_packet_seen = True - self._ingestion_manager.start(packet.name) - if packet.payload is not None: - self._ingestion_manager.consume(packet.payload) - elif packet.kind is interfaces.FrontToBackPacket.Kind.CONTINUATION: - self._ingestion_manager.consume(packet.payload) - elif packet.kind is interfaces.FrontToBackPacket.Kind.COMPLETION: - self._last_packet_seen = True - if packet.payload is None: + if ticket.timeout is not None: + self._expiration_manager.change_timeout(ticket.timeout) + + if ticket.kind is interfaces.FrontToBackTicket.Kind.COMMENCEMENT: + self._first_ticket_seen = True + self._ingestion_manager.start(ticket.name) + if ticket.payload is not None: + self._ingestion_manager.consume(ticket.payload) + elif ticket.kind is interfaces.FrontToBackTicket.Kind.CONTINUATION: + self._ingestion_manager.consume(ticket.payload) + elif ticket.kind is interfaces.FrontToBackTicket.Kind.COMPLETION: + self._last_ticket_seen = True + if ticket.payload is None: self._ingestion_manager.terminate() else: - self._ingestion_manager.consume_and_terminate(packet.payload) + self._ingestion_manager.consume_and_terminate(ticket.payload) else: - self._first_packet_seen = True - self._last_packet_seen = True - self._ingestion_manager.start(packet.name) - if packet.payload is None: + self._first_ticket_seen = True + self._last_ticket_seen = True + self._ingestion_manager.start(ticket.name) + if ticket.payload is None: self._ingestion_manager.terminate() else: - self._ingestion_manager.consume_and_terminate(packet.payload) + self._ingestion_manager.consume_and_terminate(ticket.payload) def reception_failure(self): """See _Receiver.reception_failure for specification.""" @@ -213,7 +213,7 @@ class _BackReceiver(_Receiver): class _FrontReceiver(_Receiver): - """Packet-handling specific to the front side of an operation.""" + """Ticket-handling specific to the front side of an operation.""" def __init__( self, termination_manager, transmission_manager, ingestion_manager, @@ -231,48 +231,48 @@ class _FrontReceiver(_Receiver): self._ingestion_manager = ingestion_manager self._expiration_manager = expiration_manager - self._last_packet_seen = False + self._last_ticket_seen = False - def _abortive(self, packet): - """Determines whether or not (and if so, how) a packet is abortive. + def _abortive(self, ticket): + """Determines whether or not (and if so, how) a ticket is abortive. Args: - packet: A just-arrived packet. + ticket: A just-arrived ticket. Returns: - An interfaces.Outcome value describing operation abortion if the packet - is abortive or None if the packet is not abortive. + An interfaces.Outcome value describing operation abortion if the ticket + is abortive or None if the ticket is not abortive. """ - if packet.kind is interfaces.BackToFrontPacket.Kind.CANCELLATION: + if ticket.kind is interfaces.BackToFrontTicket.Kind.CANCELLATION: return interfaces.Outcome.CANCELLED - elif packet.kind is interfaces.BackToFrontPacket.Kind.EXPIRATION: + elif ticket.kind is interfaces.BackToFrontTicket.Kind.EXPIRATION: return interfaces.Outcome.EXPIRED - elif packet.kind is interfaces.BackToFrontPacket.Kind.SERVICER_FAILURE: + elif ticket.kind is interfaces.BackToFrontTicket.Kind.SERVICER_FAILURE: return interfaces.Outcome.SERVICER_FAILURE - elif packet.kind is interfaces.BackToFrontPacket.Kind.RECEPTION_FAILURE: + elif ticket.kind is interfaces.BackToFrontTicket.Kind.RECEPTION_FAILURE: return interfaces.Outcome.SERVICER_FAILURE - elif self._last_packet_seen: + elif self._last_ticket_seen: return interfaces.Outcome.RECEPTION_FAILURE else: return None - def abort_if_abortive(self, packet): + def abort_if_abortive(self, ticket): """See _Receiver.abort_if_abortive for specification.""" return _abort_if_abortive( - packet, self._abortive, self._termination_manager, + ticket, self._abortive, self._termination_manager, self._transmission_manager, self._ingestion_manager, self._expiration_manager) - def receive(self, packet): + def receive(self, ticket): """See _Receiver.receive for specification.""" - if packet.kind is interfaces.BackToFrontPacket.Kind.CONTINUATION: - self._ingestion_manager.consume(packet.payload) - elif packet.kind is interfaces.BackToFrontPacket.Kind.COMPLETION: - self._last_packet_seen = True - if packet.payload is None: + if ticket.kind is interfaces.BackToFrontTicket.Kind.CONTINUATION: + self._ingestion_manager.consume(ticket.payload) + elif ticket.kind is interfaces.BackToFrontTicket.Kind.COMPLETION: + self._last_ticket_seen = True + if ticket.payload is None: self._ingestion_manager.terminate() else: - self._ingestion_manager.consume_and_terminate(packet.payload) + self._ingestion_manager.consume_and_terminate(ticket.payload) def reception_failure(self): """See _Receiver.reception_failure for specification.""" @@ -289,72 +289,72 @@ class _ReceptionManager(_interfaces.ReceptionManager): Args: lock: The operation-servicing-wide lock object. - receiver: A _Receiver responsible for handling received packets. + receiver: A _Receiver responsible for handling received tickets. """ self._lock = lock self._receiver = receiver self._lowest_unseen_sequence_number = 0 - self._out_of_sequence_packets = {} + self._out_of_sequence_tickets = {} self._completed_sequence_number = None self._aborted = False - def _sequence_failure(self, packet): - """Determines a just-arrived packet's sequential legitimacy. + def _sequence_failure(self, ticket): + """Determines a just-arrived ticket's sequential legitimacy. Args: - packet: A just-arrived packet. + ticket: A just-arrived ticket. Returns: - True if the packet is sequentially legitimate; False otherwise. + True if the ticket is sequentially legitimate; False otherwise. """ - if packet.sequence_number < self._lowest_unseen_sequence_number: + if ticket.sequence_number < self._lowest_unseen_sequence_number: return True - elif packet.sequence_number in self._out_of_sequence_packets: + elif ticket.sequence_number in self._out_of_sequence_tickets: return True elif (self._completed_sequence_number is not None and - self._completed_sequence_number <= packet.sequence_number): + self._completed_sequence_number <= ticket.sequence_number): return True else: return False - def _process(self, packet): - """Process those packets ready to be processed. + def _process(self, ticket): + """Process those tickets ready to be processed. Args: - packet: A just-arrived packet the sequence number of which matches this + ticket: A just-arrived ticket the sequence number of which matches this _ReceptionManager's _lowest_unseen_sequence_number field. """ while True: - completed = self._receiver.receive(packet) + completed = self._receiver.receive(ticket) if completed: - self._out_of_sequence_packets.clear() - self._completed_sequence_number = packet.sequence_number - self._lowest_unseen_sequence_number = packet.sequence_number + 1 + self._out_of_sequence_tickets.clear() + self._completed_sequence_number = ticket.sequence_number + self._lowest_unseen_sequence_number = ticket.sequence_number + 1 return else: - next_packet = self._out_of_sequence_packets.pop( - packet.sequence_number + 1, None) - if next_packet is None: - self._lowest_unseen_sequence_number = packet.sequence_number + 1 + next_ticket = self._out_of_sequence_tickets.pop( + ticket.sequence_number + 1, None) + if next_ticket is None: + self._lowest_unseen_sequence_number = ticket.sequence_number + 1 return else: - packet = next_packet + ticket = next_ticket - def receive_packet(self, packet): - """See _interfaces.ReceptionManager.receive_packet for specification.""" + def receive_ticket(self, ticket): + """See _interfaces.ReceptionManager.receive_ticket for specification.""" with self._lock: if self._aborted: return - elif self._sequence_failure(packet): + elif self._sequence_failure(ticket): self._receiver.reception_failure() self._aborted = True - elif self._receiver.abort_if_abortive(packet): + elif self._receiver.abort_if_abortive(ticket): self._aborted = True - elif packet.sequence_number == self._lowest_unseen_sequence_number: - self._process(packet) + elif ticket.sequence_number == self._lowest_unseen_sequence_number: + self._process(ticket) else: - self._out_of_sequence_packets[packet.sequence_number] = packet + self._out_of_sequence_tickets[ticket.sequence_number] = ticket def front_reception_manager( diff --git a/src/python/src/grpc/framework/base/_transmission.py b/src/python/src/grpc/framework/base/_transmission.py index 510ca11c612..68451292344 100644 --- a/src/python/src/grpc/framework/base/_transmission.py +++ b/src/python/src/grpc/framework/base/_transmission.py @@ -27,7 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""State and behavior for packet transmission during an operation.""" +"""State and behavior for ticket transmission during an operation.""" import abc @@ -46,53 +46,53 @@ _BACK_TO_FRONT_NO_TRANSMISSION_OUTCOMES = ( interfaces.Outcome.SERVICED_FAILURE, ) -_ABORTION_OUTCOME_TO_FRONT_TO_BACK_PACKET_KIND = { +_ABORTION_OUTCOME_TO_FRONT_TO_BACK_TICKET_KIND = { interfaces.Outcome.CANCELLED: - interfaces.FrontToBackPacket.Kind.CANCELLATION, + interfaces.FrontToBackTicket.Kind.CANCELLATION, interfaces.Outcome.EXPIRED: - interfaces.FrontToBackPacket.Kind.EXPIRATION, + interfaces.FrontToBackTicket.Kind.EXPIRATION, interfaces.Outcome.RECEPTION_FAILURE: - interfaces.FrontToBackPacket.Kind.RECEPTION_FAILURE, + interfaces.FrontToBackTicket.Kind.RECEPTION_FAILURE, interfaces.Outcome.TRANSMISSION_FAILURE: - interfaces.FrontToBackPacket.Kind.TRANSMISSION_FAILURE, + interfaces.FrontToBackTicket.Kind.TRANSMISSION_FAILURE, interfaces.Outcome.SERVICED_FAILURE: - interfaces.FrontToBackPacket.Kind.SERVICED_FAILURE, + interfaces.FrontToBackTicket.Kind.SERVICED_FAILURE, interfaces.Outcome.SERVICER_FAILURE: - interfaces.FrontToBackPacket.Kind.SERVICER_FAILURE, + interfaces.FrontToBackTicket.Kind.SERVICER_FAILURE, } -_ABORTION_OUTCOME_TO_BACK_TO_FRONT_PACKET_KIND = { +_ABORTION_OUTCOME_TO_BACK_TO_FRONT_TICKET_KIND = { interfaces.Outcome.CANCELLED: - interfaces.BackToFrontPacket.Kind.CANCELLATION, + interfaces.BackToFrontTicket.Kind.CANCELLATION, interfaces.Outcome.EXPIRED: - interfaces.BackToFrontPacket.Kind.EXPIRATION, + interfaces.BackToFrontTicket.Kind.EXPIRATION, interfaces.Outcome.RECEPTION_FAILURE: - interfaces.BackToFrontPacket.Kind.RECEPTION_FAILURE, + interfaces.BackToFrontTicket.Kind.RECEPTION_FAILURE, interfaces.Outcome.TRANSMISSION_FAILURE: - interfaces.BackToFrontPacket.Kind.TRANSMISSION_FAILURE, + interfaces.BackToFrontTicket.Kind.TRANSMISSION_FAILURE, interfaces.Outcome.SERVICED_FAILURE: - interfaces.BackToFrontPacket.Kind.SERVICED_FAILURE, + interfaces.BackToFrontTicket.Kind.SERVICED_FAILURE, interfaces.Outcome.SERVICER_FAILURE: - interfaces.BackToFrontPacket.Kind.SERVICER_FAILURE, + interfaces.BackToFrontTicket.Kind.SERVICER_FAILURE, } -class _Packetizer(object): - """Common specification of different packet-creating behavior.""" +class _Ticketizer(object): + """Common specification of different ticket-creating behavior.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod - def packetize(self, operation_id, sequence_number, payload, complete): - """Creates a packet indicating ordinary operation progress. + def ticketize(self, operation_id, sequence_number, payload, complete): + """Creates a ticket indicating ordinary operation progress. Args: operation_id: The operation ID for the current operation. - sequence_number: A sequence number for the packet. + sequence_number: A sequence number for the ticket. payload: A customer payload object. May be None if sequence_number is zero or complete is true. - complete: A boolean indicating whether or not the packet should describe + complete: A boolean indicating whether or not the ticket should describe itself as (but for a later indication of operation abortion) the last - packet to be sent. + ticket to be sent. Returns: An object of an appropriate type suitable for transmission to the other @@ -101,12 +101,12 @@ class _Packetizer(object): raise NotImplementedError() @abc.abstractmethod - def packetize_abortion(self, operation_id, sequence_number, outcome): - """Creates a packet indicating that the operation is aborted. + def ticketize_abortion(self, operation_id, sequence_number, outcome): + """Creates a ticket indicating that the operation is aborted. Args: operation_id: The operation ID for the current operation. - sequence_number: A sequence number for the packet. + sequence_number: A sequence number for the ticket. outcome: An interfaces.Outcome value describing the operation abortion. Returns: @@ -117,8 +117,8 @@ class _Packetizer(object): raise NotImplementedError() -class _FrontPacketizer(_Packetizer): - """Front-side packet-creating behavior.""" +class _FrontTicketizer(_Ticketizer): + """Front-side ticket-creating behavior.""" def __init__(self, name, subscription_kind, trace_id, timeout): """Constructor. @@ -126,7 +126,7 @@ class _FrontPacketizer(_Packetizer): Args: name: The name of the operation. subscription_kind: An interfaces.ServicedSubscription.Kind value - describing the interest the front has in packets sent from the back. + describing the interest the front has in tickets sent from the back. trace_id: A uuid.UUID identifying a set of related operations to which this operation belongs. timeout: A length of time in seconds to allow for the entire operation. @@ -136,54 +136,54 @@ class _FrontPacketizer(_Packetizer): self._trace_id = trace_id self._timeout = timeout - def packetize(self, operation_id, sequence_number, payload, complete): - """See _Packetizer.packetize for specification.""" + def ticketize(self, operation_id, sequence_number, payload, complete): + """See _Ticketizer.ticketize for specification.""" if sequence_number: if complete: - kind = interfaces.FrontToBackPacket.Kind.COMPLETION + kind = interfaces.FrontToBackTicket.Kind.COMPLETION else: - kind = interfaces.FrontToBackPacket.Kind.CONTINUATION - return interfaces.FrontToBackPacket( + kind = interfaces.FrontToBackTicket.Kind.CONTINUATION + return interfaces.FrontToBackTicket( operation_id, sequence_number, kind, self._name, self._subscription_kind, self._trace_id, payload, self._timeout) else: if complete: - kind = interfaces.FrontToBackPacket.Kind.ENTIRE + kind = interfaces.FrontToBackTicket.Kind.ENTIRE else: - kind = interfaces.FrontToBackPacket.Kind.COMMENCEMENT - return interfaces.FrontToBackPacket( + kind = interfaces.FrontToBackTicket.Kind.COMMENCEMENT + return interfaces.FrontToBackTicket( operation_id, 0, kind, self._name, self._subscription_kind, self._trace_id, payload, self._timeout) - def packetize_abortion(self, operation_id, sequence_number, outcome): - """See _Packetizer.packetize_abortion for specification.""" + def ticketize_abortion(self, operation_id, sequence_number, outcome): + """See _Ticketizer.ticketize_abortion for specification.""" if outcome in _FRONT_TO_BACK_NO_TRANSMISSION_OUTCOMES: return None else: - kind = _ABORTION_OUTCOME_TO_FRONT_TO_BACK_PACKET_KIND[outcome] - return interfaces.FrontToBackPacket( + kind = _ABORTION_OUTCOME_TO_FRONT_TO_BACK_TICKET_KIND[outcome] + return interfaces.FrontToBackTicket( operation_id, sequence_number, kind, None, None, None, None, None) -class _BackPacketizer(_Packetizer): - """Back-side packet-creating behavior.""" +class _BackTicketizer(_Ticketizer): + """Back-side ticket-creating behavior.""" - def packetize(self, operation_id, sequence_number, payload, complete): - """See _Packetizer.packetize for specification.""" + def ticketize(self, operation_id, sequence_number, payload, complete): + """See _Ticketizer.ticketize for specification.""" if complete: - kind = interfaces.BackToFrontPacket.Kind.COMPLETION + kind = interfaces.BackToFrontTicket.Kind.COMPLETION else: - kind = interfaces.BackToFrontPacket.Kind.CONTINUATION - return interfaces.BackToFrontPacket( + kind = interfaces.BackToFrontTicket.Kind.CONTINUATION + return interfaces.BackToFrontTicket( operation_id, sequence_number, kind, payload) - def packetize_abortion(self, operation_id, sequence_number, outcome): - """See _Packetizer.packetize_abortion for specification.""" + def ticketize_abortion(self, operation_id, sequence_number, outcome): + """See _Ticketizer.ticketize_abortion for specification.""" if outcome in _BACK_TO_FRONT_NO_TRANSMISSION_OUTCOMES: return None else: - kind = _ABORTION_OUTCOME_TO_BACK_TO_FRONT_PACKET_KIND[outcome] - return interfaces.BackToFrontPacket( + kind = _ABORTION_OUTCOME_TO_BACK_TO_FRONT_TICKET_KIND[outcome] + return interfaces.BackToFrontTicket( operation_id, sequence_number, kind, None) @@ -220,21 +220,21 @@ class _EmptyTransmissionManager(TransmissionManager): class _TransmittingTransmissionManager(TransmissionManager): - """A TransmissionManager implementation that sends packets.""" + """A TransmissionManager implementation that sends tickets.""" def __init__( - self, lock, pool, callback, operation_id, packetizer, + self, lock, pool, callback, operation_id, ticketizer, termination_manager): """Constructor. Args: lock: The operation-servicing-wide lock object. - pool: A thread pool in which the work of transmitting packets will be + pool: A thread pool in which the work of transmitting tickets will be performed. - callback: A callable that accepts packets and sends them to the other side + callback: A callable that accepts tickets and sends them to the other side of the operation. operation_id: The operation's ID. - packetizer: A _Packetizer for packet creation. + ticketizer: A _Ticketizer for ticket creation. termination_manager: The _interfaces.TerminationManager associated with this operation. """ @@ -242,7 +242,7 @@ class _TransmittingTransmissionManager(TransmissionManager): self._pool = pool self._callback = callback self._operation_id = operation_id - self._packetizer = packetizer + self._ticketizer = ticketizer self._termination_manager = termination_manager self._ingestion_manager = None self._expiration_manager = None @@ -259,8 +259,8 @@ class _TransmittingTransmissionManager(TransmissionManager): self._ingestion_manager = ingestion_manager self._expiration_manager = expiration_manager - def _lead_packet(self, emission, complete): - """Creates a packet suitable for leading off the transmission loop. + def _lead_ticket(self, emission, complete): + """Creates a ticket suitable for leading off the transmission loop. Args: emission: A customer payload object to be sent to the other side of the @@ -269,37 +269,37 @@ class _TransmittingTransmissionManager(TransmissionManager): the passed object. Returns: - A packet with which to lead off the transmission loop. + A ticket with which to lead off the transmission loop. """ sequence_number = self._lowest_unused_sequence_number self._lowest_unused_sequence_number += 1 - return self._packetizer.packetize( + return self._ticketizer.ticketize( self._operation_id, sequence_number, emission, complete) - def _abortive_response_packet(self, outcome): - """Creates a packet indicating operation abortion. + def _abortive_response_ticket(self, outcome): + """Creates a ticket indicating operation abortion. Args: outcome: An interfaces.Outcome value describing operation abortion. Returns: - A packet indicating operation abortion. + A ticket indicating operation abortion. """ - packet = self._packetizer.packetize_abortion( + ticket = self._ticketizer.ticketize_abortion( self._operation_id, self._lowest_unused_sequence_number, outcome) - if packet is None: + if ticket is None: return None else: self._lowest_unused_sequence_number += 1 - return packet + return ticket - def _next_packet(self): - """Creates the next packet to be sent to the other side of the operation. + def _next_ticket(self): + """Creates the next ticket to be sent to the other side of the operation. Returns: - A (completed, packet) tuple comprised of a boolean indicating whether or - not the sequence of packets has completed normally and a packet to send - to the other side if the sequence of packets hasn't completed. The tuple + A (completed, ticket) tuple comprised of a boolean indicating whether or + not the sequence of tickets has completed normally and a ticket to send + to the other side if the sequence of tickets hasn't completed. The tuple will never have both a True first element and a non-None second element. """ if self._emissions is None: @@ -310,29 +310,29 @@ class _TransmittingTransmissionManager(TransmissionManager): complete = self._emission_complete and not self._emissions sequence_number = self._lowest_unused_sequence_number self._lowest_unused_sequence_number += 1 - return complete, self._packetizer.packetize( + return complete, self._ticketizer.ticketize( self._operation_id, sequence_number, payload, complete) else: return self._emission_complete, None else: - packet = self._abortive_response_packet(self._outcome) + ticket = self._abortive_response_ticket(self._outcome) self._emissions = None - return False, None if packet is None else packet + return False, None if ticket is None else ticket - def _transmit(self, packet): - """Commences the transmission loop sending packets. + def _transmit(self, ticket): + """Commences the transmission loop sending tickets. Args: - packet: A packet to be sent to the other side of the operation. + ticket: A ticket to be sent to the other side of the operation. """ - def transmit(packet): + def transmit(ticket): while True: transmission_outcome = callable_util.call_logging_exceptions( - self._callback, _TRANSMISSION_EXCEPTION_LOG_MESSAGE, packet) + self._callback, _TRANSMISSION_EXCEPTION_LOG_MESSAGE, ticket) if transmission_outcome.exception is None: with self._lock: - complete, packet = self._next_packet() - if packet is None: + complete, ticket = self._next_ticket() + if ticket is None: if complete: self._termination_manager.transmission_complete() self._transmitting = False @@ -348,7 +348,7 @@ class _TransmittingTransmissionManager(TransmissionManager): return self._pool.submit(callable_util.with_exceptions_logged( - transmit, _constants.INTERNAL_ERROR_LOG_MESSAGE), packet) + transmit, _constants.INTERNAL_ERROR_LOG_MESSAGE), ticket) self._transmitting = True def inmit(self, emission, complete): @@ -358,17 +358,17 @@ class _TransmittingTransmissionManager(TransmissionManager): if self._transmitting: self._emissions.append(emission) else: - self._transmit(self._lead_packet(emission, complete)) + self._transmit(self._lead_ticket(emission, complete)) def abort(self, outcome): """See _interfaces.TransmissionManager.abort for specification.""" if self._emissions is not None and self._outcome is None: self._outcome = outcome if not self._transmitting: - packet = self._abortive_response_packet(outcome) + ticket = self._abortive_response_ticket(outcome) self._emissions = None - if packet is not None: - self._transmit(packet) + if ticket is not None: + self._transmit(ticket) def front_transmission_manager( @@ -378,14 +378,14 @@ def front_transmission_manager( Args: lock: The operation-servicing-wide lock object. - pool: A thread pool in which the work of transmitting packets will be + pool: A thread pool in which the work of transmitting tickets will be performed. - callback: A callable that accepts packets and sends them to the other side + callback: A callable that accepts tickets and sends them to the other side of the operation. operation_id: The operation's ID. name: The name of the operation. subscription_kind: An interfaces.ServicedSubscription.Kind value - describing the interest the front has in packets sent from the back. + describing the interest the front has in tickets sent from the back. trace_id: A uuid.UUID identifying a set of related operations to which this operation belongs. timeout: A length of time in seconds to allow for the entire operation. @@ -396,7 +396,7 @@ def front_transmission_manager( A TransmissionManager appropriate for front-side use. """ return _TransmittingTransmissionManager( - lock, pool, callback, operation_id, _FrontPacketizer( + lock, pool, callback, operation_id, _FrontTicketizer( name, subscription_kind, trace_id, timeout), termination_manager) @@ -408,15 +408,15 @@ def back_transmission_manager( Args: lock: The operation-servicing-wide lock object. - pool: A thread pool in which the work of transmitting packets will be + pool: A thread pool in which the work of transmitting tickets will be performed. - callback: A callable that accepts packets and sends them to the other side + callback: A callable that accepts tickets and sends them to the other side of the operation. operation_id: The operation's ID. termination_manager: The _interfaces.TerminationManager associated with this operation. subscription_kind: An interfaces.ServicedSubscription.Kind value - describing the interest the front has in packets sent from the back. + describing the interest the front has in tickets sent from the back. Returns: A TransmissionManager appropriate for back-side use. @@ -425,5 +425,5 @@ def back_transmission_manager( return _EmptyTransmissionManager() else: return _TransmittingTransmissionManager( - lock, pool, callback, operation_id, _BackPacketizer(), + lock, pool, callback, operation_id, _BackTicketizer(), termination_manager) diff --git a/src/python/src/grpc/framework/base/implementations.py b/src/python/src/grpc/framework/base/implementations.py index 70fb9942b24..5656f9f9812 100644 --- a/src/python/src/grpc/framework/base/implementations.py +++ b/src/python/src/grpc/framework/base/implementations.py @@ -27,7 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""Entry points into the packet-exchange-based implementation the base layer.""" +"""Entry points into the ticket-exchange-based base layer implementation.""" # interfaces is referenced from specification in this module. from grpc.framework.base import _ends diff --git a/src/python/src/grpc/framework/base/in_memory.py b/src/python/src/grpc/framework/base/in_memory.py index 9ed62f8e0a8..c92d0bc663c 100644 --- a/src/python/src/grpc/framework/base/in_memory.py +++ b/src/python/src/grpc/framework/base/in_memory.py @@ -27,7 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""Entry points into the packet-exchange-based implementation the base layer.""" +"""In-memory implementations of base layer interfaces.""" import threading diff --git a/src/python/src/grpc/framework/base/interfaces.py b/src/python/src/grpc/framework/base/interfaces.py index 7be13b3f45d..e22c10d9750 100644 --- a/src/python/src/grpc/framework/base/interfaces.py +++ b/src/python/src/grpc/framework/base/interfaces.py @@ -233,9 +233,9 @@ class Back(End): __metaclass__ = abc.ABCMeta -class FrontToBackPacket( +class FrontToBackTicket( collections.namedtuple( - 'FrontToBackPacket', + 'FrontToBackTicket', ['operation_id', 'sequence_number', 'kind', 'name', 'subscription', 'trace_id', 'payload', 'timeout'])): """A sum type for all values sent from a front to a back. @@ -244,14 +244,14 @@ class FrontToBackPacket( operation_id: A unique-with-respect-to-equality hashable object identifying a particular operation. sequence_number: A zero-indexed integer sequence number identifying the - packet's place among all the packets sent from front to back for this + ticket's place among all the tickets sent from front to back for this particular operation. Must be zero if kind is Kind.COMMENCEMENT or Kind.ENTIRE. Must be positive for any other kind. kind: A Kind value describing the overall kind of ticket. name: The name of an operation. Must be present if kind is Kind.COMMENCEMENT or Kind.ENTIRE. Must be None for any other kind. subscription: An ServicedSubscription.Kind value describing the interest - the front has in packets sent from the back. Must be present if + the front has in tickets sent from the back. Must be present if kind is Kind.COMMENCEMENT or Kind.ENTIRE. Must be None for any other kind. trace_id: A uuid.UUID identifying a set of related operations to which this operation belongs. May be None. @@ -269,7 +269,7 @@ class FrontToBackPacket( @enum.unique class Kind(enum.Enum): - """Identifies the overall kind of a FrontToBackPacket.""" + """Identifies the overall kind of a FrontToBackTicket.""" COMMENCEMENT = 'commencement' CONTINUATION = 'continuation' @@ -283,9 +283,9 @@ class FrontToBackPacket( TRANSMISSION_FAILURE = 'transmission failure' -class BackToFrontPacket( +class BackToFrontTicket( collections.namedtuple( - 'BackToFrontPacket', + 'BackToFrontTicket', ['operation_id', 'sequence_number', 'kind', 'payload'])): """A sum type for all values sent from a back to a front. @@ -293,7 +293,7 @@ class BackToFrontPacket( operation_id: A unique-with-respect-to-equality hashable object identifying a particular operation. sequence_number: A zero-indexed integer sequence number identifying the - packet's place among all the packets sent from back to front for this + ticket's place among all the tickets sent from back to front for this particular operation. kind: A Kind value describing the overall kind of ticket. payload: A customer payload object. Must be present if kind is @@ -303,7 +303,7 @@ class BackToFrontPacket( @enum.unique class Kind(enum.Enum): - """Identifies the overall kind of a BackToFrontPacket.""" + """Identifies the overall kind of a BackToFrontTicket.""" CONTINUATION = 'continuation' COMPLETION = 'completion' @@ -321,10 +321,10 @@ class ForeLink(object): @abc.abstractmethod def accept_back_to_front_ticket(self, ticket): - """Accept a BackToFrontPacket. + """Accept a BackToFrontTicket. Args: - ticket: Any BackToFrontPacket. + ticket: Any BackToFrontTicket. """ raise NotImplementedError() @@ -340,10 +340,10 @@ class RearLink(object): @abc.abstractmethod def accept_front_to_back_ticket(self, ticket): - """Accepts a FrontToBackPacket. + """Accepts a FrontToBackTicket. Args: - ticket: Any FrontToBackPacket. + ticket: Any FrontToBackTicket. """ raise NotImplementedError() diff --git a/src/python/src/grpc/framework/base/interfaces_test_case.py b/src/python/src/grpc/framework/base/interfaces_test_case.py index b86011c449e..dec10c2924d 100644 --- a/src/python/src/grpc/framework/base/interfaces_test_case.py +++ b/src/python/src/grpc/framework/base/interfaces_test_case.py @@ -164,7 +164,7 @@ class FrontAndBackTest(object): # pylint: disable=invalid-name def testSimplestCall(self): - """Tests the absolute simplest call - a one-packet fire-and-forget.""" + """Tests the absolute simplest call - a one-ticket fire-and-forget.""" self.front.operate( SYNCHRONOUS_ECHO, None, True, SMALL_TIMEOUT, util.none_serviced_subscription(), 'test trace ID') @@ -175,25 +175,25 @@ class FrontAndBackTest(object): # Assuming nothing really pathological (such as pauses on the order of # SMALL_TIMEOUT interfering with this test) there are a two different ways # the back could have experienced execution up to this point: - # (1) The packet is still either in the front waiting to be transmitted + # (1) The ticket is still either in the front waiting to be transmitted # or is somewhere on the link between the front and the back. The back has # no idea that this test is even happening. Calling wait_for_idle on it # would do no good because in this case the back is idle and the call would - # return with the packet bound for it still in the front or on the link. + # return with the ticket bound for it still in the front or on the link. back_operation_stats = self.back.operation_stats() first_back_possibility = EMPTY_OUTCOME_DICT - # (2) The packet arrived at the back and the back completed the operation. + # (2) The ticket arrived at the back and the back completed the operation. second_back_possibility = dict(EMPTY_OUTCOME_DICT) second_back_possibility[interfaces.Outcome.COMPLETED] = 1 self.assertIn( back_operation_stats, (first_back_possibility, second_back_possibility)) - # It's true that if the packet had arrived at the back and the back had + # It's true that if the ticket had arrived at the back and the back had # begun processing that wait_for_idle could hold test execution until the # back completed the operation, but that doesn't really collapse the # possibility space down to one solution. def testEntireEcho(self): - """Tests a very simple one-packet-each-way round-trip.""" + """Tests a very simple one-ticket-each-way round-trip.""" test_payload = 'test payload' test_consumer = stream_testing.TestConsumer() subscription = util.full_serviced_subscription( @@ -212,7 +212,7 @@ class FrontAndBackTest(object): self.assertListEqual([(test_payload, True)], test_consumer.calls) def testBidirectionalStreamingEcho(self): - """Tests sending multiple packets each way.""" + """Tests sending multiple tickets each way.""" test_payload_template = 'test_payload: %03d' test_payloads = [test_payload_template % i for i in range(STREAM_LENGTH)] test_consumer = stream_testing.TestConsumer() @@ -255,16 +255,16 @@ class FrontAndBackTest(object): # Assuming nothing really pathological (such as pauses on the order of # SMALL_TIMEOUT interfering with this test) there are a two different ways # the back could have experienced execution up to this point: - # (1) Both packets are still either in the front waiting to be transmitted + # (1) Both tickets are still either in the front waiting to be transmitted # or are somewhere on the link between the front and the back. The back has # no idea that this test is even happening. Calling wait_for_idle on it # would do no good because in this case the back is idle and the call would - # return with the packets bound for it still in the front or on the link. + # return with the tickets bound for it still in the front or on the link. back_operation_stats = self.back.operation_stats() first_back_possibility = EMPTY_OUTCOME_DICT - # (2) Both packets arrived within SMALL_TIMEOUT of one another at the back. - # The back started processing based on the first packet and then stopped - # upon receiving the cancellation packet. + # (2) Both tickets arrived within SMALL_TIMEOUT of one another at the back. + # The back started processing based on the first ticket and then stopped + # upon receiving the cancellation ticket. second_back_possibility = dict(EMPTY_OUTCOME_DICT) second_back_possibility[interfaces.Outcome.CANCELLED] = 1 self.assertIn( From da771517c67c1ed09606a603d73b17380c650a1e Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 17 Mar 2015 18:13:55 -0700 Subject: [PATCH 57/75] Changed call to only expect and return binary headers when key ends with '-bin' --- src/node/ext/call.cc | 34 +++++++++++++++++++++++----------- src/node/test/call_test.js | 4 ++-- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/node/ext/call.cc b/src/node/ext/call.cc index afb65417831..8cc3e38cd95 100644 --- a/src/node/ext/call.cc +++ b/src/node/ext/call.cc @@ -75,6 +75,9 @@ using v8::Value; NanCallback *Call::constructor; Persistent Call::fun_tpl; +bool EndsWith(const char *str, const char *substr) { + return strcmp(str+strlen(str)-strlen(substr), substr) == 0; +} bool CreateMetadataArray(Handle metadata, grpc_metadata_array *array, shared_ptr resources) { @@ -99,14 +102,19 @@ bool CreateMetadataArray(Handle metadata, grpc_metadata_array *array, Handle value = values->Get(j); grpc_metadata *current = &array->metadata[array->count]; current->key = **utf8_key; - if (::node::Buffer::HasInstance(value)) { - current->value = ::node::Buffer::Data(value); - current->value_length = ::node::Buffer::Length(value); - Persistent *handle = new Persistent(); - NanAssignPersistent(*handle, value); - resources->handles.push_back(unique_ptr( - new PersistentHolder(handle))); - } else if (value->IsString()) { + // Only allow binary headers for "-bin" keys + if (EndsWith(current->key, "-bin")) { + if (::node::Buffer::HasInstance(value)) { + current->value = ::node::Buffer::Data(value); + current->value_length = ::node::Buffer::Length(value); + Persistent *handle = new Persistent(); + NanAssignPersistent(*handle, value); + resources->handles.push_back(unique_ptr( + new PersistentHolder(handle))); + continue; + } + } + if (value->IsString()) { Handle string_value = value->ToString(); NanUtf8String *utf8_value = new NanUtf8String(string_value); resources->strings.push_back(unique_ptr(utf8_value)); @@ -146,9 +154,13 @@ Handle ParseMetadata(const grpc_metadata_array *metadata_array) { array = NanNew(size_map[elem->key]); metadata_object->Set(key_string, array); } - array->Set(index_map[elem->key], - MakeFastBuffer( - NanNewBufferHandle(elem->value, elem->value_length))); + if (EndsWith(elem->key, "-bin")) { + array->Set(index_map[elem->key], + MakeFastBuffer( + NanNewBufferHandle(elem->value, elem->value_length))); + } else { + array->Set(index_map[elem->key], NanNew(elem->value)); + } index_map[elem->key] += 1; } return NanEscapeScope(metadata_object); diff --git a/src/node/test/call_test.js b/src/node/test/call_test.js index 7b2b36ae371..98158ffff35 100644 --- a/src/node/test/call_test.js +++ b/src/node/test/call_test.js @@ -142,8 +142,8 @@ describe('call', function() { assert.doesNotThrow(function() { var batch = {}; batch[grpc.opType.SEND_INITIAL_METADATA] = { - 'key1': [new Buffer('value1')], - 'key2': [new Buffer('value2')] + 'key1-bin': [new Buffer('value1')], + 'key2-bin': [new Buffer('value2')] }; call.startBatch(batch, function(err, resp) { assert.ifError(err); From 429bb7abbd8c8d17cdcb9826270eed8b3634439a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 17 Mar 2015 18:20:51 -0700 Subject: [PATCH 58/75] Simplified some tests --- src/node/test/end_to_end_test.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/node/test/end_to_end_test.js b/src/node/test/end_to_end_test.js index c39364d410e..60e9861bc86 100644 --- a/src/node/test/end_to_end_test.js +++ b/src/node/test/end_to_end_test.js @@ -138,21 +138,21 @@ describe('end-to-end', function() { client_batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true; call.startBatch(client_batch, function(err, response) { assert.ifError(err); - assert(response['send metadata']); - assert(response['client close']); - assert(response.hasOwnProperty('metadata')); - assert.strictEqual(response.metadata.server_key[0].toString(), - 'server_value'); - assert.deepEqual(response.status, {'code': grpc.status.OK, - 'details': status_text, - 'metadata': {}}); + assert.deepEqual(response,{ + 'send metadata': true, + 'client close': true, + metadata: {server_key: ['server_value']}, + status: {'code': grpc.status.OK, + 'details': status_text, + 'metadata': {}} + }); done(); }); server.requestCall(function(err, call_details) { var new_call = call_details['new call']; assert.notEqual(new_call, null); - assert.strictEqual(new_call.metadata.client_key[0].toString(), + assert.strictEqual(new_call.metadata.client_key[0], 'client_value'); var server_call = new_call.call; assert.notEqual(server_call, null); From be64ca046ef299b28ac6ad1ef5d0e1717c5a224f Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 17 Mar 2015 18:25:59 -0700 Subject: [PATCH 59/75] Bumped version --- src/node/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/package.json b/src/node/package.json index 1d0aa0e669d..9f52f8c988e 100644 --- a/src/node/package.json +++ b/src/node/package.json @@ -1,6 +1,6 @@ { "name": "grpc", - "version": "0.5.5", + "version": "0.6.0", "author": "Google Inc.", "description": "gRPC Library for Node", "homepage": "http://www.grpc.io/", From 89905ac55d986878b338406a298ee513c15b68be Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Tue, 17 Mar 2015 18:26:48 -0700 Subject: [PATCH 60/75] Factor out interface-specific early_adopter code Refactors early_adopter such that interface-specific code is located in the framework module as a submodule `alpha`. --- src/compiler/python_generator.cc | 2 +- src/python/interop/interop/methods.py | 2 +- .../src/grpc/early_adopter/implementations.py | 6 ++-- .../early_adopter/implementations_test.py | 2 +- .../src/grpc/framework/alpha/__init__.py | 28 +++++++++++++++++++ .../alpha}/_face_utilities.py | 4 +-- .../alpha}/_reexport.py | 4 +-- .../alpha}/exceptions.py | 0 .../alpha}/interfaces.py | 2 +- .../alpha}/utilities.py | 2 +- src/python/src/setup.py | 1 + test/compiler/python_plugin_test.py | 2 +- 12 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 src/python/src/grpc/framework/alpha/__init__.py rename src/python/src/grpc/{early_adopter => framework/alpha}/_face_utilities.py (98%) rename src/python/src/grpc/{early_adopter => framework/alpha}/_reexport.py (98%) rename src/python/src/grpc/{early_adopter => framework/alpha}/exceptions.py (100%) rename src/python/src/grpc/{early_adopter => framework/alpha}/interfaces.py (99%) rename src/python/src/grpc/{early_adopter => framework/alpha}/utilities.py (99%) diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index 8136602ae5a..e4f85450f5a 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -381,7 +381,7 @@ bool PrintStubFactory(const std::string& package_qualified_service_name, bool PrintPreamble(const FileDescriptor* file, Printer* out) { out->Print("import abc\n"); out->Print("from grpc.early_adopter import implementations\n"); - out->Print("from grpc.early_adopter import utilities\n"); + out->Print("from grpc.framework.alpha import utilities\n"); return true; } diff --git a/src/python/interop/interop/methods.py b/src/python/interop/interop/methods.py index 4f83ccc085b..79550a37893 100644 --- a/src/python/interop/interop/methods.py +++ b/src/python/interop/interop/methods.py @@ -32,7 +32,7 @@ import enum import threading -from grpc.early_adopter import utilities +from grpc.framework.alpha import utilities from interop import empty_pb2 from interop import messages_pb2 diff --git a/src/python/src/grpc/early_adopter/implementations.py b/src/python/src/grpc/early_adopter/implementations.py index 9cadb58d0f0..cc0b8ec9e82 100644 --- a/src/python/src/grpc/early_adopter/implementations.py +++ b/src/python/src/grpc/early_adopter/implementations.py @@ -33,9 +33,9 @@ import threading from grpc._adapter import fore as _fore from grpc._adapter import rear as _rear -from grpc.early_adopter import _face_utilities -from grpc.early_adopter import _reexport -from grpc.early_adopter import interfaces +from grpc.framework.alpha import _face_utilities +from grpc.framework.alpha import _reexport +from grpc.framework.alpha import interfaces from grpc.framework.base import implementations as _base_implementations from grpc.framework.base import util as _base_utilities from grpc.framework.face import implementations as _face_implementations diff --git a/src/python/src/grpc/early_adopter/implementations_test.py b/src/python/src/grpc/early_adopter/implementations_test.py index 949d3def3de..ae4adad90f5 100644 --- a/src/python/src/grpc/early_adopter/implementations_test.py +++ b/src/python/src/grpc/early_adopter/implementations_test.py @@ -34,7 +34,7 @@ import unittest from grpc.early_adopter import implementations -from grpc.early_adopter import utilities +from grpc.framework.alpha import utilities from grpc._junkdrawer import math_pb2 SERVICE_NAME = 'math.Math' diff --git a/src/python/src/grpc/framework/alpha/__init__.py b/src/python/src/grpc/framework/alpha/__init__.py new file mode 100644 index 00000000000..b89398809fa --- /dev/null +++ b/src/python/src/grpc/framework/alpha/__init__.py @@ -0,0 +1,28 @@ +# 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. diff --git a/src/python/src/grpc/early_adopter/_face_utilities.py b/src/python/src/grpc/framework/alpha/_face_utilities.py similarity index 98% rename from src/python/src/grpc/early_adopter/_face_utilities.py rename to src/python/src/grpc/framework/alpha/_face_utilities.py index ce099fc22f0..fb0cfe426d0 100644 --- a/src/python/src/grpc/early_adopter/_face_utilities.py +++ b/src/python/src/grpc/framework/alpha/_face_utilities.py @@ -34,8 +34,8 @@ import collections from grpc.framework.common import cardinality from grpc.framework.face import interfaces as face_interfaces # pylint: disable=unused-import from grpc.framework.face import utilities as face_utilities -from grpc.early_adopter import _reexport -from grpc.early_adopter import interfaces +from grpc.framework.alpha import _reexport +from grpc.framework.alpha import interfaces def _qualified_name(service_name, method_name): diff --git a/src/python/src/grpc/early_adopter/_reexport.py b/src/python/src/grpc/framework/alpha/_reexport.py similarity index 98% rename from src/python/src/grpc/early_adopter/_reexport.py rename to src/python/src/grpc/framework/alpha/_reexport.py index 49bc38e203c..198cb95ad5c 100644 --- a/src/python/src/grpc/early_adopter/_reexport.py +++ b/src/python/src/grpc/framework/alpha/_reexport.py @@ -31,8 +31,8 @@ from grpc.framework.common import cardinality from grpc.framework.face import exceptions as face_exceptions from grpc.framework.face import interfaces as face_interfaces from grpc.framework.foundation import future -from grpc.early_adopter import exceptions -from grpc.early_adopter import interfaces +from grpc.framework.alpha import exceptions +from grpc.framework.alpha import interfaces _EARLY_ADOPTER_CARDINALITY_TO_COMMON_CARDINALITY = { interfaces.Cardinality.UNARY_UNARY: cardinality.Cardinality.UNARY_UNARY, diff --git a/src/python/src/grpc/early_adopter/exceptions.py b/src/python/src/grpc/framework/alpha/exceptions.py similarity index 100% rename from src/python/src/grpc/early_adopter/exceptions.py rename to src/python/src/grpc/framework/alpha/exceptions.py diff --git a/src/python/src/grpc/early_adopter/interfaces.py b/src/python/src/grpc/framework/alpha/interfaces.py similarity index 99% rename from src/python/src/grpc/early_adopter/interfaces.py rename to src/python/src/grpc/framework/alpha/interfaces.py index b733873c1c9..8380567c972 100644 --- a/src/python/src/grpc/early_adopter/interfaces.py +++ b/src/python/src/grpc/framework/alpha/interfaces.py @@ -33,7 +33,7 @@ import abc import enum # exceptions is referenced from specification in this module. -from grpc.early_adopter import exceptions # pylint: disable=unused-import +from grpc.framework.alpha import exceptions # pylint: disable=unused-import from grpc.framework.foundation import activated from grpc.framework.foundation import future diff --git a/src/python/src/grpc/early_adopter/utilities.py b/src/python/src/grpc/framework/alpha/utilities.py similarity index 99% rename from src/python/src/grpc/early_adopter/utilities.py rename to src/python/src/grpc/framework/alpha/utilities.py index da8ef825aa5..7d7f78f5e44 100644 --- a/src/python/src/grpc/early_adopter/utilities.py +++ b/src/python/src/grpc/framework/alpha/utilities.py @@ -29,7 +29,7 @@ """Utilities for use with GRPC.""" -from grpc.early_adopter import interfaces +from grpc.framework.alpha import interfaces class _RpcMethodDescription( diff --git a/src/python/src/setup.py b/src/python/src/setup.py index 63731212c70..bd70634b8fe 100644 --- a/src/python/src/setup.py +++ b/src/python/src/setup.py @@ -64,6 +64,7 @@ _PACKAGES = ( 'grpc._junkdrawer', 'grpc.early_adopter', 'grpc.framework', + 'grpc.framework.alpha', 'grpc.framework.base', 'grpc.framework.common', 'grpc.framework.face', diff --git a/test/compiler/python_plugin_test.py b/test/compiler/python_plugin_test.py index 9cf3c624c05..3d2f117b0df 100644 --- a/test/compiler/python_plugin_test.py +++ b/test/compiler/python_plugin_test.py @@ -39,7 +39,7 @@ import tempfile import time import unittest -from grpc.early_adopter import exceptions +from grpc.framework.alpha import exceptions from grpc.framework.foundation import future # Identifiers of entities we expect to find in the generated module. From d5c733e824a2fa3da7213c7b53dc73ec06b6f655 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Tue, 17 Mar 2015 19:15:33 -0700 Subject: [PATCH 61/75] Fixes reference to variable in the auth package --- src/ruby/bin/interop/interop_client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ruby/bin/interop/interop_client.rb b/src/ruby/bin/interop/interop_client.rb index b0b24b949f2..b2a8711c790 100755 --- a/src/ruby/bin/interop/interop_client.rb +++ b/src/ruby/bin/interop/interop_client.rb @@ -57,7 +57,7 @@ require 'test/cpp/interop/empty' require 'signet/ssl_config' -AUTH_ENV = Google::Auth::ServiceAccountCredentials::ENV_VAR +AUTH_ENV = Google::Auth::CredentialsLoader::ENV_VAR # loads the certificates used to access the test server securely. def load_test_certs From 559543ec0d08fc5447224f34a4bcfc718708bb43 Mon Sep 17 00:00:00 2001 From: David Klempner Date: Tue, 17 Mar 2015 20:27:48 -0700 Subject: [PATCH 62/75] Unconditionally add a newline if a test times out or fails. Failure should generally result in output unless something goes wrong, but timeout currently doesn't, but should be printed 100% of the time. --- tools/run_tests/jobset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index 26caf031c3a..81cdd0e6e40 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -192,7 +192,7 @@ class Job(object): self._tempfile.seek(0) stdout = self._tempfile.read() message('FAILED', '%s [ret=%d]' % ( - self._spec.shortname, self._process.returncode), stdout) + self._spec.shortname, self._process.returncode), stdout, do_newline=True) else: self._state = _SUCCESS message('PASSED', '%s [time=%.1fsec]' % (self._spec.shortname, elapsed), @@ -200,7 +200,7 @@ class Job(object): if self._bin_hash: update_cache.finished(self._spec.identity(), self._bin_hash) elif self._state == _RUNNING and time.time() - self._start > 300: - message('TIMEOUT', self._spec.shortname, do_newline=self._travis) + message('TIMEOUT', self._spec.shortname, do_newline=True) self.kill() return self._state From 62e3cc842975df72b25b76d05babd92f5dd1a399 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Tue, 17 Mar 2015 21:20:47 -0700 Subject: [PATCH 63/75] Exposes the metadata method in server-side ActiveCall view classes --- src/ruby/lib/grpc/generic/active_call.rb | 4 +-- src/ruby/spec/generic/active_call_spec.rb | 4 +-- src/ruby/spec/generic/rpc_server_spec.rb | 37 ++++++++++++++++++++++- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/ruby/lib/grpc/generic/active_call.rb b/src/ruby/lib/grpc/generic/active_call.rb index 7b69f1f6d0d..6256330e88e 100644 --- a/src/ruby/lib/grpc/generic/active_call.rb +++ b/src/ruby/lib/grpc/generic/active_call.rb @@ -505,12 +505,12 @@ module GRPC # SingleReqView limits access to an ActiveCall's methods for use in server # handlers that receive just one request. - SingleReqView = view_class(:cancelled, :deadline) + SingleReqView = view_class(:cancelled, :deadline, :metadata) # MultiReqView limits access to an ActiveCall's methods for use in # server client_streamer handlers. MultiReqView = view_class(:cancelled, :deadline, :each_queued_msg, - :each_remote_read) + :each_remote_read, :metadata) # Operation limits access to an ActiveCall's methods for use as # a Operation on the client. diff --git a/src/ruby/spec/generic/active_call_spec.rb b/src/ruby/spec/generic/active_call_spec.rb index 12cb5c15580..8914225b558 100644 --- a/src/ruby/spec/generic/active_call_spec.rb +++ b/src/ruby/spec/generic/active_call_spec.rb @@ -68,7 +68,7 @@ describe GRPC::ActiveCall do describe '#multi_req_view' do xit 'exposes a fixed subset of the ActiveCall methods' do - want = %w(cancelled, deadline, each_remote_read, shutdown) + want = %w(cancelled, deadline, each_remote_read, metadata, shutdown) v = @client_call.multi_req_view want.each do |w| expect(v.methods.include?(w)) @@ -78,7 +78,7 @@ describe GRPC::ActiveCall do describe '#single_req_view' do xit 'exposes a fixed subset of the ActiveCall methods' do - want = %w(cancelled, deadline, shutdown) + want = %w(cancelled, deadline, metadata, shutdown) v = @client_call.single_req_view want.each do |w| expect(v.methods.include?(w)) diff --git a/src/ruby/spec/generic/rpc_server_spec.rb b/src/ruby/spec/generic/rpc_server_spec.rb index d5421d400c9..f3b89b5895e 100644 --- a/src/ruby/spec/generic/rpc_server_spec.rb +++ b/src/ruby/spec/generic/rpc_server_spec.rb @@ -62,12 +62,15 @@ end class EchoService include GRPC::GenericService rpc :an_rpc, EchoMsg, EchoMsg + attr_reader :received_md def initialize(_default_var = 'ignored') + @received_md = [] end - def an_rpc(req, _call) + def an_rpc(req, call) logger.info('echo service received a request') + @received_md << call.metadata unless call.metadata.nil? req end end @@ -337,6 +340,38 @@ describe GRPC::RpcServer do t.join end + it 'should receive metadata sent as rpc keyword args', server: true do + service = EchoService.new + @srv.handle(service) + t = Thread.new { @srv.run } + @srv.wait_till_running + req = EchoMsg.new + stub = EchoStub.new(@host, **@client_opts) + expect(stub.an_rpc(req, k1: 'v1', k2: 'v2')).to be_a(EchoMsg) + wanted_md = [{ 'k1' => 'v1', 'k2' => 'v2' }] + expect(service.received_md).to eq(wanted_md) + @srv.stop + t.join + end + + it 'should receive updated metadata', server: true do + service = EchoService.new + @srv.handle(service) + t = Thread.new { @srv.run } + @srv.wait_till_running + req = EchoMsg.new + @client_opts[:update_metadata] = proc do |md| + md[:k1] = 'updated-v1' + md + end + stub = EchoStub.new(@host, **@client_opts) + expect(stub.an_rpc(req, k1: 'v1', k2: 'v2')).to be_a(EchoMsg) + wanted_md = [{ 'k1' => 'updated-v1', 'k2' => 'v2' }] + expect(service.received_md).to eq(wanted_md) + @srv.stop + t.join + end + it 'should handle multiple parallel requests', server: true do @srv.handle(EchoService) Thread.new { @srv.run } From e52995ef2b5547230904d2f123cacaa5440a572c Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Tue, 17 Mar 2015 21:41:57 -0700 Subject: [PATCH 64/75] Adds back calls to #finish at the end of server calls --- src/ruby/lib/grpc/generic/rpc_desc.rb | 1 + src/ruby/spec/generic/client_stub_spec.rb | 10 +++++----- src/ruby/spec/generic/rpc_desc_spec.rb | 4 ++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ruby/lib/grpc/generic/rpc_desc.rb b/src/ruby/lib/grpc/generic/rpc_desc.rb index 5e3d3c9f9cf..2cb3d2eebf4 100644 --- a/src/ruby/lib/grpc/generic/rpc_desc.rb +++ b/src/ruby/lib/grpc/generic/rpc_desc.rb @@ -81,6 +81,7 @@ module GRPC active_call.run_server_bidi(mth) end send_status(active_call, OK, 'OK') + active_call.finished rescue BadStatus => e # this is raised by handlers that want GRPC to send an application # error code and detail message. diff --git a/src/ruby/spec/generic/client_stub_spec.rb b/src/ruby/spec/generic/client_stub_spec.rb index adf354f4eef..73f2d37e305 100644 --- a/src/ruby/spec/generic/client_stub_spec.rb +++ b/src/ruby/spec/generic/client_stub_spec.rb @@ -434,7 +434,7 @@ describe 'ClientStub' do end expect(c.remote_read).to eq(expected_input) replys.each { |r| c.remote_send(r) } - c.send_status(status, status == @pass ? 'OK' : 'NOK') + c.send_status(status, status == @pass ? 'OK' : 'NOK', true) end end @@ -444,7 +444,7 @@ describe 'ClientStub' do c = expect_server_to_be_invoked(mtx, cnd) expected_inputs.each { |i| expect(c.remote_read).to eq(i) } replys.each { |r| c.remote_send(r) } - c.send_status(status, status == @pass ? 'OK' : 'NOK') + c.send_status(status, status == @pass ? 'OK' : 'NOK', true) end end @@ -460,7 +460,7 @@ describe 'ClientStub' do expect(c.remote_read).to eq(i) end end - c.send_status(status, status == @pass ? 'OK' : 'NOK') + c.send_status(status, status == @pass ? 'OK' : 'NOK', true) end end @@ -473,7 +473,7 @@ describe 'ClientStub' do expect(c.metadata[k.to_s]).to eq(v) end c.remote_send(resp) - c.send_status(status, status == @pass ? 'OK' : 'NOK') + c.send_status(status, status == @pass ? 'OK' : 'NOK', true) end end @@ -486,7 +486,7 @@ describe 'ClientStub' do expect(c.metadata[k.to_s]).to eq(v) end c.remote_send(resp) - c.send_status(status, status == @pass ? 'OK' : 'NOK') + c.send_status(status, status == @pass ? 'OK' : 'NOK', true) end end diff --git a/src/ruby/spec/generic/rpc_desc_spec.rb b/src/ruby/spec/generic/rpc_desc_spec.rb index 8bff2a9a644..39d1e83748b 100644 --- a/src/ruby/spec/generic/rpc_desc_spec.rb +++ b/src/ruby/spec/generic/rpc_desc_spec.rb @@ -94,6 +94,7 @@ describe GRPC::RpcDesc do expect(@call).to receive(:remote_read).once.and_return(req) expect(@call).to receive(:remote_send).once.with(@ok_response) expect(@call).to receive(:send_status).once.with(OK, 'OK') + expect(@call).to receive(:finished).once @request_response.run_server_method(@call, method(:fake_reqresp)) end end @@ -134,6 +135,7 @@ describe GRPC::RpcDesc do it 'sends a response and closes the stream if there no errors' do expect(@call).to receive(:remote_send).once.with(@ok_response) expect(@call).to receive(:send_status).once.with(OK, 'OK') + expect(@call).to receive(:finished).once @client_streamer.run_server_method(@call, method(:fake_clstream)) end end @@ -178,6 +180,7 @@ describe GRPC::RpcDesc do expect(@call).to receive(:remote_read).once.and_return(req) expect(@call).to receive(:remote_send).twice.with(@ok_response) expect(@call).to receive(:send_status).once.with(OK, 'OK') + expect(@call).to receive(:finished).once @server_streamer.run_server_method(@call, method(:fake_svstream)) end end @@ -207,6 +210,7 @@ describe GRPC::RpcDesc do it 'closes the stream if there no errors' do expect(@call).to receive(:run_server_bidi) expect(@call).to receive(:send_status).once.with(OK, 'OK') + expect(@call).to receive(:finished).once @bidi_streamer.run_server_method(@call, method(:fake_bidistream)) end end From 8f72c0b3d8c9747fd57bbc6e31ab5eab16ca9995 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 18 Mar 2015 09:52:05 -0700 Subject: [PATCH 65/75] Add jwt_token_creds test case to interop test for c++ --- tools/gce_setup/cloud_prod_runner.sh | 2 +- tools/gce_setup/grpc_docker.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/tools/gce_setup/cloud_prod_runner.sh b/tools/gce_setup/cloud_prod_runner.sh index 3a9ae51b769..e236c921ec8 100755 --- a/tools/gce_setup/cloud_prod_runner.sh +++ b/tools/gce_setup/cloud_prod_runner.sh @@ -36,7 +36,7 @@ echo $result_file_name main() { source grpc_docker.sh test_cases=(large_unary empty_unary ping_pong client_streaming server_streaming cancel_after_begin cancel_after_first_response) - auth_test_cases=(service_account_creds compute_engine_creds) + auth_test_cases=(service_account_creds compute_engine_creds jwt_token_creds) clients=(cxx java go ruby node csharp_mono) for test_case in "${test_cases[@]}" do diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index 3deef05ef35..d6cbf0a3558 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -1192,6 +1192,20 @@ grpc_cloud_prod_auth_compute_engine_creds_gen_cxx_cmd() { echo $the_cmd } +# constructs the full dockerized cpp jwt_token auth interop test cmd. +# +# call-seq: +# flags= .... # generic flags to include the command +# cmd=$($grpc_gen_test_cmd $flags) +grpc_cloud_prod_auth_jwt_token_creds_gen_cxx_cmd() { + local cmd_prefix="sudo docker run grpc/cxx"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots"; + local gfe_flags=$(_grpc_prod_gfe_flags) + local added_gfe_flags=$(_grpc_jwt_token_test_flags) + local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; + echo $the_cmd +} + # constructs the full dockerized csharp-mono interop test cmd. # # call-seq: @@ -1230,6 +1244,11 @@ _grpc_svc_acc_test_flags() { echo " --service_account_key_file=/service_account/stubbyCloudTestingTest-7dd63462c60c.json --oauth_scope=https://www.googleapis.com/auth/xapi.zoo" } +# outputs the flags passed to the service account auth tests +_grpc_jwt_token_test_flags() { + echo " --service_account_key_file=/service_account/stubbyCloudTestingTest-7dd63462c60c.json" +} + # default credentials test flag _grpc_default_creds_test_flags() { echo " --oauth_scope=https://www.googleapis.com/auth/xapi.zoo" From 1ee2e4f2e40ff2d653bb77b951d1cc12ae123199 Mon Sep 17 00:00:00 2001 From: Donna Dionne Date: Wed, 18 Mar 2015 10:31:16 -0700 Subject: [PATCH 66/75] Add csharp server to interop tests --- tools/gce_setup/interop_test_runner.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gce_setup/interop_test_runner.sh b/tools/gce_setup/interop_test_runner.sh index 430ad09b8c6..7f0b5bab1a9 100755 --- a/tools/gce_setup/interop_test_runner.sh +++ b/tools/gce_setup/interop_test_runner.sh @@ -37,7 +37,7 @@ main() { source grpc_docker.sh test_cases=(large_unary empty_unary ping_pong client_streaming server_streaming cancel_after_begin cancel_after_first_response) clients=(cxx java go ruby node python csharp_mono) - servers=(cxx java go ruby node python) + servers=(cxx java go ruby node python csharp_mono) for test_case in "${test_cases[@]}" do for client in "${clients[@]}" From b050ce96e70e2601f12d5ee24b9108e90641eb26 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Wed, 18 Mar 2015 18:54:42 +0100 Subject: [PATCH 67/75] Fixes for Windows atomics. -) gpr_atm_no_barrier_load should actually return something. -) If compiling under mingw32, your compiler is gcc and gcc atomics become available. --- include/grpc/support/atm.h | 2 +- include/grpc/support/atm_win32.h | 2 +- include/grpc/support/port_platform.h | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/grpc/support/atm.h b/include/grpc/support/atm.h index feca6b30b23..ba8d7f579e1 100644 --- a/include/grpc/support/atm.h +++ b/include/grpc/support/atm.h @@ -83,7 +83,7 @@ #include #elif defined(GPR_GCC_SYNC) #include -#elif defined(GPR_WIN32) +#elif defined(GPR_WIN32_ATOMIC) #include #else #error could not determine platform for atm diff --git a/include/grpc/support/atm_win32.h b/include/grpc/support/atm_win32.h index 18bf372004b..8b5322488ec 100644 --- a/include/grpc/support/atm_win32.h +++ b/include/grpc/support/atm_win32.h @@ -51,7 +51,7 @@ static __inline gpr_atm gpr_atm_acq_load(const gpr_atm *p) { static __inline gpr_atm gpr_atm_no_barrier_load(const gpr_atm *p) { /* TODO(dklempner): Can we implement something better here? */ - gpr_atm_acq_load(p); + return gpr_atm_acq_load(p); } static __inline void gpr_atm_rel_store(gpr_atm *p, gpr_atm value) { diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index f04c2e76afa..1b613dc2fd7 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -43,11 +43,21 @@ #define GPR_ARCH_64 1 #define GPR_GETPID_IN_PROCESS_H 1 #define GPR_WINSOCK_SOCKET 1 +#ifdef __GNUC__ +#define GPR_GCC_ATOMIC 1 +#else +#define GPR_WIN32_ATOMIC 1 +#endif #elif defined(_WIN32) || defined(WIN32) #define GPR_ARCH_32 1 #define GPR_WIN32 1 #define GPR_GETPID_IN_PROCESS_H 1 #define GPR_WINSOCK_SOCKET 1 +#ifdef __GNUC__ +#define GPR_GCC_ATOMIC 1 +#else +#define GPR_WIN32_ATOMIC 1 +#endif #elif defined(ANDROID) || defined(__ANDROID__) #define GPR_ANDROID 1 #define GPR_ARCH_32 1 @@ -167,8 +177,8 @@ #endif /* Validate platform combinations */ -#if defined(GPR_GCC_ATOMIC) + defined(GPR_GCC_SYNC) + defined(GPR_WIN32) != 1 -#error Must define exactly one of GPR_GCC_ATOMIC, GPR_GCC_SYNC, GPR_WIN32 +#if defined(GPR_GCC_ATOMIC) + defined(GPR_GCC_SYNC) + defined(GPR_WIN32_ATOMIC) != 1 +#error Must define exactly one of GPR_GCC_ATOMIC, GPR_GCC_SYNC, GPR_WIN32_ATOMIC #endif #if defined(GPR_ARCH_32) + defined(GPR_ARCH_64) != 1 From fb23f1c0e4a38354e28fe3776126eb8655561064 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Wed, 18 Mar 2015 11:42:53 -0700 Subject: [PATCH 68/75] Adds a file containing the version --- tools/dockerfile/grpc_dist_proto/version.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 tools/dockerfile/grpc_dist_proto/version.txt diff --git a/tools/dockerfile/grpc_dist_proto/version.txt b/tools/dockerfile/grpc_dist_proto/version.txt new file mode 100644 index 00000000000..8f0916f768f --- /dev/null +++ b/tools/dockerfile/grpc_dist_proto/version.txt @@ -0,0 +1 @@ +0.5.0 From 64af6830f38b120139deba09215b2dc8786357a3 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Wed, 18 Mar 2015 11:43:39 -0700 Subject: [PATCH 69/75] Corrects some spelling mistakes --- tools/gce_setup/grpc_docker.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index 44b5b459de9..7ffd5b2203f 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -560,7 +560,7 @@ grpc_sync_scripts() { _grpc_ensure_gcloud_ssh || return 1; # declare vars local so that they don't pollute the shell environment - # where they this func is used. + # where this func is used. local grpc_zone grpc_project dry_run # set by _grpc_set_project_and_zone local grpc_hosts grpc_gce_script_root @@ -600,7 +600,7 @@ grpc_sync_images() { _grpc_ensure_gcloud_ssh || return 1; # declare vars local so that they don't pollute the shell environment - # where they this func is used. + # where this func is used. local grpc_zone grpc_project dry_run # set by _grpc_set_project_and_zone local grpc_hosts @@ -645,7 +645,7 @@ _grpc_show_servers_args() { # Shows the grpc servers on the GCE instance grpc_show_servers() { # declare vars local so that they don't pollute the shell environment - # where they this func is used. + # where this func is used. local grpc_zone grpc_project dry_run # set by _grpc_set_project_and_zone # set by _grpc_show_servers local host @@ -683,7 +683,7 @@ grpc_build_proto_bins() { _grpc_ensure_gcloud_ssh || return 1; # declare vars local so that they don't pollute the shell environment - # where they this func is used. + # where this func is used. local grpc_zone grpc_project dry_run # set by _grpc_set_project_and_zone # set by _grpc_build_proto_bins_args local host @@ -742,7 +742,7 @@ _grpc_launch_servers_args() { # If no servers are specified, it launches all known servers grpc_launch_servers() { # declare vars local so that they don't pollute the shell environment - # where they this func is used. + # where this func is used. local grpc_zone grpc_project dry_run # set by _grpc_set_project_and_zone # set by _grpc_launch_servers_args local host servers @@ -825,7 +825,7 @@ grpc_launch_servers() { grpc_interop_test() { _grpc_ensure_gcloud_ssh || return 1; # declare vars local so that they don't pollute the shell environment - # where they this func is used. + # where this func is used. local grpc_zone grpc_project dry_run # set by _grpc_set_project_and_zone # grpc_interop_test_args @@ -874,7 +874,7 @@ grpc_interop_test() { grpc_cloud_prod_test() { _grpc_ensure_gcloud_ssh || return 1; # declare vars local so that they don't pollute the shell environment - # where they this func is used. + # where this func is used. local grpc_zone grpc_project dry_run # set by _grpc_set_project_and_zone # grpc_cloud_prod_test_args @@ -920,7 +920,7 @@ grpc_cloud_prod_test() { grpc_cloud_prod_auth_test() { _grpc_ensure_gcloud_ssh || return 1; # declare vars local so that they don't pollute the shell environment - # where they this func is used. + # where this func is used. local grpc_zone grpc_project dry_run # set by _grpc_set_project_and_zone # grpc_cloud_prod_test_args From a4ac78c8ce23df5143487aa38c1bda2cd98228e6 Mon Sep 17 00:00:00 2001 From: David Klempner Date: Wed, 18 Mar 2015 14:20:53 -0700 Subject: [PATCH 70/75] Make metadata_test test_things_stick_around use fewer strings This test is quadratic in nstr and times out under tsan. --- test/core/transport/metadata_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c index f345cebdb6a..66b5407d3c5 100644 --- a/test/core/transport/metadata_test.c +++ b/test/core/transport/metadata_test.c @@ -178,7 +178,7 @@ static void test_things_stick_around(void) { grpc_mdctx *ctx; int i, j; char *buffer; - int nstrs = 10000; + int nstrs = 1000; grpc_mdstr **strs = gpr_malloc(sizeof(grpc_mdstr *) * nstrs); int *shuf = gpr_malloc(sizeof(int) * nstrs); grpc_mdstr *test; From 0d949f5decbf2d98d5a9c9731292379d996566ef Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Wed, 18 Mar 2015 11:44:38 -0700 Subject: [PATCH 71/75] Updates the structure and name of the tar.gz archive - the name includes a version - the top-level directory of the tar has the same name as the archive --- tools/dockerfile/grpc_dist_proto/Dockerfile | 17 ++++++++++------- tools/gce_setup/grpc_docker.sh | 8 ++++---- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/tools/dockerfile/grpc_dist_proto/Dockerfile b/tools/dockerfile/grpc_dist_proto/Dockerfile index a15b7ca4a61..b4ed3b6035d 100644 --- a/tools/dockerfile/grpc_dist_proto/Dockerfile +++ b/tools/dockerfile/grpc_dist_proto/Dockerfile @@ -30,6 +30,9 @@ # Dockerfile to build protoc and plugins for inclusion in a release. FROM grpc/base +# Add the file containing the gRPC version +ADD version.txt version.txt + # Install tools needed for building protoc. RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev @@ -56,16 +59,16 @@ WORKDIR /var/local/git/grpc RUN LDFLAGS=-static make plugins # Create an archive containing all the generated binaries. -RUN mkdir /tmp/proto_bins_root -RUN cp -v bins/opt/* /tmp/proto_bins_root -RUN cp -v /tmp/protoc_static/bin/protoc /tmp/proto_bins_root -RUN cd /tmp/proto_bins_root && \ - tar -czf /tmp/proto-bins-linux-$(uname -m).tar.gz * +RUN mkdir /tmp/proto-bins_$(cat /version.txt)_linux-$(uname -m) +RUN cp -v bins/opt/* /tmp/proto-bins_$(cat /version.txt)_linux-$(uname -m) +RUN cp -v /tmp/protoc_static/bin/protoc /tmp/proto-bins_$(cat /version.txt)_linux-$(uname -m) +RUN cd /tmp && \ + tar -czf proto-bins_$(cat /version.txt)_linux-$(uname -m).tar.gz proto-bins_$(cat /version.txt)_linux-$(uname -m) # List the tar contents: provides a way to visually confirm that the contents # are correct. -RUN echo 'proto-bins-linux-tar-$(uname -m) contents:' && \ - tar -ztf /tmp/proto-bins-linux-$(uname -m).tar.gz +RUN echo 'proto-bins_$(cat /version.txt)_linux-tar-$(uname -m) contents:' && \ + tar -ztf /tmp/proto-bins_$(cat /version.txt)_linux-$(uname -m).tar.gz diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index 7ffd5b2203f..88735fe4507 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -698,10 +698,10 @@ grpc_build_proto_bins() { local label='dist_proto' grpc_update_image -- -h $host $label || return 1 - # run a command to copy the generated output to the local machine + # run a command to copy the generated archive to the docker host local docker_prefix='sudo docker run -v /tmp:/tmp/proto_bins_out' - local tar_name='proto-bins-linux-x86_64.tar.gz' - local cp_cmd="cp /tmp/$tar_name /tmp/proto_bins_out" + local tar_name='proto-bins*.tar.gz' + local cp_cmd="/bin/bash -c 'cp -v /tmp/$tar_name /tmp/proto_bins_out'" local cmd="$docker_prefix grpc/$label $cp_cmd" local ssh_cmd="bash -l -c \"$cmd\"" echo "will run:" @@ -711,7 +711,7 @@ grpc_build_proto_bins() { # copy the tar.gz locally local rmt_tar="$host:/tmp/$tar_name" - local local_copy="$(pwd)/$tar_name" + local local_copy="$(pwd)" gcloud compute copy-files $rmt_tar $local_copy $project_opt $zone_opt || return 1 } From f86811890e0d4ce580de06f067eebfbabca33cbc Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Wed, 18 Mar 2015 14:25:44 -0700 Subject: [PATCH 72/75] Better support for msys2. --- Makefile | 130 +++++++++++++++++++++++++++++------- templates/Makefile.template | 130 +++++++++++++++++++++++++++++------- 2 files changed, 212 insertions(+), 48 deletions(-) diff --git a/Makefile b/Makefile index 8be6c5fd0a4..857bde172e9 100644 --- a/Makefile +++ b/Makefile @@ -37,12 +37,38 @@ HOST_SYSTEM = $(shell uname | cut -f 1 -d_) ifeq ($(SYSTEM),) SYSTEM = $(HOST_SYSTEM) endif +ifeq ($(SYSTEM),MSYS) +SYSTEM = MINGW32 +endif ifndef BUILDDIR BUILDDIR = . endif +HAS_GCC = $(shell which gcc > /dev/null 2> /dev/null && echo true || echo false) +HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false) +HAS_CLANG = $(shell which clang > /dev/null 2> /dev/null && echo true || echo false) + +ifeq ($(HAS_CC),true) +DEFAULT_CC = cc +DEFAULT_CXX = c++ +else +ifeq ($(HAS_GCC),true) +DEFAULT_CC = gcc +DEFAULT_CXX = g++ +else +ifeq ($(HAS_CLANG),true) +DEFAULT_CC = clang +DEFAULT_CXX = clang++ +else +DEFAULT_CC = no_c_compiler +DEFAULT_CXX = no_c++_compiler +endif +endif +endif + + BINDIR = $(BUILDDIR)/bins OBJDIR = $(BUILDDIR)/objs LIBDIR = $(BUILDDIR)/libs @@ -51,29 +77,29 @@ GENDIR = $(BUILDDIR)/gens # Configurations VALID_CONFIG_opt = 1 -CC_opt = cc -CXX_opt = c++ -LD_opt = cc -LDXX_opt = c++ +CC_opt = $(DEFAULT_CC) +CXX_opt = $(DEFAULT_CXX) +LD_opt = $(DEFAULT_CC) +LDXX_opt = $(DEFAULT_CXX) CPPFLAGS_opt = -O2 LDFLAGS_opt = DEFINES_opt = NDEBUG VALID_CONFIG_dbg = 1 -CC_dbg = cc -CXX_dbg = c++ -LD_dbg = cc -LDXX_dbg = c++ +CC_dbg = $(DEFAULT_CC) +CXX_dbg = $(DEFAULT_CXX) +LD_dbg = $(DEFAULT_CC) +LDXX_dbg = $(DEFAULT_CXX) CPPFLAGS_dbg = -O0 LDFLAGS_dbg = DEFINES_dbg = _DEBUG DEBUG VALID_CONFIG_valgrind = 1 REQUIRE_CUSTOM_LIBRARIES_valgrind = 1 -CC_valgrind = cc -CXX_valgrind = c++ -LD_valgrind = cc -LDXX_valgrind = c++ +CC_valgrind = $(DEFAULT_CC) +CXX_valgrind = $(DEFAULT_CXX) +LD_valgrind = $(DEFAULT_CC) +LDXX_valgrind = $(DEFAULT_CXX) CPPFLAGS_valgrind = -O0 OPENSSL_CFLAGS_valgrind = -DPURIFY LDFLAGS_valgrind = @@ -194,8 +220,14 @@ else CXXFLAGS += -std=c++0x DEFINES += GRPC_OLD_CXX endif -CPPFLAGS += -g -fPIC -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -LDFLAGS += -g -fPIC +CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter +LDFLAGS += -g + +ifneq ($(SYSTEM),MINGW32) +PIC_CPPFLAGS = -fPIC +CPPFLAGS += -fPIC +LDFLAGS += -fPIC +endif INCLUDES = . include $(GENDIR) ifeq ($(SYSTEM),Darwin) @@ -218,11 +250,18 @@ endif ifneq ($(wildcard /usr/local/lib),) LDFLAGS += -L/usr/local/lib endif -else +endif + +ifeq ($(SYSTEM),Linux) LIBS = rt m z pthread LDFLAGS += -pthread endif +ifeq ($(SYSTEM),MINGW32) +LIBS = m z pthread +LDFLAGS += -pthread +endif + ifneq ($(wildcard /usr/src/gtest/src/gtest-all.cc),) GTEST_LIB = /usr/src/gtest/src/gtest-all.cc -I/usr/src/gtest else @@ -272,13 +311,31 @@ else IS_GIT_FOLDER = true endif -OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c -lssl -lcrypto -ldl $(LDFLAGS) +ifeq ($(SYSTEM),Linux) +OPENSSL_REQUIRES_DL = true +endif + +ifeq ($(SYSTEM),Darwin) +OPENSSL_REQUIRES_DL = true +endif + +ifeq ($(SYSTEM),MINGW32) +OPENSSL_LIBS = ssl32 eay32 +else +OPENSSL_LIBS = ssl crypto +endif + +OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS) ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS) PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS) PROTOBUF_CHECK_CMD = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS) -PROTOC_CMD = which protoc +PROTOC_CMD = which protoc > /dev/null PROTOC_CHECK_CMD = protoc --version | grep -q libprotoc.3 +ifeq ($(OPENSSL_REQUIRES_DL),true) +OPENSSL_ALPN_CHECK_CMD += -ldl +endif + ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG) HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_SYSTEM_PERFTOOLS),true) @@ -299,7 +356,7 @@ HAS_SYSTEM_ZLIB = false HAS_SYSTEM_PROTOBUF = false endif -HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false) +HAS_PROTOC = $(shell $(PROTOC_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_PROTOC),true) HAS_VALID_PROTOC = $(shell $(PROTOC_CHECK_CMD) 2> /dev/null && echo true || echo false) else @@ -344,12 +401,17 @@ OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/openssl/libssl.a $(LIBDIR)/$(CONFIG)/o # need to prefix these to ensure overriding system libraries CPPFLAGS := -Ithird_party/openssl/include $(CPPFLAGS) LDFLAGS := -L$(LIBDIR)/$(CONFIG)/openssl $(LDFLAGS) +ifeq ($(OPENSSL_REQUIRES_DL),true) LIBS_SECURE = dl +endif else NO_SECURE = true endif else -LIBS_SECURE = ssl crypto dl +LIBS_SECURE = $(OPENSSL_LIBS) +ifeq ($(OPENSSL_REQUIRES_DL),true) +LIBS_SECURE += dl +endif endif LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE)) @@ -923,7 +985,7 @@ run_dep_checks: $(LIBDIR)/$(CONFIG)/zlib/libz.a: $(E) "[MAKE] Building zlib" - $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="-fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static) + $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static) $(Q)$(MAKE) -C third_party/zlib clean $(Q)$(MAKE) -C third_party/zlib $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/zlib @@ -932,9 +994,29 @@ $(LIBDIR)/$(CONFIG)/zlib/libz.a: $(LIBDIR)/$(CONFIG)/openssl/libssl.a: $(E) "[MAKE] Building openssl for $(SYSTEM)" ifeq ($(SYSTEM),Darwin) - $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc) + $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc) else - $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG))) +ifeq ($(SYSTEM),MINGW32) + @echo "We currently don't have a good way to compile OpenSSL in-place under msys." + @echo "Please provide an ALPN-capable OpenSSL in your mingw32 system." + @echo + @echo "Note that you can find a compatible version of the libraries here:" + @echo + @echo "http://slproweb.com/products/Win32OpenSSL.html" + @echo + @echo "If you decide to install that one, take the full version. The light" + @echo "version only contains compiled DLLs, without the development files." + @echo + @echo "When installing, chose to copy the OpenSSL dlls to the OpenSSL binaries" + @echo "directory. This way we'll link to them directly." + @echo + @echo "You can then re-start the build the following way:" + @echo + @echo " CPPFLAGS=-I/c/OpenSSL-Win64/include LDFLAGS=-L/c/OpenSSL-Win64 make" + @false +else + $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG))) +endif endif $(Q)$(MAKE) -C third_party/openssl clean $(Q)$(MAKE) -C third_party/openssl build_crypto build_ssl @@ -948,9 +1030,9 @@ third_party/protobuf/configure: $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure $(E) "[MAKE] Building protobuf" ifeq ($(HAVE_CXX11),true) - $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) + $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) else - $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) + $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) endif $(Q)$(MAKE) -C third_party/protobuf clean $(Q)$(MAKE) -C third_party/protobuf diff --git a/templates/Makefile.template b/templates/Makefile.template index 6845b911aa1..36d11425df4 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -54,12 +54,38 @@ HOST_SYSTEM = $(shell uname | cut -f 1 -d_) ifeq ($(SYSTEM),) SYSTEM = $(HOST_SYSTEM) endif +ifeq ($(SYSTEM),MSYS) +SYSTEM = MINGW32 +endif ifndef BUILDDIR BUILDDIR = . endif +HAS_GCC = $(shell which gcc > /dev/null 2> /dev/null && echo true || echo false) +HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false) +HAS_CLANG = $(shell which clang > /dev/null 2> /dev/null && echo true || echo false) + +ifeq ($(HAS_CC),true) +DEFAULT_CC = cc +DEFAULT_CXX = c++ +else +ifeq ($(HAS_GCC),true) +DEFAULT_CC = gcc +DEFAULT_CXX = g++ +else +ifeq ($(HAS_CLANG),true) +DEFAULT_CC = clang +DEFAULT_CXX = clang++ +else +DEFAULT_CC = no_c_compiler +DEFAULT_CXX = no_c++_compiler +endif +endif +endif + + BINDIR = $(BUILDDIR)/bins OBJDIR = $(BUILDDIR)/objs LIBDIR = $(BUILDDIR)/libs @@ -68,29 +94,29 @@ GENDIR = $(BUILDDIR)/gens # Configurations VALID_CONFIG_opt = 1 -CC_opt = cc -CXX_opt = c++ -LD_opt = cc -LDXX_opt = c++ +CC_opt = $(DEFAULT_CC) +CXX_opt = $(DEFAULT_CXX) +LD_opt = $(DEFAULT_CC) +LDXX_opt = $(DEFAULT_CXX) CPPFLAGS_opt = -O2 LDFLAGS_opt = DEFINES_opt = NDEBUG VALID_CONFIG_dbg = 1 -CC_dbg = cc -CXX_dbg = c++ -LD_dbg = cc -LDXX_dbg = c++ +CC_dbg = $(DEFAULT_CC) +CXX_dbg = $(DEFAULT_CXX) +LD_dbg = $(DEFAULT_CC) +LDXX_dbg = $(DEFAULT_CXX) CPPFLAGS_dbg = -O0 LDFLAGS_dbg = DEFINES_dbg = _DEBUG DEBUG VALID_CONFIG_valgrind = 1 REQUIRE_CUSTOM_LIBRARIES_valgrind = 1 -CC_valgrind = cc -CXX_valgrind = c++ -LD_valgrind = cc -LDXX_valgrind = c++ +CC_valgrind = $(DEFAULT_CC) +CXX_valgrind = $(DEFAULT_CXX) +LD_valgrind = $(DEFAULT_CC) +LDXX_valgrind = $(DEFAULT_CXX) CPPFLAGS_valgrind = -O0 OPENSSL_CFLAGS_valgrind = -DPURIFY LDFLAGS_valgrind = @@ -211,8 +237,14 @@ else CXXFLAGS += -std=c++0x DEFINES += GRPC_OLD_CXX endif -CPPFLAGS += -g -fPIC -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -LDFLAGS += -g -fPIC +CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter +LDFLAGS += -g + +ifneq ($(SYSTEM),MINGW32) +PIC_CPPFLAGS = -fPIC +CPPFLAGS += -fPIC +LDFLAGS += -fPIC +endif INCLUDES = . include $(GENDIR) ifeq ($(SYSTEM),Darwin) @@ -235,11 +267,18 @@ endif ifneq ($(wildcard /usr/local/lib),) LDFLAGS += -L/usr/local/lib endif -else +endif + +ifeq ($(SYSTEM),Linux) LIBS = rt m z pthread LDFLAGS += -pthread endif +ifeq ($(SYSTEM),MINGW32) +LIBS = m z pthread +LDFLAGS += -pthread +endif + ifneq ($(wildcard /usr/src/gtest/src/gtest-all.cc),) GTEST_LIB = /usr/src/gtest/src/gtest-all.cc -I/usr/src/gtest else @@ -289,13 +328,31 @@ else IS_GIT_FOLDER = true endif -OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c -lssl -lcrypto -ldl $(LDFLAGS) +ifeq ($(SYSTEM),Linux) +OPENSSL_REQUIRES_DL = true +endif + +ifeq ($(SYSTEM),Darwin) +OPENSSL_REQUIRES_DL = true +endif + +ifeq ($(SYSTEM),MINGW32) +OPENSSL_LIBS = ssl32 eay32 +else +OPENSSL_LIBS = ssl crypto +endif + +OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS) ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS) PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS) PROTOBUF_CHECK_CMD = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS) -PROTOC_CMD = which protoc +PROTOC_CMD = which protoc > /dev/null PROTOC_CHECK_CMD = protoc --version | grep -q libprotoc.3 +ifeq ($(OPENSSL_REQUIRES_DL),true) +OPENSSL_ALPN_CHECK_CMD += -ldl +endif + ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG) HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_SYSTEM_PERFTOOLS),true) @@ -316,7 +373,7 @@ HAS_SYSTEM_ZLIB = false HAS_SYSTEM_PROTOBUF = false endif -HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false) +HAS_PROTOC = $(shell $(PROTOC_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_PROTOC),true) HAS_VALID_PROTOC = $(shell $(PROTOC_CHECK_CMD) 2> /dev/null && echo true || echo false) else @@ -361,12 +418,17 @@ OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/openssl/libssl.a $(LIBDIR)/$(CONFIG)/o # need to prefix these to ensure overriding system libraries CPPFLAGS := -Ithird_party/openssl/include $(CPPFLAGS) LDFLAGS := -L$(LIBDIR)/$(CONFIG)/openssl $(LDFLAGS) +ifeq ($(OPENSSL_REQUIRES_DL),true) LIBS_SECURE = dl +endif else NO_SECURE = true endif else -LIBS_SECURE = ssl crypto dl +LIBS_SECURE = $(OPENSSL_LIBS) +ifeq ($(OPENSSL_REQUIRES_DL),true) +LIBS_SECURE += dl +endif endif LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE)) @@ -513,7 +575,7 @@ run_dep_checks: $(LIBDIR)/$(CONFIG)/zlib/libz.a: $(E) "[MAKE] Building zlib" - $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="-fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static) + $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static) $(Q)$(MAKE) -C third_party/zlib clean $(Q)$(MAKE) -C third_party/zlib $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/zlib @@ -522,9 +584,29 @@ $(LIBDIR)/$(CONFIG)/zlib/libz.a: $(LIBDIR)/$(CONFIG)/openssl/libssl.a: $(E) "[MAKE] Building openssl for $(SYSTEM)" ifeq ($(SYSTEM),Darwin) - $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc) + $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc) else - $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG))) +ifeq ($(SYSTEM),MINGW32) + @echo "We currently don't have a good way to compile OpenSSL in-place under msys." + @echo "Please provide an ALPN-capable OpenSSL in your mingw32 system." + @echo + @echo "Note that you can find a compatible version of the libraries here:" + @echo + @echo "http://slproweb.com/products/Win32OpenSSL.html" + @echo + @echo "If you decide to install that one, take the full version. The light" + @echo "version only contains compiled DLLs, without the development files." + @echo + @echo "When installing, chose to copy the OpenSSL dlls to the OpenSSL binaries" + @echo "directory. This way we'll link to them directly." + @echo + @echo "You can then re-start the build the following way:" + @echo + @echo " CPPFLAGS=-I/c/OpenSSL-Win64/include LDFLAGS=-L/c/OpenSSL-Win64 make" + @false +else + $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG))) +endif endif $(Q)$(MAKE) -C third_party/openssl clean $(Q)$(MAKE) -C third_party/openssl build_crypto build_ssl @@ -538,9 +620,9 @@ third_party/protobuf/configure: $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure $(E) "[MAKE] Building protobuf" ifeq ($(HAVE_CXX11),true) - $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) + $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) else - $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) + $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) endif $(Q)$(MAKE) -C third_party/protobuf clean $(Q)$(MAKE) -C third_party/protobuf From cfd6073a66fda3db150998ef40dbbc76c198c02e Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Wed, 18 Mar 2015 16:27:43 -0700 Subject: [PATCH 73/75] Various Windows fixes. -) using dupenv_s instead of getenv_s and calling strdup ourselves. -) few impossible-to-obtain if checks. -) various signed/unsigned casting. -) using time_t instead of time32_t -) checking output of FormatMessage for failures. -) don't redefine _WIN32_WINNT without undefining it first. -) fixed msvc's interlocked casting. -) renamed AddPort to AddListeningPort. -) added protobuf's third_party includes to search path. -) added a missing definition for inet_ntop in mingw32. -) removed useless declarations. --- examples/pubsub/publisher_test.cc | 2 +- examples/pubsub/subscriber_test.cc | 2 +- include/grpc++/server.h | 2 +- include/grpc++/server_builder.h | 6 ++--- include/grpc/support/atm_win32.h | 26 +++++++++++++------ src/core/iomgr/sockaddr_win32.h | 5 ++++ src/core/iomgr/tcp_server_windows.c | 3 --- src/core/iomgr/tcp_windows.c | 4 +-- src/core/support/env_win32.c | 15 ++++++----- src/core/support/file_win32.c | 2 +- src/core/support/log_win32.c | 8 +++--- src/core/support/string_win32.c | 6 +++-- src/core/support/sync_win32.c | 1 + src/core/support/time_win32.c | 4 +-- src/cpp/common/call.cc | 9 ++++--- src/cpp/server/server.cc | 3 ++- src/cpp/server/server_builder.cc | 8 +++--- .../Grpc.Core.Tests/ClientServerTest.cs | 6 ++--- src/csharp/Grpc.Core.Tests/ServerTest.cs | 2 +- .../Grpc.Core/Internal/ServerSafeHandle.cs | 4 +-- src/csharp/Grpc.Core/Server.cs | 8 +++--- .../MathClientServerTests.cs | 2 +- .../InteropClientServerTest.cs | 2 +- .../Grpc.IntegrationTesting/InteropServer.cs | 4 +-- test/cpp/end2end/async_end2end_test.cc | 2 +- test/cpp/end2end/end2end_test.cc | 2 +- test/cpp/end2end/generic_end2end_test.cc | 2 +- test/cpp/interop/server.cc | 2 +- test/cpp/qps/server.cc | 2 +- test/cpp/qps/server_async.cc | 2 +- test/cpp/qps/server_sync.cc | 2 +- test/cpp/qps/worker.cc | 2 +- vsprojects/vs2013/global.props | 2 +- 33 files changed, 88 insertions(+), 64 deletions(-) diff --git a/examples/pubsub/publisher_test.cc b/examples/pubsub/publisher_test.cc index f9b6bb3418d..62442c73847 100644 --- a/examples/pubsub/publisher_test.cc +++ b/examples/pubsub/publisher_test.cc @@ -107,7 +107,7 @@ class PublisherTest : public ::testing::Test { int port = grpc_pick_unused_port_or_die(); server_address_ << "localhost:" << port; ServerBuilder builder; - builder.AddPort(server_address_.str(), grpc::InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), grpc::InsecureServerCredentials()); builder.RegisterService(&service_); server_ = builder.BuildAndStart(); diff --git a/examples/pubsub/subscriber_test.cc b/examples/pubsub/subscriber_test.cc index 2d606336add..b8dd1f9486e 100644 --- a/examples/pubsub/subscriber_test.cc +++ b/examples/pubsub/subscriber_test.cc @@ -105,7 +105,7 @@ class SubscriberTest : public ::testing::Test { int port = grpc_pick_unused_port_or_die(); server_address_ << "localhost:" << port; ServerBuilder builder; - builder.AddPort(server_address_.str(), grpc::InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), grpc::InsecureServerCredentials()); builder.RegisterService(&service_); server_ = builder.BuildAndStart(); diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 8cd0a4f6681..bddb4f62aa8 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -86,7 +86,7 @@ class Server GRPC_FINAL : private CallHook, bool RegisterAsyncService(AsynchronousService* service); void RegisterAsyncGenericService(AsyncGenericService* service); // Add a listening port. Can be called multiple times. - int AddPort(const grpc::string& addr, ServerCredentials* creds); + int AddListeningPort(const grpc::string& addr, ServerCredentials* creds); // Start the server. bool Start(); diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index c09c8fee52c..9a9932ebe01 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -69,9 +69,9 @@ class ServerBuilder { void RegisterAsyncGenericService(AsyncGenericService* service); // Add a listening port. Can be called multiple times. - void AddPort(const grpc::string& addr, - std::shared_ptr creds, - int* selected_port = nullptr); + void AddListeningPort(const grpc::string& addr, + std::shared_ptr creds, + int* selected_port = nullptr); // Set the thread pool used for running appliation rpc handlers. // Does not take ownership. diff --git a/include/grpc/support/atm_win32.h b/include/grpc/support/atm_win32.h index 8b5322488ec..4a21b5b547c 100644 --- a/include/grpc/support/atm_win32.h +++ b/include/grpc/support/atm_win32.h @@ -63,25 +63,31 @@ static __inline int gpr_atm_no_barrier_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { /* InterlockedCompareExchangePointerNoFence() not available on vista or windows7 */ #ifdef GPR_ARCH_64 - return o == (gpr_atm)InterlockedCompareExchangeAcquire64(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeAcquire64((volatile LONGLONG *) p, + (LONGLONG) n, (LONGLONG) o); #else - return o == (gpr_atm)InterlockedCompareExchangeAcquire(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeAcquire((volatile LONG *) p, + (LONG) n, (LONG) o); #endif } static __inline int gpr_atm_acq_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { #ifdef GPR_ARCH_64 - return o == (gpr_atm)InterlockedCompareExchangeAcquire64(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeAcquire64((volatile LONGLONG) p, + (LONGLONG) n, (LONGLONG) o); #else - return o == (gpr_atm)InterlockedCompareExchangeAcquire(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeAcquire((volatile LONG *) p, + (LONG) n, (LONG) o); #endif } static __inline int gpr_atm_rel_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { #ifdef GPR_ARCH_64 - return o == (gpr_atm)InterlockedCompareExchangeRelease64(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeRelease64((volatile LONGLONG *) p, + (LONGLONG) n, (LONGLONG) o); #else - return o == (gpr_atm)InterlockedCompareExchangeRelease(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeRelease((volatile LONG *) p, + (LONG) n, (LONG) o); #endif } @@ -101,11 +107,15 @@ static __inline gpr_atm gpr_atm_full_fetch_add(gpr_atm *p, gpr_atm delta) { #ifdef GPR_ARCH_64 do { old = *p; - } while (old != (gpr_atm)InterlockedCompareExchange64(p, old + delta, old)); + } while (old != (gpr_atm)InterlockedCompareExchange64((volatile LONGLONG *) p, + (LONGLONG) old + delta, + (LONGLONG) old)); #else do { old = *p; - } while (old != (gpr_atm)InterlockedCompareExchange(p, old + delta, old)); + } while (old != (gpr_atm)InterlockedCompareExchange((volatile LONG *) p, + (LONG) old + delta, + (LONG) old)); #endif return old; } diff --git a/src/core/iomgr/sockaddr_win32.h b/src/core/iomgr/sockaddr_win32.h index 3a5f27bb345..c0385ea6148 100644 --- a/src/core/iomgr/sockaddr_win32.h +++ b/src/core/iomgr/sockaddr_win32.h @@ -38,4 +38,9 @@ #include #include +#ifdef __MINGW32__ +/* mingw seems to be missing that definition. */ +const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); +#endif + #endif /* GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_WIN32_H */ diff --git a/src/core/iomgr/tcp_server_windows.c b/src/core/iomgr/tcp_server_windows.c index 59319da26d1..0c3ab1dc911 100644 --- a/src/core/iomgr/tcp_server_windows.c +++ b/src/core/iomgr/tcp_server_windows.c @@ -53,9 +53,6 @@ #define INIT_PORT_CAP 2 #define MIN_SAFE_ACCEPT_QUEUE_SIZE 100 -static gpr_once s_init_max_accept_queue_size; -static int s_max_accept_queue_size; - /* one listening port */ typedef struct server_port { gpr_uint8 addresses[sizeof(struct sockaddr_in6) * 2 + 32]; diff --git a/src/core/iomgr/tcp_windows.c b/src/core/iomgr/tcp_windows.c index 3efd69a71b9..ec5496e7eef 100644 --- a/src/core/iomgr/tcp_windows.c +++ b/src/core/iomgr/tcp_windows.c @@ -172,7 +172,7 @@ static void win_notify_on_read(grpc_endpoint *ep, tcp->read_slice = gpr_slice_malloc(8192); buffer.len = GPR_SLICE_LENGTH(tcp->read_slice); - buffer.buf = GPR_SLICE_START_PTR(tcp->read_slice); + buffer.buf = (char *)GPR_SLICE_START_PTR(tcp->read_slice); gpr_log(GPR_DEBUG, "win_notify_on_read: calling WSARecv without overlap"); status = WSARecv(tcp->socket->socket, &buffer, 1, &bytes_read, &flags, @@ -284,7 +284,7 @@ static grpc_endpoint_write_status win_write(grpc_endpoint *ep, for (i = 0; i < tcp->write_slices.count; i++) { buffers[i].len = GPR_SLICE_LENGTH(tcp->write_slices.slices[i]); - buffers[i].buf = GPR_SLICE_START_PTR(tcp->write_slices.slices[i]); + buffers[i].buf = (char *)GPR_SLICE_START_PTR(tcp->write_slices.slices[i]); } gpr_log(GPR_DEBUG, "win_write: calling WSASend without overlap"); diff --git a/src/core/support/env_win32.c b/src/core/support/env_win32.c index 177cc36a30a..9b4cd698ad5 100644 --- a/src/core/support/env_win32.c +++ b/src/core/support/env_win32.c @@ -36,6 +36,7 @@ #ifdef GPR_WIN32 #include "src/core/support/env.h" +#include "src/core/support/string.h" #include @@ -43,14 +44,16 @@ #include char *gpr_getenv(const char *name) { - size_t required_size; + size_t size; char *result = NULL; + char *duplicated; + errno_t err; - getenv_s(&required_size, NULL, 0, name); - if (required_size == 0) return NULL; - result = gpr_malloc(required_size); - getenv_s(&required_size, result, required_size, name); - return result; + err = _dupenv_s(&result, &size, name); + if (err) return NULL; + duplicated = gpr_strdup(result); + free(result); + return duplicated; } void gpr_setenv(const char *name, const char *value) { diff --git a/src/core/support/file_win32.c b/src/core/support/file_win32.c index fe209af9b2d..f59d3af397c 100644 --- a/src/core/support/file_win32.c +++ b/src/core/support/file_win32.c @@ -72,7 +72,7 @@ FILE *gpr_tmpfile(const char *prefix, char **tmp_filename_out) { if (_tfopen_s(&result, tmp_filename, TEXT("wb+")) != 0) goto end; end: - if (result && tmp_filename) { + if (result && tmp_filename_out) { *tmp_filename_out = gpr_tchar_to_char(tmp_filename); } diff --git a/src/core/support/log_win32.c b/src/core/support/log_win32.c index 720dc141f51..159c7e052c5 100644 --- a/src/core/support/log_win32.c +++ b/src/core/support/log_win32.c @@ -43,6 +43,7 @@ #include #include +#include "src/core/support/string.h" #include "src/core/support/string_win32.h" void gpr_log(const char *file, int line, gpr_log_severity severity, @@ -55,7 +56,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity, va_start(args, format); ret = _vscprintf(format, args); va_end(args); - if (!(0 <= ret && ret < ~(size_t)0)) { + if (ret < 0) { message = NULL; } else { /* Allocate a new buffer, with space for the NUL terminator. */ @@ -66,7 +67,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity, va_start(args, format); ret = vsnprintf_s(message, strp_buflen, _TRUNCATE, format, args); va_end(args); - if (ret != strp_buflen - 1) { + if ((size_t)ret != strp_buflen - 1) { /* This should never happen. */ gpr_free(message); message = NULL; @@ -90,7 +91,7 @@ void gpr_default_log(gpr_log_func_args *args) { strcpy(time_buffer, "error:strftime"); } - fprintf(stderr, "%s%s.%09u %5u %s:%d] %s\n", + fprintf(stderr, "%s%s.%09u %5lu %s:%d] %s\n", gpr_log_severity_string(args->severity), time_buffer, (int)(now.tv_nsec), GetCurrentThreadId(), args->file, args->line, args->message); @@ -105,6 +106,7 @@ char *gpr_format_message(DWORD messageid) { NULL, messageid, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)(&tmessage), 0, NULL); + if (status == 0) return gpr_strdup("Unable to retreive error string"); message = gpr_tchar_to_char(tmessage); LocalFree(tmessage); return message; diff --git a/src/core/support/string_win32.c b/src/core/support/string_win32.c index 583abd27d82..6d1d6337a93 100644 --- a/src/core/support/string_win32.c +++ b/src/core/support/string_win32.c @@ -44,6 +44,8 @@ #include +#include "src/core/support/string.h" + int gpr_asprintf(char **strp, const char *format, ...) { va_list args; int ret; @@ -53,7 +55,7 @@ int gpr_asprintf(char **strp, const char *format, ...) { va_start(args, format); ret = _vscprintf(format, args); va_end(args); - if (!(0 <= ret && ret < ~(size_t)0)) { + if (ret < 0) { *strp = NULL; return -1; } @@ -69,7 +71,7 @@ int gpr_asprintf(char **strp, const char *format, ...) { va_start(args, format); ret = vsnprintf_s(*strp, strp_buflen, _TRUNCATE, format, args); va_end(args); - if (ret == strp_buflen - 1) { + if ((size_t)ret == strp_buflen - 1) { return ret; } diff --git a/src/core/support/sync_win32.c b/src/core/support/sync_win32.c index c9a977cc80e..cc31d9b052d 100644 --- a/src/core/support/sync_win32.c +++ b/src/core/support/sync_win32.c @@ -37,6 +37,7 @@ #ifdef GPR_WIN32 +#undef _WIN32_WINNT #define _WIN32_WINNT 0x0600 #include #include diff --git a/src/core/support/time_win32.c b/src/core/support/time_win32.c index 82568496558..f221cb57903 100644 --- a/src/core/support/time_win32.c +++ b/src/core/support/time_win32.c @@ -42,8 +42,8 @@ gpr_timespec gpr_now(void) { gpr_timespec now_tv; - struct __timeb32 now_tb; - _ftime32_s(&now_tb); + struct _timeb now_tb; + _ftime_s(&now_tb); now_tv.tv_sec = now_tb.time; now_tv.tv_nsec = now_tb.millitm * 1000000; return now_tv; diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index ebe7deec702..5c26a1ad7c3 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -48,7 +48,6 @@ CallOpBuffer::CallOpBuffer() initial_metadata_count_(0), initial_metadata_(nullptr), recv_initial_metadata_(nullptr), - recv_initial_metadata_arr_{0, 0, nullptr}, send_message_(nullptr), send_message_buffer_(nullptr), send_buf_(nullptr), @@ -58,7 +57,6 @@ CallOpBuffer::CallOpBuffer() client_send_close_(false), recv_trailing_metadata_(nullptr), recv_status_(nullptr), - recv_trailing_metadata_arr_{0, 0, nullptr}, status_code_(GRPC_STATUS_OK), status_details_(nullptr), status_details_capacity_(0), @@ -66,7 +64,12 @@ CallOpBuffer::CallOpBuffer() trailing_metadata_count_(0), trailing_metadata_(nullptr), cancelled_buf_(0), - recv_closed_(nullptr) {} + recv_closed_(nullptr) { + memset(&recv_trailing_metadata_arr_, 0, sizeof(recv_trailing_metadata_arr_)); + memset(&recv_initial_metadata_arr_, 0, sizeof(recv_initial_metadata_arr_)); + recv_trailing_metadata_arr_.metadata = nullptr; + recv_initial_metadata_arr_.metadata = nullptr; +} void CallOpBuffer::Reset(void* next_return_tag) { return_tag_ = next_return_tag; diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 4d5e77e6337..09a541c5a5f 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -234,7 +234,8 @@ void Server::RegisterAsyncGenericService(AsyncGenericService* service) { service->server_ = this; } -int Server::AddPort(const grpc::string& addr, ServerCredentials* creds) { +int Server::AddListeningPort(const grpc::string& addr, + ServerCredentials* creds) { GPR_ASSERT(!started_); return creds->AddPortToServer(addr, server_); } diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index 835596d393a..960734756e9 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -62,9 +62,9 @@ void ServerBuilder::RegisterAsyncGenericService(AsyncGenericService* service) { generic_service_ = service; } -void ServerBuilder::AddPort(const grpc::string& addr, - std::shared_ptr creds, - int* selected_port) { +void ServerBuilder::AddListeningPort(const grpc::string& addr, + std::shared_ptr creds, + int* selected_port) { ports_.push_back(Port{addr, creds, selected_port}); } @@ -99,7 +99,7 @@ std::unique_ptr ServerBuilder::BuildAndStart() { server->RegisterAsyncGenericService(generic_service_); } for (auto& port : ports_) { - int r = server->AddPort(port.addr, port.creds.get()); + int r = server->AddListeningPort(port.addr, port.creds.get()); if (!r) return nullptr; if (port.selected_port != nullptr) { *port.selected_port = r; diff --git a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs index 807f5a6ded4..3da9e33e536 100644 --- a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs @@ -74,7 +74,7 @@ namespace Grpc.Core.Tests ServerServiceDefinition.CreateBuilder(serviceName) .AddMethod(unaryEchoStringMethod, HandleUnaryEchoString).Build()); - int port = server.AddPort(host + ":0"); + int port = server.AddListeningPort(host + ":0"); server.Start(); using (Channel channel = new Channel(host + ":" + port)) @@ -97,7 +97,7 @@ namespace Grpc.Core.Tests ServerServiceDefinition.CreateBuilder(serviceName) .AddMethod(unaryEchoStringMethod, HandleUnaryEchoString).Build()); - int port = server.AddPort(host + ":0"); + int port = server.AddListeningPort(host + ":0"); server.Start(); using (Channel channel = new Channel(host + ":" + port)) @@ -117,7 +117,7 @@ namespace Grpc.Core.Tests server.AddServiceDefinition( ServerServiceDefinition.CreateBuilder(serviceName).Build()); - int port = server.AddPort(host + ":0"); + int port = server.AddListeningPort(host + ":0"); server.Start(); using (Channel channel = new Channel(host + ":" + port)) diff --git a/src/csharp/Grpc.Core.Tests/ServerTest.cs b/src/csharp/Grpc.Core.Tests/ServerTest.cs index 12f914bfad1..2a1855da675 100644 --- a/src/csharp/Grpc.Core.Tests/ServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ServerTest.cs @@ -47,7 +47,7 @@ namespace Grpc.Core.Tests GrpcEnvironment.Initialize(); Server server = new Server(); - server.AddPort("localhost:0"); + server.AddListeningPort("localhost:0"); server.Start(); server.ShutdownAsync().Wait(); diff --git a/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs b/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs index dc4781e7966..a59da098221 100644 --- a/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs @@ -80,12 +80,12 @@ namespace Grpc.Core.Internal return grpcsharp_server_create(cq, args); } - public int AddPort(string addr) + public int AddListeningPort(string addr) { return grpcsharp_server_add_http2_port(this, addr); } - public int AddPort(string addr, ServerCredentialsSafeHandle credentials) + public int AddListeningPort(string addr, ServerCredentialsSafeHandle credentials) { return grpcsharp_server_add_secure_http2_port(this, addr, credentials); } diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs index 2439cdb6dc3..f086fa8beb9 100644 --- a/src/csharp/Grpc.Core/Server.cs +++ b/src/csharp/Grpc.Core/Server.cs @@ -76,17 +76,17 @@ namespace Grpc.Core } // only call before Start() - public int AddPort(string addr) + public int AddListeningPort(string addr) { - return handle.AddPort(addr); + return handle.AddListeningPort(addr); } // only call before Start() - public int AddPort(string addr, ServerCredentials credentials) + public int AddListeningPort(string addr, ServerCredentials credentials) { using (var nativeCredentials = credentials.ToNativeCredentials()) { - return handle.AddPort(addr, nativeCredentials); + return handle.AddListeningPort(addr, nativeCredentials); } } diff --git a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs index 32a523f2135..85f213cb391 100644 --- a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs +++ b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs @@ -58,7 +58,7 @@ namespace math.Tests server = new Server(); server.AddServiceDefinition(MathGrpc.BindService(new MathServiceImpl())); - int port = server.AddPort(host + ":0"); + int port = server.AddListeningPort(host + ":0"); server.Start(); channel = new Channel(host + ":" + port); diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs b/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs index 814f6311f23..1e76d3df213 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs @@ -59,7 +59,7 @@ namespace Grpc.IntegrationTesting server = new Server(); server.AddServiceDefinition(TestServiceGrpc.BindService(new TestServiceImpl())); - int port = server.AddPort(host + ":0", TestCredentials.CreateTestServerCredentials()); + int port = server.AddListeningPort(host + ":0", TestCredentials.CreateTestServerCredentials()); server.Start(); var channelArgs = ChannelArgs.CreateBuilder() diff --git a/src/csharp/Grpc.IntegrationTesting/InteropServer.cs b/src/csharp/Grpc.IntegrationTesting/InteropServer.cs index 5e580280b61..ad5200774f5 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropServer.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropServer.cs @@ -96,11 +96,11 @@ namespace Grpc.IntegrationTesting string addr = "0.0.0.0:" + options.port; if (options.useTls) { - server.AddPort(addr, TestCredentials.CreateTestServerCredentials()); + server.AddListeningPort(addr, TestCredentials.CreateTestServerCredentials()); } else { - server.AddPort(addr); + server.AddListeningPort(addr); } Console.WriteLine("Running server on " + addr); server.Start(); diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index e011b788ff0..c6b53c60a51 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -99,7 +99,7 @@ class AsyncEnd2endTest : public ::testing::Test { server_address_ << "localhost:" << port; // Setup server ServerBuilder builder; - builder.AddPort(server_address_.str(), grpc::InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), grpc::InsecureServerCredentials()); builder.RegisterAsyncService(&service_); server_ = builder.BuildAndStart(); } diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index c586849349c..41c26695336 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -151,7 +151,7 @@ class End2endTest : public ::testing::Test { server_address_ << "localhost:" << port; // Setup server ServerBuilder builder; - builder.AddPort(server_address_.str(), InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), InsecureServerCredentials()); builder.RegisterService(&service_); builder.RegisterService(&dup_pkg_service_); builder.SetThreadPool(&thread_pool_); diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index 4a0d2c5c01d..5377d05a4e3 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -98,7 +98,7 @@ class GenericEnd2endTest : public ::testing::Test { server_address_ << "localhost:" << port; // Setup server ServerBuilder builder; - builder.AddPort(server_address_.str(), InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), InsecureServerCredentials()); builder.RegisterAsyncGenericService(&generic_service_); server_ = builder.BuildAndStart(); } diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc index 743482e9671..eceb600d4ce 100644 --- a/test/cpp/interop/server.cc +++ b/test/cpp/interop/server.cc @@ -217,7 +217,7 @@ void RunServer() { "", {{test_server1_key, test_server1_cert}}}; creds = grpc::SslServerCredentials(ssl_opts); } - builder.AddPort(server_address.str(), creds); + builder.AddListeningPort(server_address.str(), creds); std::unique_ptr server(builder.BuildAndStart()); gpr_log(GPR_INFO, "Server listening on %s", server_address.str().c_str()); while (!got_sigint) { diff --git a/test/cpp/qps/server.cc b/test/cpp/qps/server.cc index 005f0f9c5e2..4ebedf83c1b 100644 --- a/test/cpp/qps/server.cc +++ b/test/cpp/qps/server.cc @@ -137,7 +137,7 @@ static void RunServer() { SimpleResponse response; ServerBuilder builder; - builder.AddPort(server_address, grpc::InsecureServerCredentials()); + builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); builder.RegisterService(&service); std::unique_ptr pool(new ThreadPool(FLAGS_server_threads)); diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index 19778e5a7cd..121ac73c526 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -68,7 +68,7 @@ class AsyncQpsServerTest : public Server { gpr_join_host_port(&server_address, "::", port); ServerBuilder builder; - builder.AddPort(server_address, InsecureServerCredentials()); + builder.AddListeningPort(server_address, InsecureServerCredentials()); gpr_free(server_address); builder.RegisterAsyncService(&async_service_); diff --git a/test/cpp/qps/server_sync.cc b/test/cpp/qps/server_sync.cc index 5c6541989c6..3e15fb61c02 100644 --- a/test/cpp/qps/server_sync.cc +++ b/test/cpp/qps/server_sync.cc @@ -84,7 +84,7 @@ class SynchronousServer GRPC_FINAL : public grpc::testing::Server { char* server_address = NULL; gpr_join_host_port(&server_address, "::", port); - builder.AddPort(server_address, InsecureServerCredentials()); + builder.AddListeningPort(server_address, InsecureServerCredentials()); gpr_free(server_address); builder.RegisterService(&service_); diff --git a/test/cpp/qps/worker.cc b/test/cpp/qps/worker.cc index faabfd11477..fdcd9d50697 100644 --- a/test/cpp/qps/worker.cc +++ b/test/cpp/qps/worker.cc @@ -210,7 +210,7 @@ static void RunServer() { WorkerImpl service; ServerBuilder builder; - builder.AddPort(server_address, InsecureServerCredentials()); + builder.AddListeningPort(server_address, InsecureServerCredentials()); builder.RegisterService(&service); gpr_free(server_address); diff --git a/vsprojects/vs2013/global.props b/vsprojects/vs2013/global.props index 27efc13b247..ae44e18d4ea 100644 --- a/vsprojects/vs2013/global.props +++ b/vsprojects/vs2013/global.props @@ -5,7 +5,7 @@ - $(SolutionDir)\..\..;$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\third_party\zlib;$(SolutionDir)\..\third_party;$(SolutionDir)\..\..\third_party\openssl\inc32 + $(SolutionDir)\..\..;$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\third_party\zlib;$(SolutionDir)\..\third_party;$(SolutionDir)\..\..\third_party\openssl\inc32;$(SolutionDir)\..\..\third_party\protobuf\src _CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) EnableAllWarnings From eab96f51fb43a959f73c809b878a32af59819b81 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 19 Mar 2015 06:41:10 +0100 Subject: [PATCH 74/75] Dodging VisualStudio's #define of max(). --- include/grpc++/completion_queue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index d742d85ef72..6b2f539fa27 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -88,7 +88,7 @@ class CompletionQueue { // Returns false if the queue is ready for destruction, true if event bool Next(void **tag, bool *ok) { return (AsyncNext(tag,ok, - std::chrono::system_clock::time_point::max()) != + (std::chrono::system_clock::time_point::max)()) != SHUTDOWN); } From 050e37aab8b20b5832b7c8d6226c3b2000562455 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Thu, 19 Mar 2015 07:27:28 -0700 Subject: [PATCH 75/75] resolve merge error --- include/grpc++/completion_queue.h | 90 +++++++++++++++---------------- 1 file changed, 44 insertions(+), 46 deletions(-) diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index cb4ce50e934..f4619a1060a 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -86,53 +86,51 @@ class CompletionQueue { // Blocking (until deadline) read from queue. // Returns false if the queue is ready for destruction, true if event + bool Next(void** tag, bool* ok) { - return (AsyncNext(tag, ok, std::chrono::system_clock::time_point::max()) != - SHUTDOWN); - - bool Next(void** tag, bool* ok) { - return ( - AsyncNext(tag, ok, (std::chrono::system_clock::time_point::max)()) != - SHUTDOWN); - } - - // Shutdown has to be called, and the CompletionQueue can only be - // destructed when false is returned from Next(). - void Shutdown(); - - grpc_completion_queue* cq() { return cq_; } - - private: - // Friend synchronous wrappers so that they can access Pluck(), which is - // a semi-private API geared towards the synchronous implementation. - template - friend class ::grpc::ClientReader; - template - friend class ::grpc::ClientWriter; - template - friend class ::grpc::ClientReaderWriter; - template - friend class ::grpc::ServerReader; - template - friend class ::grpc::ServerWriter; - template - friend class ::grpc::ServerReaderWriter; - friend class ::grpc::Server; - friend class ::grpc::ServerContext; - friend Status BlockingUnaryCall( - ChannelInterface * channel, const RpcMethod& method, - ClientContext* context, const grpc::protobuf::Message& request, - grpc::protobuf::Message* result); - - // Wraps grpc_completion_queue_pluck. - // Cannot be mixed with calls to Next(). - bool Pluck(CompletionQueueTag * tag); - - // Does a single polling pluck on tag - void TryPluck(CompletionQueueTag * tag); - - grpc_completion_queue* cq_; // owned - }; + return ( + AsyncNext(tag, ok, (std::chrono::system_clock::time_point::max)()) != + SHUTDOWN); + } + + // Shutdown has to be called, and the CompletionQueue can only be + // destructed when false is returned from Next(). + void Shutdown(); + + grpc_completion_queue* cq() { return cq_; } + + private: + // Friend synchronous wrappers so that they can access Pluck(), which is + // a semi-private API geared towards the synchronous implementation. + template + friend class ::grpc::ClientReader; + template + friend class ::grpc::ClientWriter; + template + friend class ::grpc::ClientReaderWriter; + template + friend class ::grpc::ServerReader; + template + friend class ::grpc::ServerWriter; + template + friend class ::grpc::ServerReaderWriter; + friend class ::grpc::Server; + friend class ::grpc::ServerContext; + friend Status BlockingUnaryCall(ChannelInterface* channel, + const RpcMethod& method, + ClientContext* context, + const grpc::protobuf::Message& request, + grpc::protobuf::Message* result); + + // Wraps grpc_completion_queue_pluck. + // Cannot be mixed with calls to Next(). + bool Pluck(CompletionQueueTag* tag); + + // Does a single polling pluck on tag + void TryPluck(CompletionQueueTag* tag); + + grpc_completion_queue* cq_; // owned +}; } // namespace grpc