diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-08-14 17:13:52 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-08-14 17:13:52 +0000 |
commit | cd3467bb01cb5bd98b2978fb50bdaa2f3227c980 (patch) | |
tree | d91d3689a009c3fa358bae94e883240e83fcb642 /src/or/connection_exit.c | |
parent | 88edae94076cc39d40a39f80b2d6ddadc88fe324 (diff) | |
download | tor-cd3467bb01cb5bd98b2978fb50bdaa2f3227c980.tar tor-cd3467bb01cb5bd98b2978fb50bdaa2f3227c980.tar.gz |
Attempt to make sockets code work right on windows.
svn:r398
Diffstat (limited to 'src/or/connection_exit.c')
-rw-r--r-- | src/or/connection_exit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/connection_exit.c b/src/or/connection_exit.c index 1daf9ad8f..148f401e9 100644 --- a/src/or/connection_exit.c +++ b/src/or/connection_exit.c @@ -90,7 +90,7 @@ int connection_exit_connect(connection_t *conn) { log_fn(LOG_DEBUG,"Connecting to %s:%u.",conn->address,conn->port); if(connect(s,(struct sockaddr *)&dest_addr,sizeof(dest_addr)) < 0) { - if(errno != EINPROGRESS){ + if(!ERRNO_CONN_EINPROGRESS(errno)) { /* yuck. kill it. */ perror("connect"); log_fn(LOG_DEBUG,"Connect failed."); @@ -102,7 +102,9 @@ int connection_exit_connect(connection_t *conn) { conn->state = EXIT_CONN_STATE_CONNECTING; log_fn(LOG_DEBUG,"connect in progress, socket %d.",s); - connection_watch_events(conn, POLLOUT | POLLIN); + connection_watch_events(conn, POLLOUT | POLLIN | POLLERR); + /* writable indicates finish, readable indicates broken link, + error indicates broken link in windowsland. */ return 0; } } |