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
This commit is contained in:
Nick Mathewson 2009-11-18 21:16:53 +00:00
parent 9bf124bff6
commit cf749e227c

View File

@ -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;