fix Invoke to accommodate the change

This commit is contained in:
iamqizhao
2016-07-15 16:02:21 -07:00
parent 0bfa80150a
commit 07bf108290

View File

@ -90,7 +90,10 @@ func sendRequest(ctx context.Context, codec Codec, compressor Compressor, callHd
return nil, transport.StreamErrorf(codes.Internal, "grpc: %v", err)
}
err = t.Write(stream, outBuf, opts)
if err != nil {
// NewStream could lead to an early rejection of the RPC (e.g., the service/method
// does not exist.) so that t.Write could get io.EOF from wait(...). Leave the following
// recvResponse to get the final status.
if err != nil || err != io.EOF {
return nil, err
}
// Sent successfully.