If `-infile` is not readable, bail out and show an error! (#30760)

Without this, `grpc_cli` will connect, send the metadata and then completely stall until it is killed leading to believe it is the server that is stalled instead of `grpc_cli` that won't send the message.
pull/30964/head
Carlos Sobrinho 3 years ago committed by GitHub
parent a562807108
commit 63df245532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      test/cpp/util/grpc_tool.cc

@ -578,6 +578,12 @@ bool GrpcTool::CallMethod(int argc, const char** argv,
} else {
input_file.open(absl::GetFlag(FLAGS_infile),
std::ios::in | std::ios::binary);
if (!input_file) {
fprintf(stderr, "Failed to open infile %s.\n",
absl::GetFlag(FLAGS_infile).c_str());
return false;
}
input_stream = &input_file;
}

Loading…
Cancel
Save