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