dovecot: hash_destroy() and hash_iterate_deinit() now take ** po...

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 16 13:53:17 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/047d0d8bbf0a
changeset: 6417:047d0d8bbf0a
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Sep 16 12:35:01 2007 +0300
description:
hash_destroy() and hash_iterate_deinit() now take ** pointer.

diffstat:

27 files changed, 71 insertions(+), 73 deletions(-)
src/auth/auth-cache.c                            |    2 +-
src/auth/auth-request-handler.c                  |    6 +++---
src/auth/db-ldap.c                               |   14 +++++++-------
src/auth/db-passwd-file.c                        |   10 ++++------
src/auth/passdb-checkpassword.c                  |    4 ++--
src/deliver/duplicate.c                          |    4 ++--
src/dict/dict-cache.c                            |    2 +-
src/imap-login/client.c                          |   10 +++++-----
src/imap/imap-thread.c                           |   10 ++++------
src/lib-auth/auth-server-connection.c            |    2 +-
src/lib-auth/auth-server-request.c               |    2 +-
src/lib-index/mail-cache.c                       |    2 +-
src/lib-index/mail-index.c                       |    2 +-
src/lib-storage/index/dbox/dbox-sync.c           |    4 ++--
src/lib-storage/index/maildir/maildir-keywords.c |    2 +-
src/lib-storage/index/maildir/maildir-uidlist.c  |    6 +++---
src/lib/hash.c                                   |   11 +++++++----
src/lib/hash.h                                   |    5 ++---
src/login-common/login-proxy.c                   |    6 +++---
src/login-common/master.c                        |    2 +-
src/login-common/ssl-proxy-openssl.c             |    4 ++--
src/master/auth-process.c                        |    4 ++--
src/master/child-process.c                       |    2 +-
src/master/login-process.c                       |    4 ++--
src/master/mail-process.c                        |    8 ++++----
src/plugins/acl/acl-cache.c                      |    6 +++---
src/pop3-login/client.c                          |   10 +++++-----

diffs (truncated from 584 to 300 lines):

diff -r 298e651e18de -r 047d0d8bbf0a src/auth/auth-cache.c
--- a/src/auth/auth-cache.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/auth/auth-cache.c	Sun Sep 16 12:35:01 2007 +0300
@@ -139,7 +139,7 @@ void auth_cache_free(struct auth_cache *
 	lib_signals_unset_handler(SIGUSR2, sig_auth_cache_stats, cache);
 
 	auth_cache_clear(cache);
-	hash_destroy(cache->hash);
+	hash_destroy(&cache->hash);
 	i_free(cache);
 }
 
diff -r 298e651e18de -r 047d0d8bbf0a src/auth/auth-request-handler.c
--- a/src/auth/auth-request-handler.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/auth/auth-request-handler.c	Sun Sep 16 12:35:01 2007 +0300
@@ -69,12 +69,12 @@ void auth_request_handler_unref(struct a
 
 		auth_request_unref(&auth_request);
 	}
-	hash_iterate_deinit(iter);
+	hash_iterate_deinit(&iter);
 
 	/* notify parent that we're done with all requests */
 	handler->callback(NULL, handler->context);
 
-	hash_destroy(handler->requests);
+	hash_destroy(&handler->requests);
 	pool_unref(handler->pool);
 }
 
@@ -105,7 +105,7 @@ void auth_request_handler_check_timeouts
 		if (request->last_access + AUTH_REQUEST_TIMEOUT < ioloop_time)
 			auth_request_handler_remove(handler, request);
 	}
-	hash_iterate_deinit(iter);
+	hash_iterate_deinit(&iter);
 }
 
 static const char *get_client_extra_fields(struct auth_request *request)
diff -r 298e651e18de -r 047d0d8bbf0a src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/auth/db-ldap.c	Sun Sep 16 12:35:01 2007 +0300
@@ -310,7 +310,7 @@ static void ldap_conn_retry_requests(str
 			db_ldap_search(conn, request, conn->set.ldap_scope);
 		}
 	}
-	hash_iterate_deinit(iter);
+	hash_iterate_deinit(&iter);
 
 	/* then delayed search requests */
 	p = &conn->delayed_requests_head;
@@ -338,7 +338,7 @@ static void ldap_conn_retry_requests(str
 			if (request->filter == NULL)
 				request->callback(conn, request, NULL);
 		}
-		hash_iterate_deinit(iter);
+		hash_iterate_deinit(&iter);
 	}
 	if (conn->delayed_requests_head != NULL && conn->set.auth_bind) {
 		request = conn->delayed_requests_head;
@@ -350,7 +350,7 @@ static void ldap_conn_retry_requests(str
 		}
 		conn->delayed_requests_head = NULL;
 	}
-	hash_destroy(old_requests);
+	hash_destroy(&old_requests);
 
 	i_assert(conn->delayed_requests_head == NULL);
 	conn->delayed_requests_tail = NULL;
