Revert unnecessary changes

pull/7704/head
Yuchen Zeng 9 years ago
parent bb36cebc1d
commit 43b4bfd02b
  1. 8
      examples/cpp/helloworld/greeter_async_client.cc
  2. 2
      examples/cpp/helloworld/greeter_client.cc
  3. 4
      src/core/lib/iomgr/error.c
  4. 6
      src/core/lib/iomgr/ev_epoll_linux.c
  5. 2
      third_party/protobuf

@ -79,19 +79,17 @@ class GreeterClient {
// hold on to the "rpc" instance in order to get updates on the ongoing RPC.
std::unique_ptr<ClientAsyncResponseReader<HelloReply> > rpc(
stub_->AsyncSayHello(&context, request, &cq));
std::cout << "after AsyncSayHello\n";
// Request that, upon completion of the RPC, "reply" be updated with the
// server's response; "status" with the indication of whether the operation
// was successful. Tag the request with the integer 1.
rpc->Finish(&reply, &status, (void*)1);
std::cout << "after Finish\n";
void* got_tag;
bool ok = false;
// Block until the next result is available in the completion queue "cq".
// The return value of Next should always be checked. This return value
// tells us whether there is any kind of event or the cq_ is shutting down.
GPR_ASSERT(cq.Next(&got_tag, &ok));
std::cout << "after Next\n";
// Verify that the result from "cq" corresponds, by its tag, our previous
// request.
@ -119,8 +117,8 @@ int main(int argc, char** argv) {
// are created. This channel models a connection to an endpoint (in this case,
// localhost at port 50051). We indicate that the channel isn't authenticated
// (use of InsecureChannelCredentials()).
GreeterClient greeter(
grpc::CreateChannel("[::1]:50051", grpc::InsecureChannelCredentials()));
GreeterClient greeter(grpc::CreateChannel(
"localhost:50051", grpc::InsecureChannelCredentials()));
std::string user("world");
std::string reply = greeter.SayHello(user); // The actual RPC call!
std::cout << "Greeter received: " << reply << std::endl;

@ -88,7 +88,7 @@ int main(int argc, char** argv) {
// localhost at port 50051). We indicate that the channel isn't authenticated
// (use of InsecureChannelCredentials()).
GreeterClient greeter(grpc::CreateChannel(
"ip6-localhost:50051", grpc::InsecureChannelCredentials()));
"localhost:50051", grpc::InsecureChannelCredentials()));
std::string user("world");
std::string reply = greeter.SayHello(user);
std::cout << "Greeter received: " << reply << std::endl;

@ -174,7 +174,7 @@ static bool is_special(grpc_error *err) {
grpc_error *grpc_error_ref(grpc_error *err, const char *file, int line,
const char *func) {
if (is_special(err)) return err;
gpr_log(GPR_ERROR, "%p: %" PRIdPTR " -> %" PRIdPTR " [%s:%d %s]", err,
gpr_log(GPR_DEBUG, "%p: %" PRIdPTR " -> %" PRIdPTR " [%s:%d %s]", err,
err->refs.count, err->refs.count + 1, file, line, func);
gpr_ref(&err->refs);
return err;
@ -200,7 +200,7 @@ static void error_destroy(grpc_error *err) {
void grpc_error_unref(grpc_error *err, const char *file, int line,
const char *func) {
if (is_special(err)) return;
gpr_log(GPR_ERROR, "%p: %" PRIdPTR " -> %" PRIdPTR " [%s:%d %s]", err,
gpr_log(GPR_DEBUG, "%p: %" PRIdPTR " -> %" PRIdPTR " [%s:%d %s]", err,
err->refs.count, err->refs.count - 1, file, line, func);
if (gpr_unref(&err->refs)) {
error_destroy(err);

@ -911,8 +911,8 @@ static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
REF_BY(fd, 1, reason);
/* Remove the fd from the polling island:
- Get a lock on the latest polling island (i.e the last island in the
linked list pointed by fd->polling_island). This is the island that
- Get a lock on the latest polling island (i.e the last island in the
would actually contain the fd
- Remove the fd from the latest polling island
- Unlock the latest polling island
@ -927,8 +927,7 @@ static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
fd->polling_island = NULL;
}
grpc_exec_ctx_sched(exec_ctx, fd->on_done_closure, GRPC_ERROR_REF(error),
NULL);
grpc_exec_ctx_sched(exec_ctx, fd->on_done_closure, error, NULL);
gpr_mu_unlock(&fd->mu);
UNREF_BY(fd, 2, reason); /* Drop the reference */
@ -940,7 +939,6 @@ static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
PI_UNREF(exec_ctx, unref_pi, "fd_orphan");
}
GRPC_LOG_IF_ERROR("fd_orphan", GRPC_ERROR_REF(error));
GRPC_ERROR_UNREF(error);
}
static grpc_error *fd_shutdown_error(bool shutdown) {

@ -1 +1 @@
Subproject commit d4d13a4349e4e59d67f311185ddcc1890d956d7a
Subproject commit bdeb215cab2985195325fcd5e70c3fa751f46e0f
Loading…
Cancel
Save