Merge github.com:grpc/grpc into reject-the-stuffs

pull/3111/head
Craig Tiller 10 years ago
commit e535aacfac
  1. 223
      Makefile
  2. 73
      build.json
  3. 6
      include/grpc++/create_channel.h
  4. 2
      include/grpc++/credentials.h
  5. 2
      src/core/census/grpc_filter.c
  6. 44
      src/core/transport/chttp2/stream_lists.c
  7. 6
      src/cpp/client/create_channel.cc
  8. 3
      src/csharp/Grpc.Core/Metadata.cs
  9. 2
      test/core/iomgr/udp_server_test.c
  10. 2
      test/core/util/test_config.h
  11. 8
      test/cpp/end2end/async_end2end_test.cc
  12. 2
      test/cpp/end2end/client_crash_test.cc
  13. 9
      test/cpp/end2end/end2end_test.cc
  14. 4
      test/cpp/end2end/generic_end2end_test.cc
  15. 4
      test/cpp/end2end/mock_test.cc
  16. 4
      test/cpp/end2end/server_crash_test_client.cc
  17. 2
      test/cpp/end2end/shutdown_test.cc
  18. 4
      test/cpp/end2end/thread_stress_test.cc
  19. 2
      test/cpp/end2end/zookeeper_test.cc
  20. 8
      test/cpp/qps/driver.cc
  21. 4
      test/cpp/qps/report.h
  22. 3
      test/cpp/util/cli_call_test.cc
  23. 4
      test/cpp/util/create_test_channel.cc
  24. 2
      test/cpp/util/grpc_cli.cc
  25. 76
      tools/run_tests/sources_and_headers.json

