summaryrefslogtreecommitdiff
path: root/libs/binder/RpcState.cpp
diff options
context:
space:
mode:
author Yifan Hong <elsk@google.com> 2021-08-05 17:13:55 -0700
committer Yifan Hong <elsk@google.com> 2021-08-06 10:48:34 -0700
commit8c950421dbe8d9c2cea5e293b925b01d6f8c52da (patch)
tree4875423b420b08c1b23f91f59302517bf9483537 /libs/binder/RpcState.cpp
parent832521ebc4e217586adbd8528385bf29bc16307e (diff)
binder: Refactor: move FdTrigger to its own file / class.
Also move interruptable*Fully functions to RpcTransport so that we no longer need pending() and pollSocket(). This also allows us to hide send() / recv(); callers should use interruptableWriteFully / interruptableReadFully instead, because those repsect the shutdown trigger. - Fix one place to use interruptableWriteFully() instead of send() when sending header. interruptable*Fully are marked as virtual functions because TLS will need to poll with events dynamically adjusted. See follow-up CLs for TLS implementation. Test: TH Bug: 190868302 Change-Id: I131eed3a637b3a30280b320966e466bbfac0fc45
Diffstat (limited to 'libs/binder/RpcState.cpp')
-rw-r--r--libs/binder/RpcState.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp
index 23382c3858..b58f1b38ff 100644
--- a/libs/binder/RpcState.cpp
+++ b/libs/binder/RpcState.cpp
@@ -283,8 +283,8 @@ status_t RpcState::rpcSend(const sp<RpcSession::RpcConnection>& connection,
}
if (status_t status =
- session->mShutdownTrigger->interruptableWriteFully(connection->rpcTransport.get(),
- data, size);
+ connection->rpcTransport->interruptableWriteFully(session->mShutdownTrigger.get(),
+ data, size);
status != OK) {
LOG_RPC_DETAIL("Failed to write %s (%zu bytes) on RpcTransport %p, error: %s", what, size,
connection->rpcTransport.get(), statusToString(status).c_str());
@@ -305,8 +305,8 @@ status_t RpcState::rpcRec(const sp<RpcSession::RpcConnection>& connection,
}
if (status_t status =
- session->mShutdownTrigger->interruptableReadFully(connection->rpcTransport.get(),
- data, size);
+ connection->rpcTransport->interruptableReadFully(session->mShutdownTrigger.get(),
+ data, size);
status != OK) {
LOG_RPC_DETAIL("Failed to read %s (%zu bytes) on RpcTransport %p, error: %s", what, size,
connection->rpcTransport.get(), statusToString(status).c_str());