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

cras at procontrol.fi cras at procontrol.fi
Tue Jan 21 13:17:46 EET 2003


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

Modified Files:
	client.c 
Log Message:
imap-login: disconnect when received 10 invalid commands. imap: disconnect
when received 20 invalid commands in a row - every successful command resets
the counter now.



Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/client.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- client.c	11 Jan 2003 19:55:56 -0000	1.20
+++ client.c	21 Jan 2003 11:17:43 -0000	1.21
@@ -23,7 +23,7 @@
    a command, disconnect the client */
 #define CLIENT_CMDINPUT_TIMEOUT CLIENT_OUTPUT_TIMEOUT
 
-/* Disconnect client when it sends too many bad commands */
+/* Disconnect client when it sends too many bad commands in a row */
 #define CLIENT_MAX_BAD_COMMANDS 20
 
 /* Disconnect client after idling this many seconds */
@@ -252,6 +252,7 @@
 		if (client->cmd_func(client) || client->cmd_error) {
 			/* command execution was finished */
 			client_command_finished(client);
+                        client->bad_counter = 0;
 			return TRUE;
 		}
 		return FALSE;
@@ -296,6 +297,7 @@
 		if (client->cmd_func(client) || client->cmd_error) {
 			/* command execution was finished */
 			client_command_finished(client);
+                        client->bad_counter = 0;
 		}
 	}
 




More information about the dovecot-cvs mailing list