@ -875,9 +875,6 @@ interop_client: $(BINDIR)/$(CONFIG)/interop_client
interop_server: $(BINDIR)/$(CONFIG)/interop_server
interop_test: $(BINDIR)/$(CONFIG)/interop_test
mock_test: $(BINDIR)/$(CONFIG)/mock_test
pubsub_client: $(BINDIR)/$(CONFIG)/pubsub_client
pubsub_publisher_test: $(BINDIR)/$(CONFIG)/pubsub_publisher_test
pubsub_subscriber_test: $(BINDIR)/$(CONFIG)/pubsub_subscriber_test
qps_driver: $(BINDIR)/$(CONFIG)/qps_driver
qps_interarrival_test: $(BINDIR)/$(CONFIG)/qps_interarrival_test
qps_openloop_test: $(BINDIR)/$(CONFIG)/qps_openloop_test
@ -3488,51 +3485,6 @@ $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc:
$(Q) mkdir -p $(@D)
$(Q) echo "$(GRPCXX_UNSECURE_PC_FILE)" | tr , '\n' >$@
ifeq ($(NO_PROTOC),true)
$(GENDIR)/examples/pubsub/empty.pb.cc: protoc_dep_error
$(GENDIR)/examples/pubsub/empty.grpc.pb.cc: protoc_dep_error
else
$(GENDIR)/examples/pubsub/empty.pb.cc: examples/pubsub/empty.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --cpp_out=$(GENDIR) $<
$(GENDIR)/examples/pubsub/empty.grpc.pb.cc: examples/pubsub/empty.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $<
endif
ifeq ($(NO_PROTOC),true)
$(GENDIR)/examples/pubsub/label.pb.cc: protoc_dep_error
$(GENDIR)/examples/pubsub/label.grpc.pb.cc: protoc_dep_error
else
$(GENDIR)/examples/pubsub/label.pb.cc: examples/pubsub/label.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --cpp_out=$(GENDIR) $<
$(GENDIR)/examples/pubsub/label.grpc.pb.cc: examples/pubsub/label.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $<
endif
ifeq ($(NO_PROTOC),true)
$(GENDIR)/examples/pubsub/pubsub.pb.cc: protoc_dep_error
$(GENDIR)/examples/pubsub/pubsub.grpc.pb.cc: protoc_dep_error
else
$(GENDIR)/examples/pubsub/pubsub.pb.cc: examples/pubsub/pubsub.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --cpp_out=$(GENDIR) $<
$(GENDIR)/examples/pubsub/pubsub.grpc.pb.cc: examples/pubsub/pubsub.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $<
endif
ifeq ($(NO_PROTOC),true)
$(GENDIR)/test/cpp/qps/perf_db.pb.cc: protoc_dep_error
$(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc: protoc_dep_error
@ -5205,59 +5157,6 @@ endif
$(OBJDIR)/$(CONFIG)/test/cpp/interop/server.o: $(GENDIR)/test/proto/empty.pb.cc $(GENDIR)/test/proto/empty.grpc.pb.cc $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/test.pb.cc $(GENDIR)/test/proto/test.grpc.pb.cc
LIBPUBSUB_CLIENT_LIB_SRC = \
$(GENDIR)/examples/pubsub/label.pb.cc $(GENDIR)/examples/pubsub/label.grpc.pb.cc \
$(GENDIR)/examples/pubsub/empty.pb.cc $(GENDIR)/examples/pubsub/empty.grpc.pb.cc \
$(GENDIR)/examples/pubsub/pubsub.pb.cc $(GENDIR)/examples/pubsub/pubsub.grpc.pb.cc \
examples/pubsub/publisher.cc \
examples/pubsub/subscriber.cc \
LIBPUBSUB_CLIENT_LIB_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBPUBSUB_CLIENT_LIB_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure libraries if you don't have OpenSSL.
$(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a: openssl_dep_error
else
ifeq ($(NO_PROTOBUF),true)
# You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay.
$(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a: protobuf_dep_error
else
$(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF_DEP) $(LIBPUBSUB_CLIENT_LIB_OBJS)
$(E) "[AR] Creating $@"
$(Q) mkdir -p `dirname $@`
$(Q) rm -f $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a
$(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBPUBSUB_CLIENT_LIB_OBJS)
ifeq ($(SYSTEM),Darwin)
$(Q) ranlib $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a
endif
endif
endif
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(LIBPUBSUB_CLIENT_LIB_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/examples/pubsub/publisher.o: $(GENDIR)/examples/pubsub/label.pb.cc $(GENDIR)/examples/pubsub/label.grpc.pb.cc $(GENDIR)/examples/pubsub/empty.pb.cc $(GENDIR)/examples/pubsub/empty.grpc.pb.cc $(GENDIR)/examples/pubsub/pubsub.pb.cc $(GENDIR)/examples/pubsub/pubsub.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/examples/pubsub/subscriber.o: $(GENDIR)/examples/pubsub/label.pb.cc $(GENDIR)/examples/pubsub/label.grpc.pb.cc $(GENDIR)/examples/pubsub/empty.pb.cc $(GENDIR)/examples/pubsub/empty.grpc.pb.cc $(GENDIR)/examples/pubsub/pubsub.pb.cc $(GENDIR)/examples/pubsub/pubsub.grpc.pb.cc
LIBQPS_SRC = \
$(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc \
$(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc \
@ -9752,126 +9651,6 @@ endif
endif
PUBSUB_CLIENT_SRC = \
examples/pubsub/main.cc \
PUBSUB_CLIENT_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PUBSUB_CLIENT_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/pubsub_client: 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)/pubsub_client: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/pubsub_client: $(PROTOBUF_DEP) $(PUBSUB_CLIENT_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.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 $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(PUBSUB_CLIENT_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.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 $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/pubsub_client
endif
endif
$(OBJDIR)/$(CONFIG)/examples/pubsub/main.o: $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.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 $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
deps_pubsub_client: $(PUBSUB_CLIENT_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(PUBSUB_CLIENT_OBJS:.o=.dep)
endif
endif
PUBSUB_PUBLISHER_TEST_SRC = \
examples/pubsub/publisher_test.cc \
PUBSUB_PUBLISHER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PUBSUB_PUBLISHER_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/pubsub_publisher_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)/pubsub_publisher_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/pubsub_publisher_test: $(PROTOBUF_DEP) $(PUBSUB_PUBLISHER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(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) $(PUBSUB_PUBLISHER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(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)/pubsub_publisher_test
endif
endif
$(OBJDIR)/$(CONFIG)/examples/pubsub/publisher_test.o: $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(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_pubsub_publisher_test: $(PUBSUB_PUBLISHER_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(PUBSUB_PUBLISHER_TEST_OBJS:.o=.dep)
endif
endif
PUBSUB_SUBSCRIBER_TEST_SRC = \
examples/pubsub/subscriber_test.cc \
PUBSUB_SUBSCRIBER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PUBSUB_SUBSCRIBER_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/pubsub_subscriber_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)/pubsub_subscriber_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/pubsub_subscriber_test: $(PROTOBUF_DEP) $(PUBSUB_SUBSCRIBER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(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) $(PUBSUB_SUBSCRIBER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(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)/pubsub_subscriber_test
endif
endif
$(OBJDIR)/$(CONFIG)/examples/pubsub/subscriber_test.o: $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(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_pubsub_subscriber_test: $(PUBSUB_SUBSCRIBER_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(PUBSUB_SUBSCRIBER_TEST_OBJS:.o=.dep)
endif
endif
QPS_DRIVER_SRC = \
test/cpp/qps/qps_driver.cc \
@ -20646,8 +20425,6 @@ ifneq ($(OPENSSL_DEP),)
# This is to ensure the embedded OpenSSL is built beforehand, properly
# installing headers to their final destination on the drive. We need this
# otherwise parallel compilation will fail if a source is compiled first.
examples/pubsub/publisher.cc: $(OPENSSL_DEP)
examples/pubsub/subscriber.cc: $(OPENSSL_DEP)
src/core/httpcli/httpcli_security_connector.c: $(OPENSSL_DEP)
src/core/security/base64.c: $(OPENSSL_DEP)
src/core/security/client_auth_filter.c: $(OPENSSL_DEP)

@ -813,27 +813,6 @@
"grpc++_test_config"
]
},
{
"name": "pubsub_client_lib",
"build": "do_not_build",
"language": "c++",
"headers": [
"examples/pubsub/publisher.h",
"examples/pubsub/subscriber.h"
],
"src": [
"examples/pubsub/label.proto",
"examples/pubsub/empty.proto",
"examples/pubsub/pubsub.proto",
"examples/pubsub/publisher.cc",
"examples/pubsub/subscriber.cc"
],
"deps": [
"grpc++",
"grpc",
"gpr"
]
},
{
"name": "qps",
"build": "private",
@ -2369,58 +2348,6 @@
"gpr"
]
},
{
"name": "pubsub_client",
"build": "do_not_build",
"run": false,
"language": "c++",
"src": [
"examples/pubsub/main.cc"
],
"deps": [
"pubsub_client_lib",
"grpc_test_util",
"grpc++",
"grpc",
"gpr_test_util",
"gpr",
"grpc++_test_config"
]
},
{
"name": "pubsub_publisher_test",
"build": "do_not_build",
"language": "c++",
"src": [
"examples/pubsub/publisher_test.cc"
],
"deps": [
"pubsub_client_lib",
"grpc++_test_util",
"grpc_test_util",
"grpc++",
"grpc",
"gpr_test_util",
"gpr"
]
},
{
"name": "pubsub_subscriber_test",
"build": "do_not_build",
"language": "c++",
"src": [
"examples/pubsub/subscriber_test.cc"
],
"deps": [
"pubsub_client_lib",
"grpc++_test_util",
"grpc_test_util",
"grpc++",
"grpc",
"gpr_test_util",
"gpr"
]
},
{
"name": "qps_driver",
"build": "benchmark",

@ -44,6 +44,12 @@ namespace grpc {
// If creds does not hold an object or is invalid, a lame channel is returned.
std::shared_ptr<Channel> CreateChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds);
// For advanced use and testing ONLY. Override default channel arguments only
// if necessary.
// If creds does not hold an object or is invalid, a lame channel is returned.
std::shared_ptr<Channel> CreateCustomChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds,
const ChannelArguments& args);

@ -57,7 +57,7 @@ class Credentials : public GrpcLibrary {
virtual SecureCredentials* AsSecureCredentials() = 0;
private:
friend std::shared_ptr<Channel> CreateChannel(
friend std::shared_ptr<Channel> CreateCustomChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds,
const ChannelArguments& args);

@ -36,12 +36,12 @@
#include <stdio.h>
#include <string.h>
#include "include/grpc/census.h"
#include "src/core/census/rpc_stat_id.h"
#include "src/core/channel/channel_stack.h"
#include "src/core/channel/noop_filter.h"
#include "src/core/statistics/census_interface.h"
#include "src/core/statistics/census_rpc_stats.h"
#include <grpc/census.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/slice.h>

@ -177,8 +177,10 @@ int grpc_chttp2_list_pop_writable_stream(
grpc_chttp2_stream *stream;
int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
GRPC_CHTTP2_LIST_WRITABLE);
*stream_global = &stream->global;
*stream_writing = &stream->writing;
if (r != 0) {
*stream_global = &stream->global;
*stream_writing = &stream->writing;
}
return r;
}
@ -210,7 +212,9 @@ int grpc_chttp2_list_pop_writing_stream(
grpc_chttp2_stream *stream;
int r = stream_list_pop(TRANSPORT_FROM_WRITING(transport_writing), &stream,
GRPC_CHTTP2_LIST_WRITING);
*stream_writing = &stream->writing;
if (r != 0) {
*stream_writing = &stream->writing;
}
return r;
}
@ -230,8 +234,10 @@ int grpc_chttp2_list_pop_written_stream(
grpc_chttp2_stream *stream;
int r = stream_list_pop(TRANSPORT_FROM_WRITING(transport_writing), &stream,
GRPC_CHTTP2_LIST_WRITTEN);
*stream_global = &stream->global;
*stream_writing = &stream->writing;
if (r != 0) {
*stream_global = &stream->global;
*stream_writing = &stream->writing;
}
return r;
}
@ -251,8 +257,10 @@ int grpc_chttp2_list_pop_parsing_seen_stream(
grpc_chttp2_stream *stream;
int r = stream_list_pop(TRANSPORT_FROM_PARSING(transport_parsing), &stream,
GRPC_CHTTP2_LIST_PARSING_SEEN);
*stream_global = &stream->global;
*stream_parsing = &stream->parsing;
if (r != 0) {
*stream_global = &stream->global;
*stream_parsing = &stream->parsing;
}
return r;
}
@ -270,7 +278,9 @@ int grpc_chttp2_list_pop_waiting_for_concurrency(
grpc_chttp2_stream *stream;
int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY);
*stream_global = &stream->global;
if (r != 0) {
*stream_global = &stream->global;
}
return r;
}
@ -288,7 +298,9 @@ int grpc_chttp2_list_pop_closed_waiting_for_parsing(
grpc_chttp2_stream *stream;
int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
GRPC_CHTTP2_LIST_CLOSED_WAITING_FOR_PARSING);
*stream_global = &stream->global;
if (r != 0) {
*stream_global = &stream->global;
}
return r;
}
@ -306,7 +318,9 @@ int grpc_chttp2_list_pop_cancelled_waiting_for_writing(
grpc_chttp2_stream *stream;
int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
GRPC_CHTTP2_LIST_CANCELLED_WAITING_FOR_WRITING);
*stream_global = &stream->global;
if (r != 0) {
*stream_global = &stream->global;
}
return r;
}
@ -326,8 +340,10 @@ int grpc_chttp2_list_pop_incoming_window_updated(
grpc_chttp2_stream *stream;
int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
GRPC_CHTTP2_LIST_INCOMING_WINDOW_UPDATED);
*stream_global = &stream->global;
*stream_parsing = &stream->parsing;
if (r != 0) {
*stream_global = &stream->global;
*stream_parsing = &stream->parsing;
}
return r;
}
@ -353,7 +369,9 @@ int grpc_chttp2_list_pop_read_write_state_changed(
grpc_chttp2_stream *stream;
int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
GRPC_CHTTP2_LIST_READ_WRITE_STATE_CHANGED);
*stream_global = &stream->global;
if (r != 0) {
*stream_global = &stream->global;
}
return r;
}

@ -44,6 +44,11 @@ namespace grpc {
class ChannelArguments;
std::shared_ptr<Channel> CreateChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds) {
return CreateCustomChannel(target, creds, ChannelArguments());
}
std::shared_ptr<Channel> CreateCustomChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds,
const ChannelArguments& args) {
ChannelArguments cp_args = args;
@ -57,4 +62,5 @@ std::shared_ptr<Channel> CreateChannel(
NULL, GRPC_STATUS_INVALID_ARGUMENT,
"Invalid credentials."));
}
} // namespace grpc

@ -33,6 +33,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
@ -320,7 +321,7 @@ namespace Grpc.Core
private static string NormalizeKey(string key)
{
return Preconditions.CheckNotNull(key, "key").ToLower();
return Preconditions.CheckNotNull(key, "key").ToLower(CultureInfo.InvariantCulture);
}
}
}

@ -135,7 +135,7 @@ static void test_receive(int number_of_clients) {
gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
for (i = 0; i < number_of_clients; i++) {
deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(4000);
deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10);
number_of_reads_before = g_number_of_reads;
/* Create a socket, send a packet to the UDP server. */

@ -56,7 +56,7 @@ extern double g_fixture_slowdown_factor;
#define GRPC_TIMEOUT_SECONDS_TO_DEADLINE(x) \
gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), \
gpr_time_from_micros(GRPC_TEST_SLOWDOWN_FACTOR * 1e6 * (x), \
gpr_time_from_millis(GRPC_TEST_SLOWDOWN_FACTOR * 1e3 * (x), \
GPR_TIMESPAN))
#define GRPC_TIMEOUT_MILLIS_TO_DEADLINE(x) \

@ -200,8 +200,8 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<bool> {
}
void ResetStub() {
std::shared_ptr<Channel> channel = CreateChannel(
server_address_.str(), InsecureCredentials(), ChannelArguments());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel));
}
@ -750,8 +750,8 @@ TEST_P(AsyncEnd2endTest, ServerCheckDone) {
}
TEST_P(AsyncEnd2endTest, UnimplementedRpc) {
std::shared_ptr<Channel> channel = CreateChannel(
server_address_.str(), InsecureCredentials(), ChannelArguments());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), InsecureCredentials());
std::unique_ptr<grpc::cpp::test::util::UnimplementedService::Stub> stub;
stub =
std::move(grpc::cpp::test::util::UnimplementedService::NewStub(channel));

