diff options
author | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2015-02-20 22:13:45 -0800 |
---|---|---|
committer | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2015-02-20 22:13:45 -0800 |
commit | 7db49ff5b4b15f660612d5bc0514093ed6d236ef (patch) | |
tree | 45085ad9ba221bf482552874bca8c5e1578de2bd /src/core/iomgr | |
parent | f4fb8e08c40a0160fbf37a8be9f232edfec0056a (diff) | |
parent | 6daab598f45202fd8abd8c36854dca411726f790 (diff) |
Merge pull request #701 from ctiller/mac3
Mac networking stack fixes
Diffstat (limited to 'src/core/iomgr')
-rw-r--r-- | src/core/iomgr/pollset_multipoller_with_poll_posix.c | 4 | ||||
-rw-r--r-- | src/core/iomgr/pollset_posix.c | 8 | ||||
-rw-r--r-- | src/core/iomgr/resolve_address.c | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/core/iomgr/pollset_multipoller_with_poll_posix.c b/src/core/iomgr/pollset_multipoller_with_poll_posix.c index fbacad1e99..7570ff18c5 100644 --- a/src/core/iomgr/pollset_multipoller_with_poll_posix.c +++ b/src/core/iomgr/pollset_multipoller_with_poll_posix.c @@ -183,10 +183,10 @@ static int multipoll_with_poll_pollset_maybe_work( grpc_pollset_kick_consume(&pollset->kick_state); } for (i = 1; i < np; i++) { - if (h->pfds[i].revents & POLLIN) { + if (h->pfds[i].revents & (POLLIN | POLLHUP | POLLERR)) { grpc_fd_become_readable(h->watchers[i].fd, allow_synchronous_callback); } - if (h->pfds[i].revents & POLLOUT) { + if (h->pfds[i].revents & (POLLOUT | POLLHUP | POLLERR)) { grpc_fd_become_writable(h->watchers[i].fd, allow_synchronous_callback); } } diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index 05b78adeb6..87e7aa85ee 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -63,9 +63,9 @@ static void backup_poller(void *p) { gpr_mu_lock(&g_backup_pollset.mu); while (g_shutdown_backup_poller == 0) { gpr_timespec next_poll = gpr_time_add(last_poll, delta); - grpc_pollset_work(&g_backup_pollset, next_poll); + grpc_pollset_work(&g_backup_pollset, gpr_time_add(gpr_now(), gpr_time_from_seconds(1))); gpr_mu_unlock(&g_backup_pollset.mu); - gpr_sleep_until(next_poll); + /*gpr_sleep_until(next_poll);*/ gpr_mu_lock(&g_backup_pollset.mu); last_poll = next_poll; } @@ -277,10 +277,10 @@ static int unary_poll_pollset_maybe_work(grpc_pollset *pollset, if (pfd[0].revents & POLLIN) { grpc_pollset_kick_consume(&pollset->kick_state); } - if (pfd[1].revents & POLLIN) { + if (pfd[1].revents & (POLLIN | POLLHUP | POLLERR)) { grpc_fd_become_readable(fd, allow_synchronous_callback); } - if (pfd[1].revents & POLLOUT) { + if (pfd[1].revents & (POLLOUT | POLLHUP | POLLERR)) { grpc_fd_become_writable(fd, allow_synchronous_callback); } } diff --git a/src/core/iomgr/resolve_address.c b/src/core/iomgr/resolve_address.c index 6d748c8698..ce9b157e31 100644 --- a/src/core/iomgr/resolve_address.c +++ b/src/core/iomgr/resolve_address.c @@ -134,7 +134,7 @@ grpc_resolved_addresses *grpc_blocking_resolve_address( un = (struct sockaddr_un *)addrs->addrs->addr; un->sun_family = AF_UNIX; strcpy(un->sun_path, name + 5); - addrs->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family); + addrs->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1; return addrs; } |