X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-sys%2Fmutt_socket.c;h=f71b789242cc56345fb59dd6391ef45cd3ccf49a;hp=3528db4f5061531a18b564be10b8e02a2b34a4df;hb=67a8959a1236700a0179c0b09c3d78a4dd02be84;hpb=7110db82d9748096f6f2dfd5034e489622bd3887;ds=sidebyside diff --git a/lib-sys/mutt_socket.c b/lib-sys/mutt_socket.c index 3528db4..f71b789 100644 --- a/lib-sys/mutt_socket.c +++ b/lib-sys/mutt_socket.c @@ -150,6 +150,23 @@ int mutt_socket_readln(char *buf, ssize_t buflen, CONNECTION * conn) return i + 1; } +int mutt_socket_readln2(buffer_t *buf, CONNECTION *conn) +{ + char ch; + + while (mutt_socket_readchar(conn, &ch) == 1) { + if (ch == '\n') { + if (buf->len && buf->data[buf->len - 1] == '\r') { + buf->data[--buf->len] = '\0'; + } + return 0; + } + buffer_addch(buf, ch); + } + + return -1; +} + CONNECTION *mutt_socket_head (void) { return Connections; @@ -189,14 +206,6 @@ void mutt_socket_free (CONNECTION * conn) CONNECTION *mutt_conn_find (const CONNECTION * start, const ACCOUNT * account) { CONNECTION *conn; - ciss_url_t url; - char hook[LONG_STRING]; - - /* account isn't actually modified, since url isn't either */ - mutt_account_tourl ((ACCOUNT *) account, &url); - url.path = NULL; - url_ciss_tostring (&url, hook, sizeof (hook), 0); - mutt_account_hook (hook); conn = start ? start->next : Connections; while (conn) { @@ -213,7 +222,7 @@ CONNECTION *mutt_conn_find (const CONNECTION * start, const ACCOUNT * account) if (Tunnel && *Tunnel) mutt_tunnel_socket_setup (conn); - else if (account->flags & M_ACCT_SSL) { + else if (account->has_ssl) { if (mutt_ssl_socket_setup (conn) < 0) { mutt_socket_free (conn); return NULL;