[dovecot-cvs] dovecot/src/pop3-login client-authenticate.c,1.10,1.11 client.c,1.14,1.15 client.h,1.5,1.6

cras at procontrol.fi cras at procontrol.fi
Fri Aug 22 22:57:02 EEST 2003


Update of /home/cvs/dovecot/src/pop3-login
In directory danu:/tmp/cvs-serv15227/pop3-login

Modified Files:
	client-authenticate.c client.c client.h 
Log Message:
fixes. maybe it works now.



Index: client-authenticate.c
===================================================================
RCS file: /home/cvs/dovecot/src/pop3-login/client-authenticate.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- client-authenticate.c	22 Aug 2003 02:42:13 -0000	1.10
+++ client-authenticate.c	22 Aug 2003 18:57:00 -0000	1.11
@@ -83,6 +83,8 @@
 		io_remove(client->common.io);
 	client->common.io = client->common.fd == -1 ? NULL :
 		io_add(client->common.fd, IO_READ, client_input, client);
+
+	client_unref(client);
 }
 
 static void master_callback(struct client *_client, int success)
@@ -148,6 +150,7 @@
 		/* success, we should be able to log in. if we fail, just
 		   disconnect the client. */
 		client_send_line(client, "+OK Logged in.");
+		client_unref(client);
 	}
 }
 
@@ -180,6 +183,7 @@
 	buffer_append_c(client->plain_login, '\0');
 	buffer_append(client->plain_login, args, strlen(args));
 
+	client_ref(client);
 	client->common.auth_request =
 		auth_client_request_new(auth_client, AUTH_MECH_PLAIN,
 					AUTH_PROTOCOL_POP3,
@@ -194,6 +198,7 @@
 	} else {
 		client_send_line(client,
 			t_strconcat("-ERR Login failed: ", error, NULL));
+		client_unref(client);
 		return TRUE;
 	}
 }
@@ -220,6 +225,7 @@
 		/* success, we should be able to log in. if we fail, just
 		   disconnect the client. */
 		client_send_line(client, "+OK Logged in.");
+		client_unref(client);
 	}
 }
 
@@ -284,6 +290,7 @@
 		return TRUE;
 	}
 
+	client_ref(client);
 	client->common.auth_request =
 		auth_client_request_new(auth_client, mech->mech,
 					AUTH_PROTOCOL_POP3,
@@ -297,6 +304,7 @@
 	} else {
 		client_send_line(client, t_strconcat(
 			"-ERR Authentication failed: ", error, NULL));
+		client_unref(client);
 	}
 
 	return TRUE;

Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/pop3-login/client.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- client.c	22 Aug 2003 02:42:13 -0000	1.14
+++ client.c	22 Aug 2003 18:57:00 -0000	1.15
@@ -35,8 +35,6 @@
 static struct hash_table *clients;
 static struct timeout *to_idle;
 
-static int client_unref(struct pop3_client *client);
-
 static void client_set_title(struct pop3_client *client)
 {
 	const char *addr;
@@ -166,7 +164,7 @@
 		return;
 	}
 
-	client->refcount++;
+	client_ref(client);
 
 	o_stream_cork(client->output);
 	while (!client->output->closed &&
@@ -301,7 +299,12 @@
 	client_unref(client);
 }
 
-static int client_unref(struct pop3_client *client)
+void client_ref(struct pop3_client *client)
+{
+	client->refcount++;
+}
+
+int client_unref(struct pop3_client *client)
 {
 	if (--client->refcount > 0)
 		return TRUE;

Index: client.h
===================================================================
RCS file: /home/cvs/dovecot/src/pop3-login/client.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- client.h	22 Aug 2003 02:42:13 -0000	1.5
+++ client.h	22 Aug 2003 18:57:00 -0000	1.6
@@ -33,6 +33,9 @@
 int client_read(struct pop3_client *client);
 void client_input(void *context);
 
+void client_ref(struct pop3_client *client);
+int client_unref(struct pop3_client *client);
+
 void clients_init(void);
 void clients_deinit(void);
 



More information about the dovecot-cvs mailing list