binder: RPC uses non-blocking sockets.
With TLS, even though poll() may have returned for an FD,
there may not be a complete packet available, so I/O operations
within libssl may block and not interruptible by the shutdown
trigger.
Hence, always use non-blocking sockets.
Test: binderRpcTest
Bug: 195683291
Change-Id: I372e8c3bf010c672b1c4b9f7cb5b789ca20c9480
diff --git a/libs/binder/RpcTransportRaw.cpp b/libs/binder/RpcTransportRaw.cpp
index 995c542..46170f7 100644
--- a/libs/binder/RpcTransportRaw.cpp
+++ b/libs/binder/RpcTransportRaw.cpp
@@ -50,7 +50,7 @@
return ret;
}
Result<size_t> peek(void *buf, size_t size) override {
- ssize_t ret = TEMP_FAILURE_RETRY(::recv(mSocket.get(), buf, size, MSG_PEEK | MSG_DONTWAIT));
+ ssize_t ret = TEMP_FAILURE_RETRY(::recv(mSocket.get(), buf, size, MSG_PEEK));
if (ret < 0) {
return ErrnoError() << "recv(MSG_PEEK)";
}