]> err.no Git - varnish/commitdiff
Retire the crc32_2s() function.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 26 Jun 2007 09:37:18 +0000 (09:37 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 26 Jun 2007 09:37:18 +0000 (09:37 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1575 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_session.c
varnish-cache/include/libvarnish.h
varnish-cache/lib/libvarnish/crc32.c

index 390f270fd69dc213c6d8762ae0db5ea18b1151e9..a2c3799ca08c2832be5c0c552a9c9cbc3b3f17e5 100644 (file)
@@ -127,7 +127,7 @@ SES_RefSrcAddr(struct sess *sp)
                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);
index e500c0c5f2e7e6201d5a098d5651de02dd49327a..981fb309a5a9fc44225f0c2b9e64439230d3470f 100644 (file)
@@ -42,7 +42,6 @@ void FreeArgv(char **argv);
 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 */
index 7856fbdfe9e6bf58e580559ad3d3d23805e04f48..c63cab620a1bcdc9a7e49e2b0ab437b9191aa9c3 100644 (file)
@@ -81,22 +81,6 @@ static uint32_t crc32bits[] = {
     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)
 {