Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

unix: call pipe handle connection cb on accept() error

  • Loading branch information...
bnoordhuis committed Apr 21, 2012
1 parent a55a336 commit 1fa1c5106a39532180d6c0326bea622654bd6698
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/unix/pipe.c
@@ -244,16 +244,15 @@ void uv__pipe_accept(EV_P_ ev_io* watcher, int revents) {

sockfd = uv__accept(pipe->fd, (struct sockaddr *)&saddr, sizeof saddr);
if (sockfd == -1) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
assert(0 && "EAGAIN on uv__accept(pipefd)");
} else {
if (errno != EAGAIN && errno != EWOULDBLOCK) {
uv__set_sys_error(pipe->loop, errno);
pipe->connection_cb((uv_stream_t*)pipe, -1);
}
} else {
pipe->accepted_fd = sockfd;
pipe->connection_cb((uv_stream_t*)pipe, 0);
if (pipe->accepted_fd == sockfd) {
/* The user hasn't yet accepted called uv_accept() */
/* The user hasn't called uv_accept() yet */
ev_io_stop(pipe->loop->ev, &pipe->read_watcher);
}
}

0 comments on commit 1fa1c51

Please sign in to comment.
You can’t perform that action at this time.