Commit b7ae8111 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Rename variables to reflect that they are object heads, not objects.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3400 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 220c780a
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
struct hsl_entry { struct hsl_entry {
VTAILQ_ENTRY(hsl_entry) list; VTAILQ_ENTRY(hsl_entry) list;
struct objhead *obj; struct objhead *oh;
unsigned refcnt; unsigned refcnt;
}; };
...@@ -73,34 +73,34 @@ hsl_start(void) ...@@ -73,34 +73,34 @@ hsl_start(void)
*/ */
static struct objhead * static struct objhead *
hsl_lookup(const struct sess *sp, struct objhead *nobj) hsl_lookup(const struct sess *sp, struct objhead *noh)
{ {
struct hsl_entry *he, *he2; struct hsl_entry *he, *he2;
int i; int i;
Lck_Lock(&hsl_mtx); Lck_Lock(&hsl_mtx);
VTAILQ_FOREACH(he, &hsl_head, list) { VTAILQ_FOREACH(he, &hsl_head, list) {
i = HSH_Compare(sp, he->obj); i = HSH_Compare(sp, he->oh);
if (i < 0) if (i < 0)
continue; continue;
if (i > 0) if (i > 0)
break; break;
he->refcnt++; he->refcnt++;
nobj = he->obj; noh = he->oh;
Lck_Unlock(&hsl_mtx); Lck_Unlock(&hsl_mtx);
return (nobj); return (noh);
} }
if (nobj != NULL) { if (noh != NULL) {
he2 = calloc(sizeof *he2, 1); he2 = calloc(sizeof *he2, 1);
XXXAN(he2); XXXAN(he2);
he2->obj = nobj; he2->oh = noh;
he2->refcnt = 1; he2->refcnt = 1;
nobj->hashpriv = he2; noh->hashpriv = he2;
nobj->hash = malloc(sp->lhashptr); noh->hash = malloc(sp->lhashptr);
XXXAN(nobj->hash); XXXAN(noh->hash);
nobj->hashlen = sp->lhashptr; noh->hashlen = sp->lhashptr;
HSH_Copy(sp, nobj); HSH_Copy(sp, noh);
if (he != NULL) if (he != NULL)
VTAILQ_INSERT_BEFORE(he, he2, list); VTAILQ_INSERT_BEFORE(he, he2, list);
...@@ -108,7 +108,7 @@ hsl_lookup(const struct sess *sp, struct objhead *nobj) ...@@ -108,7 +108,7 @@ hsl_lookup(const struct sess *sp, struct objhead *nobj)
VTAILQ_INSERT_TAIL(&hsl_head, he2, list); VTAILQ_INSERT_TAIL(&hsl_head, he2, list);
} }
Lck_Unlock(&hsl_mtx); Lck_Unlock(&hsl_mtx);
return (nobj); return (noh);
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment