Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 29, 2023
1 parent 82c3207 commit 873e514
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions cpp/src/arrow/flight/transport/grpc/grpc_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -749,13 +749,7 @@ class GrpcClientImpl : public internal::ClientTransport {
// reader finishes, so it's OK to assume the client no longer
// wants to read and drain the read side.
pb::HandshakeResponse response;
if (!stream->Read(&response)) {
return MakeFlightError(FlightStatusCode::Internal,
"No handshake response from server");
}
if (stream->Read(&response)) {
return MakeFlightError(FlightStatusCode::Internal,
"Too much handshake response from server");
while (stream->Read(&response)) {
}
RETURN_NOT_OK(FromGrpcStatus(stream->Finish(), &rpc.context));
return Status::OK();
Expand All @@ -781,13 +775,7 @@ class GrpcClientImpl : public internal::ClientTransport {
// reader finishes, so it's OK to assume the client no longer
// wants to read and drain the read side.
pb::HandshakeResponse response;
if (!stream->Read(&response)) {
return MakeFlightError(FlightStatusCode::Internal,
"No handshake response from server");
}
if (stream->Read(&response)) {
return MakeFlightError(FlightStatusCode::Internal,
"Too much handshake response from server");
while (stream->Read(&response)) {
}
RETURN_NOT_OK(FromGrpcStatus(stream->Finish(), &rpc.context));
// Grab bearer token from incoming headers.
Expand Down

0 comments on commit 873e514

Please sign in to comment.