From: Michael M Slusarz Date: Tue, 9 Sep 2014 23:26:52 +0000 (-0600) Subject: pop3: Optimize POP3 UIDL processing when duplicate renaming is not active. X-Git-Tag: 2.2.14.rc1~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e540115bcff378f08968a0b66901b24e1ccb40b6;p=thirdparty%2Fdovecot%2Fcore.git pop3: Optimize POP3 UIDL processing when duplicate renaming is not active. --- diff --git a/src/pop3/pop3-commands.c b/src/pop3/pop3-commands.c index dade32e1e3..1cbec5ea6c 100644 --- a/src/pop3/pop3-commands.c +++ b/src/pop3/pop3-commands.c @@ -784,7 +784,9 @@ static void client_uidls_save(struct client *client) uidl_duplicates_rename = strcmp(client->set->pop3_uidl_duplicates, "rename") == 0; - hash_table_create(&prev_uidls, default_pool, 0, str_hash, strcmp); + if (uidl_duplicates_rename) + hash_table_create(&prev_uidls, default_pool, 0, str_hash, + strcmp); client->uidl_pool = pool_alloconly_create("message uidls", 1024); /* first read all the UIDLs into a temporary [seq] array */ @@ -804,10 +806,12 @@ static void client_uidls_save(struct client *client) mail_update_pop3_uidl(mail, uidl); seq_uidls[mail->seq-1] = uidl; - hash_table_insert(prev_uidls, uidl, POINTER_CAST(1)); + if (uidl_duplicates_rename) + hash_table_insert(prev_uidls, uidl, POINTER_CAST(1)); } (void)mailbox_search_deinit(&search_ctx); - hash_table_destroy(&prev_uidls); + if (uidl_duplicates_rename) + hash_table_destroy(&prev_uidls); if (failed) { pool_unref(&client->uidl_pool);