Commit 120e8c4d 120e8c4ddf3564f48b078146d38fc6ac7dd9955f by Alain Magloire

* mailbox/body.c: Remove unneeded prototype.

	* mailbox/mbx_imap.c (mailbox_imap_close): Clear the callback
	string structure.
	(imap_scan0): Clear the callback string structure.
	(imap_append_message): Remove unused variable.
1 parent cf846e41
......@@ -38,7 +38,6 @@ static int _body_read __P ((stream_t, char *, size_t, off_t, size_t *));
static int _body_readline __P ((stream_t, char *, size_t, off_t, size_t *));
static int _body_truncate __P ((stream_t, off_t));
static int _body_size __P ((stream_t, off_t *));
static int _body_lines __P ((stream_t, size_t *));
static int _body_write __P ((stream_t, const char *, size_t, off_t, size_t *));
static int _body_get_size __P ((body_t, size_t *));
static int _body_get_lines __P ((body_t, size_t *));
......
......@@ -312,6 +312,12 @@ mailbox_imap_close (mailbox_t mailbox)
m_imap->messages_count = 0;
m_imap->recent = 0;
m_imap->unseen = 0;
/* Clear the callback string structure. */
stream_truncate (f_imap->string.stream, 0);
f_imap->string.offset = 0;
f_imap->string.nleft = 0;
f_imap->string.type = IMAP_NO_STATE;
f_imap->string.msg_imap = NULL;
monitor_unlock (mailbox->monitor);
}
break;
......@@ -640,11 +646,23 @@ imap_scan0 (mailbox_t mailbox, size_t msgno, size_t *pcount, int notif)
status = imap_send (f_imap);
CHECK_EAGAIN (f_imap, status);
f_imap->state = IMAP_SCAN_ACK;
/* Clear the callback string structure. */
stream_truncate (f_imap->string.stream, 0);
f_imap->string.offset = 0;
f_imap->string.nleft = 0;
f_imap->string.type = IMAP_NO_STATE;
f_imap->string.msg_imap = NULL;
case IMAP_SCAN_ACK:
status = imap_parse (f_imap);
CHECK_EAGAIN (f_imap, status);
MAILBOX_DEBUG0 (mailbox, MU_DEBUG_PROT, f_imap->buffer);
/* Clear the callback string structure. */
stream_truncate (f_imap->string.stream, 0);
f_imap->string.offset = 0;
f_imap->string.nleft = 0;
f_imap->string.type = IMAP_NO_STATE;
f_imap->string.msg_imap = NULL;
break;
default:
......