[dovecot-cvs] dovecot/src/imap cmd-append.c,1.12,1.13

cras at procontrol.fi cras at procontrol.fi
Thu Oct 24 04:15:41 EEST 2002


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

Modified Files:
	cmd-append.c 
Log Message:
Fixes to timezone handling which were handling quite badly. added
ioloop_timezone which gets updated with ioloop_time. Changed some GMT
references to UTC. Timezone offsets are in minutes now everywhere instead of
seconds. Fixes for unsigned time_t.



Index: cmd-append.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cmd-append.c	19 Oct 2002 14:51:59 -0000	1.12
+++ cmd-append.c	24 Oct 2002 00:15:38 -0000	1.13
@@ -7,6 +7,8 @@
 #include "imap-parser.h"
 #include "imap-date.h"
 
+#include <sys/time.h>
+
 /* Returns -1 = error, 0 = need more data, 1 = successful. flags and
    internal_date may be NULL as a result, but mailbox and msg_size are always
    set when successful. */
@@ -78,7 +80,7 @@
 	const char *custom_flags[MAIL_CUSTOM_FLAGS_COUNT];
 	const char *mailbox, *internal_date_str;
 	uoff_t msg_size;
-	int failed;
+	int failed, timezone_offset;
 
 	/* <mailbox> [<flags>] [<internal date>] <message literal> */
 	switch (validate_args(client, &mailbox, &flags_list,
@@ -106,7 +108,9 @@
 	if (internal_date_str == NULL) {
 		/* no time given, default to now. */
 		internal_date = ioloop_time;
-	} else if (!imap_parse_datetime(internal_date_str, &internal_date)) {
+                timezone_offset = ioloop_timezone.tz_minuteswest;
+	} else if (!imap_parse_datetime(internal_date_str, &internal_date,
+					&timezone_offset)) {
 		client_send_tagline(client, "BAD Invalid internal date.");
 		return TRUE;
 	}
@@ -126,7 +130,8 @@
 	o_buffer_flush(client->outbuf);
 
 	/* save the mail */
-	failed = !box->save(box, flags, custom_flags, internal_date,
+	failed = !box->save(box, flags, custom_flags,
+			    internal_date, timezone_offset,
 			    client->inbuf, msg_size);
 	box->close(box);
 




More information about the dovecot-cvs mailing list