diff src/lib-master/master-login-auth.c @ 17489:f6e2fa1afa45

Added several asserts to make sure duplicates aren't inserted into hash table. The previous commit hopefully fixed the problem causing auth and login processes to sometimes die with "key not found from hash" error, but if not maybe one of these will catch it.
author Timo Sirainen <tss@iki.fi>
date Fri, 13 Jun 2014 15:14:44 +0300
parents add8c00fb3cc
children 3009a1a6f6d5
line wrap: on
line diff
--- a/src/lib-master/master-login-auth.c	Fri Jun 13 15:13:26 2014 +0300
+++ b/src/lib-master/master-login-auth.c	Fri Jun 13 15:14:44 2014 +0300
@@ -483,6 +483,7 @@
 	memcpy(login_req->cookie, req->cookie, sizeof(login_req->cookie));
 	login_req->callback = callback;
 	login_req->context = context;
+	i_assert(hash_table_lookup(auth->requests, POINTER_CAST(id)) == NULL);
 	hash_table_insert(auth->requests, POINTER_CAST(id), login_req);
 	DLLIST2_APPEND(&auth->request_head, &auth->request_tail, login_req);