Commit cf69f401 cf69f40194228908fa820b272578813a2c9f28dc by Alain Magloire

* mailbox/folder_imap.c (imap_quoted_string): Free the buffer.

	(imap_string): Free the buffer.
	(imap_body): Check if we already have the fheader header.
	(imap_scan): Forgot the break in the switch.

I think, I broke something in the IMAP code too .. sigh ... it
is getting to late here to figure this out.
1 parent 6f9d6633
2001-10-11 Alain Magloire
* mailbox/folder_imap.c (imap_quoted_string): Free the buffer.
(imap_string): Free the buffer.
(imap_body): Check if we already have the fheader header.
(imap_scan): Forgot the break in the switch.
2001-10-11 Alain Magloire
In order to boost performance, when doing the scan we use
the approach of downloading part of the header of the total
set of messages. The it was done before is that the headers
......
......@@ -912,6 +912,8 @@ imap_quoted_string (f_imap_t f_imap, char **ptr)
(*ptr)++;
}
f_imap->callback.total = *ptr - bquote;
if (f_imap->callback.buffer)
free (f_imap->callback.buffer);
f_imap->callback.buffer = calloc (f_imap->callback.total + 1, 1);
f_imap->callback.buflen = f_imap->callback.total;
/* Fill the call back buffer. The if is redundant there should always
......@@ -942,6 +944,8 @@ imap_string (f_imap_t f_imap, char **ptr)
{
(*ptr)++;
/* Reset the buffer to the beginning. */
if (f_imap->callback.buffer)
free (f_imap->callback.buffer);
f_imap->callback.buffer = calloc (f_imap->callback.nleft + 1, 1);
f_imap->callback.buflen = f_imap->callback.nleft;
f_imap->ptr = f_imap->buffer;
......@@ -1370,7 +1374,8 @@ imap_body (f_imap_t f_imap, char **ptr)
}
}
status = imap_string (f_imap, ptr);
if (f_imap->state == IMAP_SCAN_ACK && f_imap->callback.total)
if (f_imap->callback.msg_imap->fheader == NULL
&& f_imap->state == IMAP_SCAN_ACK && f_imap->callback.total)
{
status = header_create (&f_imap->callback.msg_imap->fheader,
f_imap->callback.buffer, f_imap->callback.total,
......
......@@ -568,6 +568,7 @@ imap_scan (mailbox_t mailbox, size_t msgno, size_t *pcount)
status = imap_parse (f_imap);
CHECK_EAGAIN (f_imap, status);
MAILBOX_DEBUG0 (mailbox, MU_DEBUG_PROT, f_imap->buffer);
break;
default:
CHECK_EAGAIN (f_imap, status);
......