aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-03-03 08:16:39 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-03-03 08:16:39 -0800
commit07b3d3135890fe341c477f720da051f7590fe6ef (patch)
treecd0c86e7a2db6a0987d53c2eccada61a4015a995
parent01ea61e4823d9869090e18283409ac4447988cfc (diff)
parentc09bb7e6017ce356db1552273d6c9fe70c7b57b0 (diff)
Merge github.com:grpc/grpc into credit
Conflicts: examples/pubsub/main.cc
-rw-r--r--Makefile6
-rw-r--r--build.json1
-rw-r--r--examples/pubsub/main.cc40
-rw-r--r--src/core/iomgr/pollset_posix.c2
4 files changed, 10 insertions, 39 deletions
diff --git a/Makefile b/Makefile
index 9ddd3bc6d6..30be4a0047 100644
--- a/Makefile
+++ b/Makefile
@@ -8080,16 +8080,16 @@ $(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_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(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
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LDXX) $(LDFLAGS) $(PUBSUB_CLIENT_OBJS) $(GTEST_LIB) $(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_client
+ $(Q) $(LDXX) $(LDFLAGS) $(PUBSUB_CLIENT_OBJS) $(GTEST_LIB) $(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 $(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_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(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
deps_pubsub_client: $(PUBSUB_CLIENT_OBJS:.o=.dep)
diff --git a/build.json b/build.json
index 184cf062bf..928b2d1937 100644
--- a/build.json
+++ b/build.json
@@ -1788,7 +1788,6 @@
],
"deps": [
"pubsub_client_lib",
- "grpc++_test_util",
"grpc_test_util",
"grpc++",
"grpc",
diff --git a/examples/pubsub/main.cc b/examples/pubsub/main.cc
index 066cfa1e01..ce22cfa156 100644
--- a/examples/pubsub/main.cc
+++ b/examples/pubsub/main.cc
@@ -41,6 +41,7 @@
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <gflags/gflags.h>
+#include <grpc++/channel_arguments.h>
#include <grpc++/channel_interface.h>
#include <grpc++/create_channel.h>
#include <grpc++/credentials.h>
@@ -48,17 +49,11 @@
#include "examples/pubsub/publisher.h"
#include "examples/pubsub/subscriber.h"
-#include "test/cpp/util/create_test_channel.h"
DEFINE_int32(server_port, 443, "Server port.");
DEFINE_string(server_host,
"pubsub-staging.googleapis.com", "Server host to connect to");
DEFINE_string(project_id, "", "GCE project id such as stoked-keyword-656");
-DEFINE_string(service_account_key_file, "",
- "Path to service account json key file.");
-DEFINE_string(oauth_scope,
- "https://www.googleapis.com/auth/cloud-platform",
- "Scope for OAuth tokens.");
// In some distros, gflags is in the namespace google, and in some others,
// in gflags. This hack is enabling us to find both.
@@ -75,17 +70,6 @@ const char kMessageData[] = "Test Data";
} // namespace
-grpc::string GetServiceAccountJsonKey() {
- grpc::string json_key;
- if (json_key.empty()) {
- std::ifstream json_key_file(FLAGS_service_account_key_file);
- std::stringstream key_stream;
- key_stream << json_key_file.rdbuf();
- json_key = key_stream.str();
- }
- return json_key;
-}
-
int main(int argc, char** argv) {
grpc_init();
ParseCommandLineFlags(&argc, &argv, true);
@@ -93,23 +77,12 @@ int main(int argc, char** argv) {
std::ostringstream ss;
- std::unique_ptr<grpc::Credentials> creds;
- if (FLAGS_service_account_key_file != "") {
- grpc::string json_key = GetServiceAccountJsonKey();
- creds = grpc::ServiceAccountCredentials(
- json_key, FLAGS_oauth_scope, std::chrono::hours(1));
- } else {
- creds = grpc::ComputeEngineCredentials();
- }
-
ss << FLAGS_server_host << ":" << FLAGS_server_port;
- std::shared_ptr<grpc::ChannelInterface> channel(
- grpc::CreateTestChannel(
- ss.str(),
- FLAGS_server_host,
- true, // enable SSL
- true, // use prod roots
- creds));
+
+ std::unique_ptr<grpc::Credentials> creds =
+ grpc::CredentialsFactory::GoogleDefaultCredentials();
+ std::shared_ptr<grpc::ChannelInterface> channel =
+ grpc::CreateChannel(ss.str(), creds, grpc::ChannelArguments());
grpc::examples::pubsub::Publisher publisher(channel);
grpc::examples::pubsub::Subscriber subscriber(channel);
@@ -129,6 +102,7 @@ int main(int argc, char** argv) {
subscription_name, &subscription_topic).IsOk()) {
subscriber.DeleteSubscription(subscription_name);
}
+
if (publisher.GetTopic(topic).IsOk()) publisher.DeleteTopic(topic);
grpc::Status s = publisher.CreateTopic(topic);
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c
index f0a8453fd7..0151550a81 100644
--- a/src/core/iomgr/pollset_posix.c
+++ b/src/core/iomgr/pollset_posix.c
@@ -267,7 +267,6 @@ static void unary_poll_do_promote(void *args, int success) {
* and we don't have any mechanism to unbecome multipoller. */
pollset->in_flight_cbs--;
if (pollset->shutting_down) {
- gpr_log(GPR_INFO, "Shutting down");
/* We don't care about this pollset anymore. */
if (pollset->in_flight_cbs == 0) {
do_shutdown_cb = 1;
@@ -275,7 +274,6 @@ static void unary_poll_do_promote(void *args, int success) {
} else if (grpc_fd_is_orphaned(fd)) {
/* Don't try to add it to anything, we'll drop our ref on it below */
} else if (pollset->vtable != original_vtable) {
- gpr_log(GPR_INFO, "Not original vtable");
pollset->vtable->add_fd(pollset, fd);
} else if (fd != pollset->data.ptr) {
grpc_fd *fds[2];