[dovecot-cvs] dovecot/src/imap cmd-append.c,1.20,1.21

cras at procontrol.fi cras at procontrol.fi
Thu Jan 23 05:17:12 EET 2003


Update of /home/cvs/dovecot/src/imap
In directory danu:/tmp/cvs-serv2821/src/imap

Modified Files:
	cmd-append.c 
Log Message:
Support for LITERAL+ extension.



Index: cmd-append.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cmd-append.c	22 Jan 2003 19:23:28 -0000	1.20
+++ cmd-append.c	23 Jan 2003 03:17:09 -0000	1.21
@@ -14,7 +14,8 @@
    internal_date may be NULL as a result, but mailbox and msg_size are always
    set when successful. */
 static int validate_args(struct imap_arg *args, struct imap_arg_list **flags,
-			 const char **internal_date, uoff_t *msg_size)
+			 const char **internal_date, uoff_t *msg_size,
+			 int *nonsync)
 {
 	/* [<flags>] */
 	if (args->type != IMAP_ARG_LIST)
@@ -32,9 +33,11 @@
 		args++;
 	}
 
-	if (args->type != IMAP_ARG_LITERAL_SIZE)
+	if (args->type != IMAP_ARG_LITERAL_SIZE &&
+	    args->type != IMAP_ARG_LITERAL_SIZE_NONSYNC)
 		return FALSE;
 
+	*nonsync = args->type == IMAP_ARG_LITERAL_SIZE_NONSYNC;
 	*msg_size = IMAP_ARG_LITERAL_SIZE(args);
 	return TRUE;
 }
@@ -51,7 +54,7 @@
 	const char *mailbox, *internal_date_str;
 	uoff_t msg_size;
 	unsigned int count;
-	int ret, failed, timezone_offset;
+	int ret, failed, timezone_offset, nonsync;
 
 	/* <mailbox> */
 	if (!client_read_string_args(client, 1, &mailbox))
@@ -122,7 +125,7 @@
 		}
 
 		if (!validate_args(args, &flags_list, &internal_date_str,
-				   &msg_size)) {
+				   &msg_size, &nonsync)) {
 			/* error */
 			client_send_command_error(client, "Invalid arguments.");
 			break;
@@ -154,8 +157,10 @@
 			break;
 		}
 
-		o_stream_send(client->output, "+ OK\r\n", 6);
-		o_stream_flush(client->output);
+		if (!nonsync) {
+			o_stream_send(client->output, "+ OK\r\n", 6);
+			o_stream_flush(client->output);
+		}
 
 		/* save the mail */
 		i_stream_set_read_limit(client->input,




More information about the dovecot-cvs mailing list