diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2000-08-03 08:00:44 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2000-08-03 08:00:44 +0000 |
commit | dce9662ac803b3c600abda1d65adf02a720737c5 (patch) | |
tree | 3ba9bd3d3958e566daa63329488f67d6a0e30f8a /imap | |
parent | b754aa997e2ff164c66429531b63a544731021ad (diff) |
More IMAP fixes from Brendan.
Diffstat (limited to 'imap')
-rw-r--r-- | imap/BUGS | 8 | ||||
-rw-r--r-- | imap/auth_sasl.c | 33 | ||||
-rw-r--r-- | imap/imap.c | 3 | ||||
-rw-r--r-- | imap/imap_ssl.c | 1 |
4 files changed, 26 insertions, 19 deletions
@@ -19,12 +19,6 @@ In no particular order: Tommi Komulainen's keepalive patch for edit sessions may work for you, though. Committed to CVS late November 1999, I think. -* Sometimes hdr->env seems to be NULL, according to other users' core - files. I haven't been able to reproduce this, and am not sure how - to track it down. But it's very naughty indeed. It appears to be the - result of spurious mx_close_mailbox calls handling the untagged - BYE response. - * Mutt is uninterruptible during socket calls. We should handle SIGINT. * Server copy currently doesn't take into account uncommitted changes in @@ -37,4 +31,4 @@ In no particular order: * The mutt_pretty routines don't work well when the delimiter isn't '/'. Brendan Cully <brendan@kublai.com> -Updated 20000719 +Updated 20000731 diff --git a/imap/auth_sasl.c b/imap/auth_sasl.c index 215c128b..8b78151c 100644 --- a/imap/auth_sasl.c +++ b/imap/auth_sasl.c @@ -70,7 +70,7 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata) rc = sasl_client_start (saslconn, idata->capstr, NULL, NULL, &pc, &olen, &mech); - client_start = (pc != NULL); + client_start = (olen > 0); if (rc != SASL_OK && rc != SASL_CONTINUE) { @@ -92,30 +92,43 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata) goto bail; if (!mutt_strncmp (buf, "+ ", 2)) + { if (sasl_decode64 (buf+2, strlen (buf+2), buf, &len) != SASL_OK) { dprint (1, (debugfile, "imap_auth_sasl: error base64-decoding server response.\n")); goto bail; } + } + else if ((buf[0] == '*')) + { + if (imap_handle_untagged (idata, buf)) + goto bail; + else continue; + } if (!client_start) rc = sasl_client_step (saslconn, buf, len, NULL, &pc, &olen); - client_start = 0; + else + client_start = 0; - if (olen) + /* send out response, or line break if none needed */ + if (olen && sasl_encode64 (pc, olen, buf, sizeof (buf), &olen) != SASL_OK) + { + dprint (1, (debugfile, "imap_auth_sasl: error base64-encoding client response.\n")); + goto bail; + } + + if (olen || rc == SASL_CONTINUE) { - /* send out response, or line break if none needed */ - if (sasl_encode64 (pc, olen, buf, sizeof (buf), &olen) != SASL_OK) - { - dprint (1, (debugfile, "imap_auth_sasl: error base64-encoding client response.\n")); - goto bail; - } - strfcpy (buf + olen, "\r\n", sizeof (buf) - olen); mutt_socket_write (idata->conn, buf); } } + while (mutt_strncmp (buf, idata->seq, SEQLEN)) + if (mutt_socket_readln (buf, sizeof (buf), idata->conn) < 0) + goto bail; + if (rc != SASL_OK) goto bail; diff --git a/imap/imap.c b/imap/imap.c index 991e300c..ca66b2f4 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -168,6 +168,7 @@ int imap_read_literal (FILE* fp, IMAP_DATA* idata, long bytes) return -1; } +#if 1 if (r == 1 && c != '\n') fputc ('\r', fp); @@ -178,7 +179,7 @@ int imap_read_literal (FILE* fp, IMAP_DATA* idata, long bytes) } else r = 0; - +#endif fputc (c, fp); #ifdef DEBUG if (debuglevel >= IMAP_LOG_LTRL) diff --git a/imap/imap_ssl.c b/imap/imap_ssl.c index 1a97499e..c1643986 100644 --- a/imap/imap_ssl.c +++ b/imap/imap_ssl.c @@ -190,7 +190,6 @@ int ssl_socket_read (CONNECTION * conn) int ssl_socket_write (CONNECTION * conn, const char *buf) { sslsockdata *data = conn->sockdata; - dprint (1, (debugfile, "ssl_socket_write():%s", buf)); return SSL_write (data->ssl, buf, mutt_strlen (buf)); } |