[dovecot-cvs] dovecot/src/imap-login client.c,1.15,1.16

cras at procontrol.fi cras at procontrol.fi
Wed Jul 2 04:57:27 EEST 2003


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

Modified Files:
	client.c 
Log Message:
IMAP parser memory limits are now enforced by bytes per line rather than
limiting maximum amount of tokens per line. Default is 64k now, which should
help with the huge message sets generated by some clients.



Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap-login/client.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- client.c	24 Jun 2003 23:35:13 -0000	1.15
+++ client.c	2 Jul 2003 00:57:24 -0000	1.16
@@ -20,9 +20,8 @@
 
 #define MAX_OUTBUF_SIZE 1024
 
-/* max. number of IMAP argument elements to accept. The maximum memory usage
-   for command from user is around MAX_INBUF_SIZE * MAX_IMAP_ARG_ELEMENTS */
-#define MAX_IMAP_ARG_ELEMENTS 4
+/* maximum length for IMAP command line. */
+#define MAX_IMAP_LINE 8192
 
 /* Disconnect client after idling this many seconds */
 #define CLIENT_LOGIN_IDLE_TIMEOUT 60
@@ -64,8 +63,7 @@
 	client->output = o_stream_create_file(fd, default_pool, MAX_OUTBUF_SIZE,
 					      FALSE);
 	client->parser = imap_parser_create(client->input, client->output,
-					    MAX_INBUF_SIZE,
-					    MAX_IMAP_ARG_ELEMENTS);
+					    MAX_IMAP_LINE);
 }
 
 /* Skip incoming data until newline is found,



More information about the dovecot-cvs mailing list