fd = evutil_socket_(sa->sa_family,
SOCK_STREAM|EVUTIL_SOCK_NONBLOCK, 0);
if (fd < 0)
- goto freesock;
+ goto done;
ownfd = 1;
}
if (sa) {
result = 0;
goto done;
}
- } else if (r == 1) {
+ } else {
/* The connect succeeded already. How very BSD of it. */
result = 0;
bufev_p->connecting = 1;
bufferevent_trigger_nolock_(bev, EV_WRITE, BEV_OPT_DEFER_CALLBACKS);
- } else {
- /* The connect failed already. How very BSD of it. */
- result = 0;
- bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, BEV_OPT_DEFER_CALLBACKS);
- bufferevent_disable(bev, EV_WRITE|EV_READ);
}
goto done;