return;
}
AZ(sp->srcaddr);
- u = crc32_2s(sp->addr, "");
+ u = crc32_l(sp->addr, strlen(sp->addr));
v = u % nsrchash;
ch = &srchash[v];
CHECK_OBJ(ch, SRCADDRHEAD_MAGIC);
char **ParseArgv(const char *s, int comment);
/* from libvarnish/crc32.c */
-uint32_t crc32_2s(const char *p1, const char *p2);
uint32_t crc32_l(const void *p1, unsigned l);
/* from libvarnish/time.c */
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
};
-uint32_t
-crc32_2s(const char *p1, const char *p2)
-{
- const unsigned char *p;
- uint32_t crc;
-
- crc = ~0U;
-
- for (p = (const unsigned char*)p1; *p != '\0'; p++)
- crc = (crc >> 8) ^ crc32bits[(crc ^ *p) & 0xff];
- for (p = (const unsigned char*)p2; *p != '\0'; p++)
- crc = (crc >> 8) ^ crc32bits[(crc ^ *p) & 0xff];
-
- return (crc ^ ~0U);
-}
-
uint32_t
crc32_l(const void *p1, unsigned l)
{