@ -76,7 +76,7 @@ class CrashTest : public ::testing::Test {
}));
GPR_ASSERT(server_);
return grpc::cpp::test::util::TestService::NewStub(
CreateChannel(addr, InsecureCredentials(), ChannelArguments()));
CreateChannel(addr, InsecureCredentials()));
}
void KillServer() { server_.reset(); }

@ -291,8 +291,8 @@ class End2endTest : public ::testing::TestWithParam<bool> {
ChannelArguments args;
args.SetSslTargetNameOverride("foo.test.google.fr");
args.SetString(GRPC_ARG_SECONDARY_USER_AGENT_STRING, "end2end_test");
channel_ =
CreateChannel(server_address_.str(), SslCredentials(ssl_opts), args);
channel_ = CreateCustomChannel(server_address_.str(),
SslCredentials(ssl_opts), args);
}
void ResetStub(bool use_proxy) {
@ -307,8 +307,7 @@ class End2endTest : public ::testing::TestWithParam<bool> {
builder.RegisterService(proxy_service_.get());
proxy_server_ = builder.BuildAndStart();
channel_ = CreateChannel(proxyaddr.str(), InsecureCredentials(),
ChannelArguments());
channel_ = CreateChannel(proxyaddr.str(), InsecureCredentials());
}
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel_));
@ -566,7 +565,7 @@ TEST_F(End2endTest, BadCredentials) {
std::shared_ptr<Credentials> bad_creds = ServiceAccountCredentials("", "", 1);
EXPECT_EQ(static_cast<Credentials*>(nullptr), bad_creds.get());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), bad_creds, ChannelArguments());
CreateChannel(server_address_.str(), bad_creds);
std::unique_ptr<grpc::cpp::test::util::TestService::Stub> stub(
grpc::cpp::test::util::TestService::NewStub(channel));
EchoRequest request;

