Lines 148-158
Link Here
|
148 |
|
148 |
|
149 |
int cache_update(const char *key, const char *mapent, time_t age) |
149 |
int cache_update(const char *key, const char *mapent, time_t age) |
150 |
{ |
150 |
{ |
151 |
struct mapent_cache *me = NULL; |
151 |
struct mapent_cache *s, *me = NULL; |
152 |
char *pkey, *pent; |
152 |
char *pkey, *pent; |
153 |
unsigned int hashval; |
153 |
unsigned int hashval; |
154 |
|
154 |
|
155 |
if ((me = cache_lookup(key)) == NULL) { |
155 |
for (s = mapent_hash[hash(key)]; s != NULL; s = s->next) |
|
|
156 |
if (strcmp(key, s->key) == 0) |
157 |
me = s; |
158 |
|
159 |
if (me == NULL) { |
156 |
me = (struct mapent_cache *) malloc(sizeof(struct mapent_cache)); |
160 |
me = (struct mapent_cache *) malloc(sizeof(struct mapent_cache)); |
157 |
if (me == NULL) { |
161 |
if (me == NULL) { |
158 |
return 0; |
162 |
return 0; |
Lines 348-361
Link Here
|
348 |
"cache_ghost: entry in %s not valid map format, key %s", |
352 |
"cache_ghost: entry in %s not valid map format, key %s", |
349 |
gc.mapname, gc.key); |
353 |
gc.mapname, gc.key); |
350 |
} else if (match == LKP_WILD) { |
354 |
} else if (match == LKP_WILD) { |
351 |
/* Wildcard must be last key in map */ |
|
|
352 |
if (*me->key == '/') |
355 |
if (*me->key == '/') |
353 |
syslog(LOG_NOTICE, |
356 |
syslog(LOG_NOTICE, |
354 |
"cache_ghost: wildcard map key not valid in direct map"); |
357 |
"cache_ghost: wildcard map key not valid in direct map"); |
355 |
else |
358 |
me = me->next; |
356 |
syslog(LOG_NOTICE, |
359 |
continue;; |
357 |
"cache_ghost: cannot ghost wildcard map key"); |
|
|
358 |
break; |
359 |
} |
360 |
} |
360 |
|
361 |
|
361 |
switch (match) { |
362 |
switch (match) { |