diff options
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 1c4fb95b56..e402123dd2 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -66,7 +66,7 @@ void directory_initiate_fetch(routerinfo_t *router) { log_fn(LOG_DEBUG,"Trying to connect to %s:%u.",router->address,router->dir_port); if(connect(s,(struct sockaddr *)&router_addr,sizeof(router_addr)) < 0){ - if(errno != EINPROGRESS){ + if(!ERRNO_CONN_EINPROGRESS(errno)) { /* yuck. kill it. */ router_forget_router(conn->addr, conn->port); /* don't try him again */ connection_free(conn); @@ -81,7 +81,9 @@ void directory_initiate_fetch(routerinfo_t *router) { } log_fn(LOG_DEBUG,"connect in progress."); - connection_watch_events(conn, POLLIN | POLLOUT); /* writable indicates finish, readable indicates broken link */ + connection_watch_events(conn, POLLIN | POLLOUT | POLLERR); + /* writable indicates finish, readable indicates broken link, + error indicates broken link in windowsland. */ conn->state = DIR_CONN_STATE_CONNECTING; return; } @@ -255,7 +257,7 @@ int connection_dir_finished_flushing(connection_t *conn) { switch(conn->state) { case DIR_CONN_STATE_CONNECTING: if (getsockopt(conn->s, SOL_SOCKET, SO_ERROR, (void*)&e, &len) < 0) { /* not yet */ - if(errno != EINPROGRESS){ + if(!ERRNO_CONN_EINPROGRESS(errno)) { /* yuck. kill it. */ log_fn(LOG_DEBUG,"in-progress connect failed. Removing."); router_forget_router(conn->addr, conn->port); /* don't try him again */ |