Skip to content
Snippets Groups Projects
Commit 9a7926c9 authored by Craig Tiller's avatar Craig Tiller
Browse files

Merge pull request #474 from dklempner/unary_upgrade_check

Have unary pollset check to see if the existing fd is orphaned
parents a81196c3 49959ed9
No related branches found
No related tags found
No related merge requests found
......@@ -202,8 +202,15 @@ static void unary_poll_pollset_add_fd(grpc_pollset *pollset, grpc_fd *fd) {
if (fd == pollset->data.ptr) return;
fds[0] = pollset->data.ptr;
fds[1] = fd;
grpc_platform_become_multipoller(pollset, fds, GPR_ARRAY_SIZE(fds));
grpc_fd_unref(fds[0]);
if (!grpc_fd_is_orphaned(fds[0])) {
grpc_platform_become_multipoller(pollset, fds, GPR_ARRAY_SIZE(fds));
grpc_fd_unref(fds[0]);
} else {
/* old fd is orphaned and we haven't cleaned it up until now, so remain a
* unary poller */
grpc_fd_unref(fds[0]);
pollset->data.ptr = fd;
}
}
static void unary_poll_pollset_del_fd(grpc_pollset *pollset, grpc_fd *fd) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment