Commit 47cba392 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Rename some objhead pointers from obj to oh for consistency.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3403 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent cb076931
......@@ -137,7 +137,7 @@ HSH_Freestore(struct object *o)
}
int
HSH_Compare(const struct sess *sp, const struct objhead *obj)
HSH_Compare(const struct sess *sp, const struct objhead *oh)
{
int i;
unsigned u, v;
......@@ -145,11 +145,11 @@ HSH_Compare(const struct sess *sp, const struct objhead *obj)
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(obj, OBJHEAD_MAGIC);
i = sp->lhashptr - obj->hashlen;
CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
i = sp->lhashptr - oh->hashlen;
if (i)
return (i);
b = obj->hash;
b = oh->hash;
for (u = 0; u < sp->ihashptr; u += 2) {
v = pdiff(sp->hashptr[u], sp->hashptr[u + 1]);
i = memcmp(sp->hashptr[u], b, v);
......@@ -162,18 +162,21 @@ HSH_Compare(const struct sess *sp, const struct objhead *obj)
}
assert(*b == '\0');
b++;
assert(b == obj->hash + obj->hashlen);
assert(b == oh->hash + oh->hashlen);
return (0);
}
void
HSH_Copy(const struct sess *sp, const struct objhead *obj)
HSH_Copy(const struct sess *sp, const struct objhead *oh)
{
unsigned u, v;
char *b;
assert(obj->hashlen >= sp->lhashptr);
b = obj->hash;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
assert(oh->hashlen >= sp->lhashptr);
b = oh->hash;
for (u = 0; u < sp->ihashptr; u += 2) {
v = pdiff(sp->hashptr[u], sp->hashptr[u + 1]);
memcpy(b, sp->hashptr[u], v);
......@@ -181,7 +184,7 @@ HSH_Copy(const struct sess *sp, const struct objhead *obj)
*b++ = '#';
}
*b++ = '\0';
assert(b <= obj->hash + obj->hashlen);
assert(b <= oh->hash + oh->hashlen);
}
struct object *
......
......@@ -116,13 +116,13 @@ hsl_lookup(const struct sess *sp, struct objhead *noh)
*/
static int
hsl_deref(const struct objhead *obj)
hsl_deref(const struct objhead *oh)
{
struct hsl_entry *he;
int ret;
AN(obj->hashpriv);
he = obj->hashpriv;
AN(oh->hashpriv);
he = oh->hashpriv;
Lck_Lock(&hsl_mtx);
if (--he->refcnt == 0) {
VTAILQ_REMOVE(&hsl_head, he, list);
......
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