changeset 11661:1799fbbd104b HEAD

imap, pop3: Added an assert to client_connected().
author Pascal Volk <user@localhost.localdomain.org>
date Wed, 30 Jun 2010 18:49:23 +0000
parents b07bb05789cf
children 8468998b98ab
files src/imap/main.c src/pop3/main.c
diffstat 2 files changed, 10 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/main.c	Wed Jun 30 17:30:34 2010 +0100
+++ b/src/imap/main.c	Wed Jun 30 18:49:23 2010 +0000
@@ -278,12 +278,11 @@
 
 static void client_connected(struct master_service_connection *conn)
 {
-	if (master_login == NULL) {
-		/* running standalone, we shouldn't even get here */
-	} else {
-		master_service_client_connection_accept(conn);
-		master_login_add(master_login, conn->fd);
-	}
+	/* when running standalone, we shouldn't even get here */
+	i_assert(master_login != NULL);
+
+	master_service_client_connection_accept(conn);
+	master_login_add(master_login, conn->fd);
 }
 
 int main(int argc, char *argv[])
--- a/src/pop3/main.c	Wed Jun 30 17:30:34 2010 +0100
+++ b/src/pop3/main.c	Wed Jun 30 18:49:23 2010 +0000
@@ -174,12 +174,11 @@
 
 static void client_connected(struct master_service_connection *conn)
 {
-	if (master_login == NULL) {
-		/* running standalone, we shouldn't even get here */
-	} else {
-		master_service_client_connection_accept(conn);
-		master_login_add(master_login, conn->fd);
-	}
+	/* when running standalone, we shouldn't even get here */
+	i_assert(master_login != NULL);
+
+	master_service_client_connection_accept(conn);
+	master_login_add(master_login, conn->fd);
 }
 
 int main(int argc, char *argv[])