mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 12:28:19 -04:00
Small cleanups on freebsd-connect-refused patch.
There should be no need to call be_socket_enable: that does an event_add(). What we really want to do is event_active(), to make sure that the writecb is executed. Also, there was one "} if () {" that was missing an else. I've noted that the return value for evutil_socket_connect() is getting screwy, but since that isn't an exported function, we can fix it whenever.
This commit is contained in:
parent
7bc48bfd3a
commit
57b7248823
@ -401,19 +401,17 @@ bufferevent_socket_connect(struct bufferevent *bev,
|
||||
result = 0;
|
||||
goto done;
|
||||
}
|
||||
} if (r == 1) {
|
||||
} else if (r == 1) {
|
||||
/* The connect succeeded already. How very BSD of it. */
|
||||
result = 0;
|
||||
bufev_p->connecting = 1;
|
||||
event_active(&bev->ev_write, EV_WRITE, 1);
|
||||
} else {
|
||||
/* The connect failed already. How very BSD of it. */
|
||||
if (! be_socket_enable(bev, EV_WRITE)) {
|
||||
bufev_p->connection_refused = 1;
|
||||
bufev_p->connecting = 1;
|
||||
result = 0;
|
||||
goto done;
|
||||
}
|
||||
bufev_p->connection_refused = 1;
|
||||
bufev_p->connecting = 1;
|
||||
result = 0;
|
||||
event_active(&bev->ev_write, EV_WRITE, 1);
|
||||
}
|
||||
|
||||
goto done;
|
||||
|
Loading…
x
Reference in New Issue
Block a user