Mercurial > pidgin.yaz
changeset 4615:34878f660804
[gaim-migrate @ 4904]
Fixed aim_conn_completeconnect. There was no need to select on the connection fd, since proxy_connect does that. On windows, we would sometimes enter an infinite loop when select was returning 0 as a result.
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Tue, 25 Feb 2003 18:17:33 +0000 |
parents | 9f92925b6507 |
children | 767093a2ddaf |
files | src/protocols/oscar/conn.c |
diffstat | 1 files changed, 0 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/oscar/conn.c Tue Feb 25 17:25:12 2003 +0000 +++ b/src/protocols/oscar/conn.c Tue Feb 25 18:17:33 2003 +0000 @@ -993,11 +993,6 @@ */ faim_export int aim_conn_completeconnect(aim_session_t *sess, aim_conn_t *conn) { - fd_set fds, wfds; - struct timeval tv; - int res; - int error = ETIMEDOUT; - aim_rxcallback_t userfunc; if (!conn || (conn->fd == -1)) @@ -1006,36 +1001,6 @@ if (!(conn->status & AIM_CONN_STATUS_INPROGRESS)) return -1; - FD_ZERO(&fds); - FD_SET(conn->fd, &fds); - FD_ZERO(&wfds); - FD_SET(conn->fd, &wfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - if ((res = select(conn->fd+1, &fds, &wfds, NULL, &tv)) == -1) { - error = errno; - aim_conn_close(conn); - errno = error; - return -1; - } else if (res == 0) { - faimdprintf(sess, 0, "aim_conn_completeconnect: false alarm on %d\n", conn->fd); - return 0; /* hasn't really completed yet... */ - } - - if (FD_ISSET(conn->fd, &fds) || FD_ISSET(conn->fd, &wfds)) { - int len = sizeof(error); - if (getsockopt(conn->fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) - error = errno; - } - - if (error) { - aim_conn_close(conn); - errno = error; - return -1; - } - fcntl(conn->fd, F_SETFL, 0); /* XXX should restore original flags */ - conn->status &= ~AIM_CONN_STATUS_INPROGRESS; if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNCOMPLETE)))