drop account-hooks for now.
[apps/madmutt.git] / lib-sys / mutt_socket.c
index 194ad5a..f71b789 100644 (file)
@@ -156,7 +156,7 @@ int mutt_socket_readln2(buffer_t *buf, CONNECTION *conn)
 
     while (mutt_socket_readchar(conn, &ch) == 1) {
         if (ch == '\n') {
-            if (buf->data[buf->len - 1] == '\r') {
+            if (buf->len && buf->data[buf->len - 1] == '\r') {
                 buf->data[--buf->len] = '\0';
             }
             return 0;
@@ -206,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) {
@@ -230,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;