@@ -632,7 +632,7 @@ static void ldap_conn_close(struct ldap_
 
 			request->callback(conn, request, NULL);
 		}
-		hash_iterate_deinit(iter);
+		hash_iterate_deinit(&iter);
 		hash_clear(conn->requests, FALSE);
 
 		request = conn->delayed_requests_head;
@@ -1006,11 +1006,11 @@ void db_ldap_unref(struct ldap_connectio
 
 	ldap_conn_close(conn, TRUE);
 
-	hash_destroy(conn->requests);
+	hash_destroy(&conn->requests);
 	if (conn->pass_attr_map != NULL)
-		hash_destroy(conn->pass_attr_map);
+		hash_destroy(&conn->pass_attr_map);
 	if (conn->user_attr_map != NULL)
-		hash_destroy(conn->user_attr_map);
+		hash_destroy(&conn->user_attr_map);
 	pool_unref(conn->pool);
 }
 
diff -r 298e651e18de -r 047d0d8bbf0a src/auth/db-passwd-file.c
--- a/src/auth/db-passwd-file.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/auth/db-passwd-file.c	Sun Sep 16 12:35:01 2007 +0300
@@ -216,10 +216,8 @@ static void passwd_file_close(struct pas
 		pw->fd = -1;
 	}
 
-	if (pw->users != NULL) {
-		hash_destroy(pw->users);
-		pw->users = NULL;
-	}
+	if (pw->users != NULL)
+		hash_destroy(&pw->users);
 	if (pw->pool != NULL) {
 		pool_unref(pw->pool);
 		pw->pool = NULL;
@@ -362,8 +360,8 @@ void db_passwd_file_unref(struct db_pass
 
 			passwd_file_free(file);
 		}
-		hash_iterate_deinit(iter);
-		hash_destroy(db->files);
+		hash_iterate_deinit(&iter);
+		hash_destroy(&db->files);
 	}
 	i_free(db->path);
 	i_free(db);
diff -r 298e651e18de -r 047d0d8bbf0a src/auth/passdb-checkpassword.c
--- a/src/auth/passdb-checkpassword.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/auth/passdb-checkpassword.c	Sun Sep 16 12:35:01 2007 +0300
@@ -455,8 +455,8 @@ static void checkpassword_deinit(struct 
 		checkpassword_request_finish(value,
 					     PASSDB_RESULT_INTERNAL_FAILURE);
 	}
-	hash_iterate_deinit(iter);
-	hash_destroy(module->clients);
+	hash_iterate_deinit(&iter);
+	hash_destroy(&module->clients);
 }
 
 struct passdb_module_interface passdb_checkpassword = {
diff -r 298e651e18de -r 047d0d8bbf0a src/deliver/duplicate.c
--- a/src/deliver/duplicate.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/deliver/duplicate.c	Sun Sep 16 12:35:01 2007 +0300
@@ -168,7 +168,7 @@ static void duplicate_free(struct duplic
 	if (file->dotlock != NULL)
 		file_dotlock_delete(&file->dotlock);
 
-	hash_destroy(file->hash);
+	hash_destroy(&file->hash);
 	pool_unref(file->pool);
 }
 
@@ -230,7 +230,7 @@ void duplicate_flush(void)
 		o_stream_send(output, d->id, d->id_size);
 		o_stream_send(output, d->user, user_size);
 	}
-	hash_iterate_deinit(iter);
+	hash_iterate_deinit(&iter);
 	o_stream_unref(&output);
 
 	file->changed = FALSE;
diff -r 298e651e18de -r 047d0d8bbf0a src/dict/dict-cache.c
--- a/src/dict/dict-cache.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/dict/dict-cache.c	Sun Sep 16 12:35:01 2007 +0300
@@ -27,7 +27,7 @@ struct dict_cache *dict_cache_init(void)
 
 void dict_cache_deinit(struct dict_cache *cache)
 {
-	hash_destroy(cache->dicts);
+	hash_destroy(&cache->dicts);
 	i_free(cache);
 }
 
diff -r 298e651e18de -r 047d0d8bbf0a src/imap-login/client.c
--- a/src/imap-login/client.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/imap-login/client.c	Sun Sep 16 12:35:01 2007 +0300
@@ -384,7 +384,7 @@ void client_destroy_oldest(void)
 			}
 		}
 	}
-	hash_iterate_deinit(iter);
+	hash_iterate_deinit(&iter);
 
 	/* then kill them */
 	for (i = 0; i < destroy_count; i++) {
@@ -590,7 +590,7 @@ static void idle_timeout(void *context A
 
 		client_check_idle(client);
 	}
-	hash_iterate_deinit(iter);
+	hash_iterate_deinit(&iter);
 }
 
 unsigned int clients_get_count(void)
@@ -614,7 +614,7 @@ void clients_notify_auth_connected(void)
 			client_input(client);
 		}
 	}
-	hash_iterate_deinit(iter);
+	hash_iterate_deinit(&iter);
 }
 
 void clients_destroy_all(void)
