summaryrefslogtreecommitdiff
path: root/WIN32-Code
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-10-21 07:00:14 +0000
committerNick Mathewson <nickm@torproject.org>2009-10-21 07:00:14 +0000
commitd8164d0cfc5eda8101ad08008e3f3de2032b26a9 (patch)
treeb30f33d90ebd7b76e0b8c0f9f6e4f28df9d033b1 /WIN32-Code
parentb89b58b5f4ea91792883c84e2f7b98befbc1a3a0 (diff)
downloadlibevent-d8164d0cfc5eda8101ad08008e3f3de2032b26a9.tar.gz
Fix win32 connect() event handling.
Christopher Davis reported: Connection failures aren't reported on Windows when using bufferevent_socket_connect, because Windows uses select's exceptfds to notify of failure, and libevent treats them like read events. Only the write event handler is currently used to handle connection events. We should think hard about this one, since it changes behavior from 1.4.x. Anything that worked on Mac/Unix before will work more consistently on Windows now... but this might break stuff that worked only on Windows, but nowhere else. Patch from Chris Davis. svn:r1454
Diffstat (limited to 'WIN32-Code')
-rw-r--r--WIN32-Code/win32.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/WIN32-Code/win32.c b/WIN32-Code/win32.c
index 3b0e808c..d01b9591 100644
--- a/WIN32-Code/win32.c
+++ b/WIN32-Code/win32.c
@@ -296,7 +296,7 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
}
fd_set_copy(win32op->readset_out, win32op->readset_in);
- fd_set_copy(win32op->exset_out, win32op->readset_in);
+ fd_set_copy(win32op->exset_out, win32op->writeset_in);
fd_set_copy(win32op->writeset_out, win32op->writeset_in);
fd_count =
@@ -343,7 +343,7 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
if (++i >= win32op->exset_out->fd_count)
i = 0;
s = win32op->exset_out->fd_array[i];
- evmap_io_active(base, s, EV_READ);
+ evmap_io_active(base, s, EV_WRITE);
}
}
if (win32op->writeset_out->fd_count) {