From 86f3e5d5eeec1031d2e801b20f8c6aadb911ebe3 Mon Sep 17 00:00:00 2001 From: mar Date: Mon, 1 Nov 1993 12:06:26 +0000 Subject: [PATCH] added subnets --- server/cache.dc | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/server/cache.dc b/server/cache.dc index a22c0d18..6ee13326 100644 --- a/server/cache.dc +++ b/server/cache.dc @@ -114,6 +114,7 @@ int *id; char *iname; int j, rowcount; EXEC SQL END DECLARE SECTION; + char key; int h, ctr; h = hashname(name, type); @@ -135,8 +136,12 @@ int *id; cachemisses++; iname = name; + key = *type; - switch (*type) { + if (!strcasecmp(type, "subnet")) + key = 'N'; + + switch (key) { case 'U': case 'u': if (index(iname, '@') || (strlen(iname) > 8)) { @@ -153,8 +158,8 @@ int *id; case 'm': EXEC SQL SELECT mach_id INTO :j FROM machine WHERE name=UPPERCASE(:iname); break; - case 'S': - case 's': + case 'N': + case 'n': EXEC SQL SELECT snet_id INTO :j FROM subnet WHERE name=UPPERCASE(:iname); break; case 'C': @@ -222,6 +227,7 @@ char **name; char iname[NAMESZ]; int j, rowcount; EXEC SQL END DECLARE SECTION; + char key; int ctr; for (i = cachehead.next; i != &cachehead; i = i->next) { @@ -240,8 +246,11 @@ char **name; cachemisses++; j = id; + key = *type; + if (!strcasecmp(type, "subnet")) + key = 'N'; - switch (*type) { + switch (key) { case 'U': case 'u': EXEC SQL SELECT CHAR(login) INTO :iname FROM users WHERE users_id=:j; @@ -254,8 +263,8 @@ char **name; case 'm': EXEC SQL SELECT CHAR(name) INTO :iname FROM machine WHERE mach_id=:j; break; - case 'S': - case 's': + case 'N': + case 'n': EXEC SQL SELECT CHAR(name) INTO :iname FROM subnet WHERE snet_id=:j; break; case 'C': -- 2.45.1