|
|
|
@ -42,8 +42,6 @@ |
|
|
|
|
namespace grpc_binder { |
|
|
|
|
namespace { |
|
|
|
|
|
|
|
|
|
const int32_t kWireFormatVersion = 1; |
|
|
|
|
|
|
|
|
|
absl::StatusOr<Metadata> parse_metadata(ReadableParcel* reader) { |
|
|
|
|
int num_header; |
|
|
|
|
RETURN_IF_ERROR(reader->ReadInt32(&num_header)); |
|
|
|
@ -116,8 +114,9 @@ void WireReaderImpl::SendSetupTransport(Binder* binder) { |
|
|
|
|
gpr_log(GPR_INFO, "prepare transaction = %d", |
|
|
|
|
binder->PrepareTransaction().ok()); |
|
|
|
|
WritableParcel* writable_parcel = binder->GetWritableParcel(); |
|
|
|
|
int32_t version = 77; |
|
|
|
|
gpr_log(GPR_INFO, "write int32 = %d", |
|
|
|
|
writable_parcel->WriteInt32(kWireFormatVersion).ok()); |
|
|
|
|
writable_parcel->WriteInt32(version).ok()); |
|
|
|
|
// The lifetime of the transaction receiver is the same as the wire writer's.
|
|
|
|
|
// The transaction receiver is responsible for not calling the on-transact
|
|
|
|
|
// callback when it's dead.
|
|
|
|
@ -195,15 +194,7 @@ absl::Status WireReaderImpl::ProcessTransaction(transaction_code_t code, |
|
|
|
|
|
|
|
|
|
int version; |
|
|
|
|
RETURN_IF_ERROR(parcel->ReadInt32(&version)); |
|
|
|
|
gpr_log(GPR_INFO, "The other end respond with version = %d", version); |
|
|
|
|
// We only support this single lowest possible version, so server must
|
|
|
|
|
// respond that version too.
|
|
|
|
|
if (version != kWireFormatVersion) { |
|
|
|
|
gpr_log(GPR_ERROR, |
|
|
|
|
"The other end respond with version = %d, but we requested " |
|
|
|
|
"version %d, trying to continue anyway", |
|
|
|
|
version, kWireFormatVersion); |
|
|
|
|
} |
|
|
|
|
gpr_log(GPR_INFO, "version = %d", version); |
|
|
|
|
std::unique_ptr<Binder> binder{}; |
|
|
|
|
RETURN_IF_ERROR(parcel->ReadBinder(&binder)); |
|
|
|
|
if (!binder) { |
|
|
|
|