CORRECT PATCH Re: sync_client bails when encountering a deleted
message
John Capo
jc at irbs.com
Wed May 16 10:04:58 EDT 2007
Quoting Ken Murchison (murch at andrew.cmu.edu):
> John Capo wrote:
> >Quoting John Capo (jc at irbs.com):
> >>Quoting Ken Murchison (murch at andrew.cmu.edu):
> >>>I don't think I was clear. With my proposal, we're well past "UPDATE".
> >>>I'm talking about cutting the command short after "(<flags>)". No
> >>>header_size or anything after.
> >>I guess I don't understand what you mean.
> >>
> >>It sure looks to me like cmd_upload() has to detect that the header
> >>size it is waiting for will not arrive and recover gracefully rather
> >>than sending a BAD that the client sees as the response for its
> >>next command. Patch attached.
> >
> >The server needs to push the character back except on EOF, grrrr.
>
> Here's what I was thinking. We might be able to bump the cache flush
> down to parse_err, but I'm not sure if this is correct/suboptimal for
> SIMPLE.
Ths might work if you add an eatline() in the client before returning.
The BAD response from the server must be discarded somehow or the
BAD response will be seen by the client as the response to the next
client command. It seems to me that no response is needed since
the client is not expecting one.
> Index: sync_client.c
> ===================================================================
> RCS file: /afs/andrew/system/cvs/src/cyrus/imap/sync_client.c,v
> retrieving revision 1.10
> diff -u -r1.10 sync_client.c
> --- sync_client.c 7 May 2007 16:23:21 -0000 1.10
> +++ sync_client.c 16 May 2007 13:37:06 -0000
> @@ -1177,6 +1177,9 @@
> if (r) {
> syslog(LOG_ERR, "IOERROR: opening message file %lu of %s: %m",
> record->uid, mailbox->name);
> + prot_printf(toserver,"\r\n"); /* Abort command */
> + prot_flush(toserver);
> + sync_messageid_remove(msgid_onserver, &record->uuid);
> return(IMAP_IOERROR);
> }
>
> Index: sync_server.c
> ===================================================================
> RCS file: /afs/andrew/system/cvs/src/cyrus/imap/sync_server.c,v
> retrieving revision 1.4
> diff -u -r1.4 sync_server.c
> --- sync_server.c 4 Apr 2007 15:22:42 -0000 1.4
> +++ sync_server.c 16 May 2007 13:37:06 -0000
> @@ -1889,7 +1889,10 @@
> break;
> case MSG_PARSED:
> if (c != ' ') {
> - err = "Invalid flags";
> + /* Make sure cache data flushed to disk before we commit */
> + sync_message_fsync(message_list);
> + sync_message_list_cache_flush(message_list);
> + err = "Invalid flags (UPLOAD aborted?)";
> goto parse_err;
> }
>
> --
> Kenneth Murchison
> Systems Programmer
> Project Cyrus Developer/Maintainer
> Carnegie Mellon University
More information about the Cyrus-devel
mailing list