@ -121,8 +121,8 @@ class GenericEnd2endTest : public ::testing::Test {
}
void ResetStub() {
std::shared_ptr<Channel> channel = CreateChannel(
server_address_.str(), InsecureCredentials(), ChannelArguments());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), InsecureCredentials());
generic_stub_.reset(new GenericStub(channel));
}

@ -245,8 +245,8 @@ class MockTest : public ::testing::Test {
void TearDown() GRPC_OVERRIDE { server_->Shutdown(); }
void ResetStub() {
std::shared_ptr<Channel> channel = CreateChannel(
server_address_.str(), InsecureCredentials(), ChannelArguments());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel));
}

@ -58,8 +58,8 @@ using namespace gflags;
int main(int argc, char** argv) {
ParseCommandLineFlags(&argc, &argv, true);
auto stub = grpc::cpp::test::util::TestService::NewStub(grpc::CreateChannel(
FLAGS_address, grpc::InsecureCredentials(), grpc::ChannelArguments()));
auto stub = grpc::cpp::test::util::TestService::NewStub(
grpc::CreateChannel(FLAGS_address, grpc::InsecureCredentials()));
EchoRequest request;
EchoResponse response;

@ -95,7 +95,7 @@ class ShutdownTest : public ::testing::Test {
void ResetStub() {
string target = "dns:localhost:" + to_string(port_);
channel_ = CreateChannel(target, InsecureCredentials(), ChannelArguments());
channel_ = CreateChannel(target, InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel_));
}

@ -191,8 +191,8 @@ class End2endTest : public ::testing::Test {
void TearDown() GRPC_OVERRIDE { server_->Shutdown(); }
void ResetStub() {
std::shared_ptr<Channel> channel = CreateChannel(
server_address_.str(), InsecureCredentials(), ChannelArguments());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel));
}

