[dovecot-cvs] dovecot/src/imap cmd-sort.c, 1.16, 1.17 commands-util.c, 1.36, 1.37 commands.c, 1.13, 1.14 imap-fetch.c, 1.28, 1.29 imap-sort.c, 1.16, 1.17

cras at dovecot.org cras at dovecot.org
Fri Oct 8 20:51:50 EEST 2004


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv10130/imap

Modified Files:
	cmd-sort.c commands-util.c commands.c imap-fetch.c imap-sort.c 
Log Message:
Buffer API change: we no longer support limited sized buffers where
writes past limit wouldn't kill the process. They weren't used hardly
anywhere, they could have hidden bugs and the code for handling them was too
complex.

This also changed base64 and hex-binary APIs.



Index: cmd-sort.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-sort.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cmd-sort.c	18 Aug 2004 23:53:39 -0000	1.16
+++ cmd-sort.c	8 Oct 2004 17:51:47 -0000	1.17
@@ -38,8 +38,7 @@
 	}
 
 	buf = buffer_create_dynamic(pool_datastack_create(),
-				    32 * sizeof(enum mail_sort_type),
-				    (size_t)-1);
+				    32 * sizeof(enum mail_sort_type));
 
 	while (args->type == IMAP_ARG_ATOM || args->type == IMAP_ARG_STRING) {
 		const char *arg = IMAP_ARG_STR(args);

Index: commands-util.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/commands-util.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- commands-util.c	18 Aug 2004 23:53:39 -0000	1.36
+++ commands-util.c	8 Oct 2004 17:51:47 -0000	1.37
@@ -184,7 +184,7 @@
 	size_t size, i;
 
 	memset(flags, 0, sizeof(*flags));
-	buffer = buffer_create_dynamic(client->cmd_pool, 256, (size_t)-1);
+	buffer = buffer_create_dynamic(client->cmd_pool, 256);
 
 	while (args->type != IMAP_ARG_EOL) {
 		if (args->type != IMAP_ARG_ATOM) {

Index: commands.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/commands.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- commands.c	20 Jun 2004 03:25:33 -0000	1.13
+++ commands.c	8 Oct 2004 17:51:47 -0000	1.14
@@ -136,7 +136,7 @@
 void commands_init(void)
 {
 	cmdbuf = buffer_create_dynamic(system_pool,
-				       sizeof(struct command) * 64, (size_t)-1);
+				       sizeof(struct command) * 64);
 	cmdbuf_unsorted = FALSE;
 
         command_register_array(imap4rev1_commands, IMAP4REV1_COMMANDS_COUNT);

Index: imap-fetch.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-fetch.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- imap-fetch.c	3 Oct 2004 12:28:57 -0000	1.28
+++ imap-fetch.c	8 Oct 2004 17:51:47 -0000	1.29
@@ -30,10 +30,8 @@
 	void *data;
 	size_t size;
 
-	if (fetch_handlers == NULL) {
-		fetch_handlers = buffer_create_dynamic(default_pool,
-						       128, (size_t)-1);
-	}
+	if (fetch_handlers == NULL)
+		fetch_handlers = buffer_create_dynamic(default_pool, 128);
 	buffer_append(fetch_handlers, handlers, sizeof(*handlers) * count);
 
 	data = buffer_get_modifyable_data(fetch_handlers, &size);
@@ -93,10 +91,8 @@
 
 	ctx->cur_str = str_new(default_pool, 8192);
 	ctx->seen_flag.flags = MAIL_SEEN;
-	ctx->all_headers_buf =
-		buffer_create_dynamic(client->cmd_pool, 128, (size_t)-1);
-	ctx->handlers =
-		buffer_create_dynamic(client->cmd_pool, 128, (size_t)-1);
+	ctx->all_headers_buf = buffer_create_dynamic(client->cmd_pool, 128);
+	ctx->handlers = buffer_create_dynamic(client->cmd_pool, 128);
 	return ctx;
 }
 

Index: imap-sort.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-sort.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- imap-sort.c	29 Aug 2004 07:52:02 -0000	1.16
+++ imap-sort.c	8 Oct 2004 17:51:47 -0000	1.17
@@ -240,8 +240,7 @@
 	ctx->box = client->mailbox;
 	ctx->output = client->output;
 	ctx->sort_buffer = buffer_create_dynamic(system_pool,
-						 128 * ctx->sort_element_size,
-						 (size_t)-1);
+						 128 * ctx->sort_element_size);
 
 	ctx->str = t_str_new(STRBUF_SIZE);
 	str_append(ctx->str, "* SORT");



More information about the dovecot-cvs mailing list