summaryrefslogtreecommitdiff
path: root/bufferevent_sock.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-11-18 21:16:53 +0000
committerNick Mathewson <nickm@torproject.org>2009-11-18 21:16:53 +0000
commitcf749e227c9a064894502d2a04901f0a18edd96a (patch)
tree7f5565cb76a37c5b0bbfb27796f016ebfb39c5c2 /bufferevent_sock.c
parent9bf124bff6d43fd9283c3ceb9629683ed790c136 (diff)
downloadlibevent-cf749e227c9a064894502d2a04901f0a18edd96a.tar.gz
Add a temporary workaround for an ssl bug found on FreeBSD.
Basically, we only want to report the 'connected' event because of the socket connect() finishing when we have an actual socket bufferevent; on an SSL bufferevent, 'connected' means 'SSL connection finished.' This isn't FreeBSD's fault: it just has a connect() that tends to succeed pretty early. svn:r1548
Diffstat (limited to 'bufferevent_sock.c')
-rw-r--r--bufferevent_sock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bufferevent_sock.c b/bufferevent_sock.c
index 1ae367b1..44c8351c 100644
--- a/bufferevent_sock.c
+++ b/bufferevent_sock.c
@@ -374,7 +374,12 @@ bufferevent_socket_connect(struct bufferevent *bev,
} else {
/* The connect succeeded already. How odd. */
result = 0;
- _bufferevent_run_eventcb(bev, BEV_EVENT_CONNECTED);
+ /* XXXX The strcmp here is a stupid hack to prevent delivering
+ * a CONNECTED to an SSL bufferevent before its SSL is done
+ * negotiating. Really we should find some way to do this that
+ * isn't an explicit type-check. */
+ if (strcmp(bev->be_ops->type, "ssl"))
+ _bufferevent_run_eventcb(bev, BEV_EVENT_CONNECTED);
}
goto done;