@ -159,7 +159,7 @@ class ZookeeperTest : public ::testing::Test {
void ResetStub() {
string target = "zookeeper://" + zookeeper_address_ + "/test";
channel_ = CreateChannel(target, InsecureCredentials(), ChannelArguments());
channel_ = CreateChannel(target, InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel_));
}

@ -154,8 +154,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
// where class contained in std::vector must have a copy constructor
auto* servers = new ServerData[num_servers];
for (size_t i = 0; i < num_servers; i++) {
servers[i].stub = std::move(Worker::NewStub(
CreateChannel(workers[i], InsecureCredentials(), ChannelArguments())));
servers[i].stub = std::move(
Worker::NewStub(CreateChannel(workers[i], InsecureCredentials())));
ServerArgs args;
result_server_config = server_config;
result_server_config.set_host(workers[i]);
@ -182,8 +182,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
// where class contained in std::vector must have a copy constructor
auto* clients = new ClientData[num_clients];
for (size_t i = 0; i < num_clients; i++) {
clients[i].stub = std::move(Worker::NewStub(CreateChannel(
workers[i + num_servers], InsecureCredentials(), ChannelArguments())));
clients[i].stub = std::move(Worker::NewStub(
CreateChannel(workers[i + num_servers], InsecureCredentials())));
ClientArgs args;
result_client_config = client_config;
result_client_config.set_host(workers[i + num_servers]);

@ -116,8 +116,8 @@ class PerfDbReporter : public Reporter {
test_name_(test_name),
sys_info_(sys_info),
tag_(tag) {
perf_db_client_.init(grpc::CreateChannel(
server_address, grpc::InsecureCredentials(), ChannelArguments()));
perf_db_client_.init(
grpc::CreateChannel(server_address, grpc::InsecureCredentials()));
}
~PerfDbReporter() GRPC_OVERRIDE { SendData(); };

@ -91,8 +91,7 @@ class CliCallTest : public ::testing::Test {
void TearDown() GRPC_OVERRIDE { server_->Shutdown(); }
void ResetStub() {
channel_ = CreateChannel(server_address_.str(), InsecureCredentials(),
ChannelArguments());
channel_ = CreateChannel(server_address_.str(), InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel_));
}

@ -74,9 +74,9 @@ std::shared_ptr<Channel> CreateTestChannel(
if (creds.get()) {
channel_creds = CompositeCredentials(creds, channel_creds);
}
return CreateChannel(connect_to, channel_creds, channel_args);
return CreateCustomChannel(connect_to, channel_creds, channel_args);
} else {
return CreateChannel(server, InsecureCredentials(), channel_args);
return CreateChannel(server, InsecureCredentials());
}
}

@ -159,7 +159,7 @@ int main(int argc, char** argv) {
}
}
std::shared_ptr<grpc::Channel> channel =
grpc::CreateChannel(server_address, creds, grpc::ChannelArguments());
grpc::CreateChannel(server_address, creds);
grpc::string response;
std::multimap<grpc::string, grpc::string> client_metadata;

@ -1388,57 +1388,6 @@
"test/cpp/end2end/mock_test.cc"
]
},
{
"deps": [
"gpr",
"gpr_test_util",
"grpc",
"grpc++",
"grpc++_test_config",
"grpc_test_util",
"pubsub_client_lib"
],
"headers": [],
"language": "c++",
"name": "pubsub_client",
"src": [
"examples/pubsub/main.cc"
]
},
{
"deps": [
"gpr",
"gpr_test_util",
"grpc",
"grpc++",
"grpc++_test_util",
"grpc_test_util",
"pubsub_client_lib"
],
"headers": [],
"language": "c++",
"name": "pubsub_publisher_test",
"src": [
"examples/pubsub/publisher_test.cc"
]
},
{
"deps": [
"gpr",
"gpr_test_util",
"grpc",
"grpc++",
"grpc++_test_util",
"grpc_test_util",
"pubsub_client_lib"
],
"headers": [],
"language": "c++",
"name": "pubsub_subscriber_test",
"src": [
"examples/pubsub/subscriber_test.cc"
]
},
{
"deps": [
"gpr",
@ -13570,31 +13519,6 @@
"test/cpp/interop/server.cc"
]
},
{
"deps": [
"gpr",
"grpc",
"grpc++"
],
"headers": [
"examples/pubsub/empty.grpc.pb.h",
"examples/pubsub/empty.pb.h",
"examples/pubsub/label.grpc.pb.h",
"examples/pubsub/label.pb.h",
"examples/pubsub/publisher.h",
"examples/pubsub/pubsub.grpc.pb.h",
"examples/pubsub/pubsub.pb.h",
"examples/pubsub/subscriber.h"
],
"language": "c++",
"name": "pubsub_client_lib",
"src": [
"examples/pubsub/publisher.cc",
"examples/pubsub/publisher.h",
"examples/pubsub/subscriber.cc",
"examples/pubsub/subscriber.h"
]
},
{
"deps": [
"grpc++",

Loading…
Cancel
Save