summaryrefslogtreecommitdiffstats
path: root/mutt_socket.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2000-07-20 17:50:02 +0000
committerThomas Roessler <roessler@does-not-exist.org>2000-07-20 17:50:02 +0000
commitf47c29082322dba38c40097df0ca3a1b20766b0a (patch)
tree0f8e3ee2cab768c61953f1ef9088a925699bc88f /mutt_socket.c
parent0106e172739c9ace86500523156d70118d948422 (diff)
Another IMAP patch from Brendan.
Diffstat (limited to 'mutt_socket.c')
-rw-r--r--mutt_socket.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/mutt_socket.c b/mutt_socket.c
index 48f3a0d2..0d2d1270 100644
--- a/mutt_socket.c
+++ b/mutt_socket.c
@@ -145,19 +145,22 @@ void mutt_socket_free (CONNECTION* conn)
}
}
-CONNECTION* mutt_socket_find (const ACCOUNT* account, int newconn)
+/* mutt_conn_find: find a connection off the list of connections whose
+ * account matches account. If newconn is true, don't reuse one, but add
+ * it to the list. If start is not null, only search for connections after
+ * the given connection (allows higher level socket code to make more
+ * fine-grained searches than account info - eg in IMAP we may wish
+ * to find a connection which is not in IMAP_SELECTED state) */
+CONNECTION* mutt_conn_find (const CONNECTION* start, const ACCOUNT* account)
{
CONNECTION* conn;
- if (! newconn)
+ conn = start ? start->next : Connections;
+ while (conn)
{
- conn = Connections;
- while (conn)
- {
- if (mutt_account_match (account, &(conn->account)))
- return conn;
- conn = conn->next;
- }
+ if (mutt_account_match (account, &(conn->account)))
+ return conn;
+ conn = conn->next;
}
conn = socket_new_conn ();