summaryrefslogtreecommitdiff
path: root/buffer_iocp.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-11-04 05:19:26 +0000
committerNick Mathewson <nickm@torproject.org>2009-11-04 05:19:26 +0000
commit86db1c851be804b13aadebcc0b1a21a4493192dd (patch)
treebd6a597a4448dde5a1c2c5f953cfcb7dd0fd0a5e /buffer_iocp.c
parent6ca32df11ac92a4c3ab417d656253353e28a7dc3 (diff)
downloadlibevent-86db1c851be804b13aadebcc0b1a21a4493192dd.tar.gz
Commit ConnectEx code to get connect working with async bufferevents.
This is code by Chris Davis, with changes to get the unit tests failing less aggressively. The unit tests for this code do not completely pass yet; Chris is looking into that. If they aren't passing by the next release, I'll turn off this code. svn:r1499
Diffstat (limited to 'buffer_iocp.c')
-rw-r--r--buffer_iocp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/buffer_iocp.c b/buffer_iocp.c
index b52f84d6..cab782a3 100644
--- a/buffer_iocp.c
+++ b/buffer_iocp.c
@@ -316,3 +316,14 @@ _evbuffer_overlapped_get_fd(struct evbuffer *buf)
struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
return buf_o ? buf_o->fd : -1;
}
+
+void
+_evbuffer_overlapped_set_fd(struct evbuffer *buf, evutil_socket_t fd)
+{
+ struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
+ EVBUFFER_LOCK(buf, EVTHREAD_WRITE);
+ /* XXX is this right?, should it cancel current I/O operations? */
+ if (buf_o)
+ buf_o->fd = fd;
+ EVBUFFER_UNLOCK(buf, EVTHREAD_WRITE);
+}