diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | build.json | 3 | ||||
-rw-r--r-- | include/grpc++/impl/call.h | 1 | ||||
-rw-r--r-- | src/core/iomgr/pollset_windows.c | 6 | ||||
-rw-r--r-- | src/core/support/histogram.c | 4 | ||||
-rw-r--r-- | src/core/surface/completion_queue.c | 1 | ||||
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCSecureChannel.m | 2 | ||||
-rw-r--r-- | test/proto/messages.proto | 27 | ||||
-rw-r--r-- | test/proto/test.proto | 8 | ||||
-rw-r--r-- | tools/codegen/core/gen_hpack_tables.c (renamed from src/core/transport/chttp2/gen_hpack_tables.c) | 0 | ||||
-rw-r--r-- | vsprojects/Grpc.mak | 4 |
12 files changed, 53 insertions, 13 deletions
diff --git a/.travis.yml b/.travis.yml index c626242557..97cf99d71e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ script: - if [ ! -z "$USE_GCC" ] ; then export CC=gcc-$USE_GCC ; export CXX=g++-$USE_GCC ; fi - ./tools/run_tests/run_tests.py -l $TEST -t -j $JOBS -c $CONFIG -s 4.0 after_success: - - if [ "$CONFIG" = "gcov" ] ; then coveralls --exclude third_party --exclude gens --exclude test --exclude src/compiler -b. --gcov-options '\-p' ; fi + - if [ "$CONFIG" = "gcov" ] ; then coveralls --exclude third_party --exclude gens --exclude test --exclude tools --exclude src/compiler -b. --gcov-options '\-p' ; fi notifications: email: false webhooks: @@ -5691,7 +5691,7 @@ endif GEN_HPACK_TABLES_SRC = \ - src/core/transport/chttp2/gen_hpack_tables.c \ + tools/codegen/core/gen_hpack_tables.c \ GEN_HPACK_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_HPACK_TABLES_SRC)))) ifeq ($(NO_SECURE),true) @@ -5702,14 +5702,14 @@ $(BINDIR)/$(CONFIG)/gen_hpack_tables: openssl_dep_error else -$(BINDIR)/$(CONFIG)/gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a +$(BINDIR)/$(CONFIG)/gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_hpack_tables + $(Q) $(LD) $(LDFLAGS) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_hpack_tables endif -$(OBJDIR)/$(CONFIG)/src/core/transport/chttp2/gen_hpack_tables.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a +$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_hpack_tables.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a deps_gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS:.o=.dep) ifneq ($(NO_SECURE),true) diff --git a/build.json b/build.json index e01a419bbe..4b9a26e94d 100644 --- a/build.json +++ b/build.json @@ -957,10 +957,9 @@ "build": "tool", "language": "c", "src": [ - "src/core/transport/chttp2/gen_hpack_tables.c" + "tools/codegen/core/gen_hpack_tables.c" ], "deps": [ - "grpc_test_util", "gpr", "grpc" ] diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index 33e66816f5..64fa5d6efb 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -41,6 +41,7 @@ #include <grpc++/status.h> #include <grpc++/impl/serialization_traits.h> +#include <functional> #include <memory> #include <map> diff --git a/src/core/iomgr/pollset_windows.c b/src/core/iomgr/pollset_windows.c index d0507af960..926ee8fdd9 100644 --- a/src/core/iomgr/pollset_windows.c +++ b/src/core/iomgr/pollset_windows.c @@ -39,6 +39,7 @@ #include "src/core/iomgr/alarm_internal.h" #include "src/core/iomgr/iomgr_internal.h" +#include "src/core/iomgr/pollset.h" #include "src/core/iomgr/pollset_windows.h" /* There isn't really any such thing as a pollset under Windows, due to the @@ -54,6 +55,7 @@ void grpc_pollset_init(grpc_pollset *pollset) { void grpc_pollset_shutdown(grpc_pollset *pollset, void (*shutdown_done)(void *arg), void *shutdown_done_arg) { + grpc_pollset_kick(pollset); shutdown_done(shutdown_done_arg); } @@ -68,10 +70,10 @@ int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) { if (gpr_time_cmp(now, deadline) > 0) { return 0 /* GPR_FALSE */; } - if (grpc_maybe_call_delayed_callbacks(NULL, 1 /* GPR_TRUE */)) { + if (grpc_maybe_call_delayed_callbacks(&pollset->mu, 1 /* GPR_TRUE */)) { return 1 /* GPR_TRUE */; } - if (grpc_alarm_check(NULL, now, &deadline)) { + if (grpc_alarm_check(&pollset->mu, now, &deadline)) { return 1 /* GPR_TRUE */; } gpr_cv_wait(&pollset->cv, &pollset->mu, deadline); diff --git a/src/core/support/histogram.c b/src/core/support/histogram.c index 2f1adcf511..9029703891 100644 --- a/src/core/support/histogram.c +++ b/src/core/support/histogram.c @@ -164,7 +164,9 @@ static double threshold_for_count_below(gpr_histogram *h, double count_below) { size_t lower_idx; size_t upper_idx; - GPR_ASSERT(h->count >= 1); + if (h->count == 0) { + return 0.0; + } if (count_below <= 0) { return h->min_seen; diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c index bd0fabf9da..063a23cfb1 100644 --- a/src/core/surface/completion_queue.c +++ b/src/core/surface/completion_queue.c @@ -208,6 +208,7 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc, } if (cc->shutdown) { ev = create_shutdown_event(); + grpc_pollset_kick(&cc->pollset); break; } if (!grpc_pollset_work(&cc->pollset, deadline)) { diff --git a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m index 2cbc6e0f83..0f6eece885 100644 --- a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m +++ b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m @@ -38,7 +38,7 @@ @implementation GRPCSecureChannel - (instancetype)initWithHost:(NSString *)host { - static const grpc_credentials *kCredentials; + static grpc_credentials *kCredentials; static dispatch_once_t loading; dispatch_once(&loading, ^{ // Do not use NSBundle.mainBundle, as it's nil for tests of library projects. diff --git a/test/proto/messages.proto b/test/proto/messages.proto index 65a8140465..500e79cc81 100644 --- a/test/proto/messages.proto +++ b/test/proto/messages.proto @@ -46,6 +46,14 @@ enum PayloadType { RANDOM = 2; } +// Compression algorithms +enum CompressionType { + // No compression + NONE = 0; + GZIP = 1; + DEFLATE = 2; +} + // A block of data, to simply increase gRPC message size. message Payload { // The type of data in body. @@ -54,6 +62,13 @@ message Payload { optional bytes body = 2; } +// A protobuf representation for grpc status. This is used by test +// clients to specify a status that the server should attempt to return. +message EchoStatus { + optional int32 code = 1; + optional string message = 2; +} + // Unary request. message SimpleRequest { // Desired payload type in the response from the server. @@ -72,6 +87,12 @@ message SimpleRequest { // Whether SimpleResponse should include OAuth scope. optional bool fill_oauth_scope = 5; + + // Compression algorithm to be used by the server for the response (stream) + optional CompressionType response_compression = 6; + + // Whether server should return a given status + optional EchoStatus response_status = 7; } // Unary response, as configured by the request. @@ -123,6 +144,12 @@ message StreamingOutputCallRequest { // Optional input payload sent along with the request. optional Payload payload = 3; + + // Compression algorithm to be used by the server for the response (stream) + optional CompressionType response_compression = 6; + + // Whether server should return a given status + optional EchoStatus response_status = 7; } // Server-streaming response, as configured by the request and parameters. diff --git a/test/proto/test.proto b/test/proto/test.proto index b9483d8437..1214152513 100644 --- a/test/proto/test.proto +++ b/test/proto/test.proto @@ -71,3 +71,11 @@ service TestService { rpc HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse); } + + +// A simple service NOT implemented at servers so clients can test for +// that case. +service UnimplementedService { + // A call that no server should implement + rpc UnimplementedCall(grpc.testing.Empty) returns(grpc.testing.Empty); +} diff --git a/src/core/transport/chttp2/gen_hpack_tables.c b/tools/codegen/core/gen_hpack_tables.c index bdaa3cf094..bdaa3cf094 100644 --- a/src/core/transport/chttp2/gen_hpack_tables.c +++ b/tools/codegen/core/gen_hpack_tables.c diff --git a/vsprojects/Grpc.mak b/vsprojects/Grpc.mak index 27f0b3aec3..b3be4fcf24 100644 --- a/vsprojects/Grpc.mak +++ b/vsprojects/Grpc.mak @@ -135,8 +135,8 @@ fling_server: fling_server.exe $(OUT_DIR)\fling_server.exe gen_hpack_tables.exe: build_libs $(OUT_DIR) echo Building gen_hpack_tables - $(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ $(REPO_ROOT)\src\core\transport\chttp2\gen_hpack_tables.c - $(LINK) $(LFLAGS) /OUT:"$(OUT_DIR)\gen_hpack_tables.exe" Debug\grpc_test_util.lib Debug\gpr.lib Debug\grpc.lib $(LIBS) $(OUT_DIR)\gen_hpack_tables.obj + $(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ $(REPO_ROOT)\tools\codegen\core\gen_hpack_tables.c + $(LINK) $(LFLAGS) /OUT:"$(OUT_DIR)\gen_hpack_tables.exe" Debug\gpr.lib Debug\grpc.lib $(LIBS) $(OUT_DIR)\gen_hpack_tables.obj gen_hpack_tables: gen_hpack_tables.exe echo Running gen_hpack_tables $(OUT_DIR)\gen_hpack_tables.exe |