RE: hash_lookup funnies in src/auth/digest/auth_digest.c

From: Robert Collins <robert.collins@dont-contact.us>
Date: Tue, 18 Sep 2001 13:39:39 +1000

> -----Original Message-----
> From: Duane Wessels [mailto:wessels@squid-cache.org]
>
>
> if ((nonce = hash_lookup(digest_nonce_cache, nonceb64)))
> while ((strcmp(nonce->hash.key, nonceb64)) && (nonce->next))
> nonce = nonce->next;
>
> why the while loop after hash_lookup()?
>
> hash_lookup() returns the thing you want, or NULL. The hash table
> "user" shouldn't be walking the linked list.

Oh, cool :]. I hadn't looked closely at the hash API.

Rob
Received on Mon Sep 17 2001 - 21:52:24 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:21 MST