X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilchashtable.c;h=31f333082cfbf0a4a109216a3fafc8c18fa90eac;hb=9a85416f729ef965606a688fffb6baa9d22927a5;hp=130d9fa72e4a3b80d90b1b372ad57d1bc7077e2e;hpb=735dfe6ea4b91aa975eae3788ff5f91ea776638b;p=runtime.git diff --git a/lib/silcutil/silchashtable.c b/lib/silcutil/silchashtable.c index 130d9fa7..31f33308 100644 --- a/lib/silcutil/silchashtable.c +++ b/lib/silcutil/silchashtable.c @@ -834,6 +834,18 @@ void silc_hash_table_list(SilcHashTable ht, SilcHashTableList *htl) htl->ht = ht; htl->entry = NULL; htl->index = 0; + htl->auto_rehash = ht->auto_rehash; + + /* Disallow rehashing of the table while traversing the table */ + ht->auto_rehash = FALSE; +} + +/* Resets the `htl' SilcHashTableList. */ + +void silc_hash_table_list_reset(SilcHashTableList *htl) +{ + /* Set back the original auto rehash value to the table */ + htl->ht->auto_rehash = htl->auto_rehash; } /* Returns always the next entry in the hash table into the `key' and