imap4d: don't issue spurious unsolicited responses after EXPUNGE.
* imap4d/expunge.c (imap4d_expunge): Clear attribute table before resynching. * imap4d/imap4d.h (imap4d_sync_invalidate): New extern. * imap4d/sync.c (invalidate_attr_table): Rename to imap4d_sync_invalidate; make extern. All callers updated.
Showing
3 changed files
with
6 additions
and
4 deletions
... | @@ -39,6 +39,7 @@ imap4d_expunge (struct imap4d_command *command, imap4d_tokbuf_t tok) | ... | @@ -39,6 +39,7 @@ imap4d_expunge (struct imap4d_command *command, imap4d_tokbuf_t tok) |
39 | /* FIXME: check for errors. */ | 39 | /* FIXME: check for errors. */ |
40 | mu_mailbox_expunge (mbox); | 40 | mu_mailbox_expunge (mbox); |
41 | 41 | ||
42 | imap4d_sync_invalidate (); | ||
42 | imap4d_sync (); | 43 | imap4d_sync (); |
43 | return io_completion_response (command, RESP_OK, "Completed"); | 44 | return io_completion_response (command, RESP_OK, "Completed"); |
44 | } | 45 | } | ... | ... |
... | @@ -324,6 +324,7 @@ int make_interdir (const char *name, int delim, int perms); | ... | @@ -324,6 +324,7 @@ int make_interdir (const char *name, int delim, int perms); |
324 | 324 | ||
325 | /* Synchronisation on simultaneous access. */ | 325 | /* Synchronisation on simultaneous access. */ |
326 | extern int imap4d_sync (void); | 326 | extern int imap4d_sync (void); |
327 | extern void imap4d_sync_invalidate (void); | ||
327 | extern int imap4d_sync_flags (size_t); | 328 | extern int imap4d_sync_flags (size_t); |
328 | extern size_t uid_to_msgno (size_t); | 329 | extern size_t uid_to_msgno (size_t); |
329 | extern void imap4d_set_observer (mu_mailbox_t mbox); | 330 | extern void imap4d_set_observer (mu_mailbox_t mbox); | ... | ... |
... | @@ -39,8 +39,8 @@ realloc_attributes (size_t total) | ... | @@ -39,8 +39,8 @@ realloc_attributes (size_t total) |
39 | attr_table_count = total; | 39 | attr_table_count = total; |
40 | } | 40 | } |
41 | 41 | ||
42 | static void | 42 | void |
43 | invalidate_attr_table () | 43 | imap4d_sync_invalidate () |
44 | { | 44 | { |
45 | attr_table_valid = 0; | 45 | attr_table_valid = 0; |
46 | attr_table_count = 0; | 46 | attr_table_count = 0; |
... | @@ -191,7 +191,7 @@ imap4d_sync (void) | ... | @@ -191,7 +191,7 @@ imap4d_sync (void) |
191 | It may be because of close or before select/examine a new mailbox. | 191 | It may be because of close or before select/examine a new mailbox. |
192 | If it was a close we do not send any notification. */ | 192 | If it was a close we do not send any notification. */ |
193 | if (mbox == NULL) | 193 | if (mbox == NULL) |
194 | invalidate_attr_table (); | 194 | imap4d_sync_invalidate (); |
195 | else if (!attr_table_valid || !mu_mailbox_is_updated (mbox)) | 195 | else if (!attr_table_valid || !mu_mailbox_is_updated (mbox)) |
196 | { | 196 | { |
197 | if (mailbox_corrupt) | 197 | if (mailbox_corrupt) |
... | @@ -205,7 +205,7 @@ imap4d_sync (void) | ... | @@ -205,7 +205,7 @@ imap4d_sync (void) |
205 | if (status) | 205 | if (status) |
206 | imap4d_bye (ERR_MAILBOX_CORRUPTED); | 206 | imap4d_bye (ERR_MAILBOX_CORRUPTED); |
207 | imap4d_set_observer (mbox); | 207 | imap4d_set_observer (mbox); |
208 | invalidate_attr_table (); | 208 | imap4d_sync_invalidate (); |
209 | mailbox_corrupt = 0; | 209 | mailbox_corrupt = 0; |
210 | io_untagged_response (RESP_NONE, | 210 | io_untagged_response (RESP_NONE, |
211 | "OK [ALERT] Mailbox modified by another program"); | 211 | "OK [ALERT] Mailbox modified by another program"); | ... | ... |
-
Please register or sign in to post a comment