# HG changeset patch # User Herman Bloggs # Date 1046197053 0 # Node ID 34878f660804109fdbc8a563de415785ba9e28bb # Parent 9f92925b65076a7d9c5e0d1c65bbeb30315575b3 [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 diff -r 9f92925b6507 -r 34878f660804 src/protocols/oscar/conn.c --- 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)))