@@ -628,7 +628,7 @@ void clients_destroy_all(void)
 
 		client_destroy(client, "Disconnected: Shutting down");
 	}
-	hash_iterate_deinit(iter);
+	hash_iterate_deinit(&iter);
 }
 
 void clients_init(void)
@@ -639,7 +639,7 @@ void clients_deinit(void)
 void clients_deinit(void)
 {
 	clients_destroy_all();
-	hash_destroy(clients);
+	hash_destroy(&clients);
 
 	i_assert(to_idle == NULL);
 }
diff -r 298e651e18de -r 047d0d8bbf0a src/imap/imap-thread.c
--- a/src/imap/imap-thread.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/imap/imap-thread.c	Sun Sep 16 12:35:01 2007 +0300
@@ -93,9 +93,9 @@ static void mail_thread_deinit(struct th
 static void mail_thread_deinit(struct thread_context *ctx)
 {
 	if (ctx->msgid_hash != NULL)
-		hash_destroy(ctx->msgid_hash);
+		hash_destroy(&ctx->msgid_hash);
 	if (ctx->subject_hash != NULL)
-		hash_destroy(ctx->subject_hash);
+		hash_destroy(&ctx->subject_hash);
 
 	pool_unref(ctx->temp_pool);
 	pool_unref(ctx->pool);
@@ -940,13 +940,11 @@ static void mail_thread_finish(struct th
 		if (node->parent == NULL)
 			add_root(ctx, node);
 	}
-	hash_iterate_deinit(iter);
+	hash_iterate_deinit(&iter);
 
 	/* drop the memory allocated for message-IDs and msgid_hash,
 	   reuse their memory for base subjects */
-	hash_destroy(ctx->msgid_hash);
-	ctx->msgid_hash = NULL;
-
+	hash_destroy(&ctx->msgid_hash);
 	p_clear(ctx->temp_pool);
 
 	if (ctx->root_node.first_child == NULL) {
diff -r 298e651e18de -r 047d0d8bbf0a src/lib-auth/auth-server-connection.c
--- a/src/lib-auth/auth-server-connection.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/lib-auth/auth-server-connection.c	Sun Sep 16 12:35:01 2007 +0300
@@ -301,7 +301,7 @@ static void auth_server_connection_unref
 		return;
 	i_assert(conn->refcount == 0);
 
-	hash_destroy(conn->requests);
+	hash_destroy(&conn->requests);
 	buffer_free(&conn->auth_mechs_buf);
 
 	i_stream_unref(&conn->input);
diff -r 298e651e18de -r 047d0d8bbf0a src/lib-auth/auth-server-request.c
--- a/src/lib-auth/auth-server-request.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/lib-auth/auth-server-request.c	Sun Sep 16 12:35:01 2007 +0300
@@ -314,7 +314,7 @@ void auth_server_requests_remove_all(str
 	iter = hash_iterate_init(conn->requests);
 	while (hash_iterate(iter, &key, &value))
 		request_hash_remove(conn, value);
-	hash_iterate_deinit(iter);
+	hash_iterate_deinit(&iter);
 }
 
 struct auth_request *
diff -r 298e651e18de -r 047d0d8bbf0a src/lib-index/mail-cache.c
--- a/src/lib-index/mail-cache.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/lib-index/mail-cache.c	Sun Sep 16 12:35:01 2007 +0300
@@ -392,7 +392,7 @@ void mail_cache_free(struct mail_cache *
 
 	mail_cache_file_close(cache);
 
-	hash_destroy(cache->field_name_hash);
+	hash_destroy(&cache->field_name_hash);
 	pool_unref(cache->field_pool);
 	i_free(cache->field_file_map);
 	i_free(cache->file_field_map);
diff -r 298e651e18de -r 047d0d8bbf0a src/lib-index/mail-index.c
--- a/src/lib-index/mail-index.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/lib-index/mail-index.c	Sun Sep 16 12:35:01 2007 +0300
@@ -61,7 +61,7 @@ void mail_index_free(struct mail_index *
 	mail_index_close(index);
 
 	mail_transaction_log_free(&index->log);
-	hash_destroy(index->keywords_hash);
+	hash_destroy(&index->keywords_hash);
 	pool_unref(index->extension_pool);
 	pool_unref(index->keywords_pool);
 
diff -r 298e651e18de -r 047d0d8bbf0a src/lib-storage/index/dbox/dbox-sync.c
--- a/src/lib-storage/index/dbox/dbox-sync.c	Sun Sep 16 12:31:27 2007 +0300
+++ b/src/lib-storage/index/dbox/dbox-sync.c	Sun Sep 16 12:35:01 2007 +0300
@@ -211,7 +211,7 @@ static int dbox_sync_index(struct dbox_s
 			if ((ret = dbox_sync_file(ctx, entry)) <= 0)
 				break;


More information about the dovecot-cvs mailing list