projects
/
srvx.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify G-line code somewhat. Generate better output for ?gtrace print.
[srvx.git]
/
src
/
gline.c
diff --git
a/src/gline.c
b/src/gline.c
index 0b2ed9bb36f25d4ea6e1c5ef137f0aee7a8beb6a..a1cb2504ea81e790e2e5c509dc54ab38d349207c 100644
(file)
--- a/
src/gline.c
+++ b/
src/gline.c
@@
-72,10
+72,9
@@
free_gline(struct gline *ent)
}
static int
}
static int
-gline_
for
_p(UNUSED_ARG(void *key), void *data, void *extra)
+gline_
equal
_p(UNUSED_ARG(void *key), void *data, void *extra)
{
{
- struct gline *ge = data;
- return !irccasecmp(ge->target, extra);
+ return data == extra;
}
static void
}
static void
@@
-125,13
+124,15
@@
gline_add(const char *issuer, const char *target, unsigned long duration, const
lifetime = expires;
ent = dict_find(gline_dict, target, NULL);
if (ent) {
lifetime = expires;
ent = dict_find(gline_dict, target, NULL);
if (ent) {
- heap_remove_pred(gline_heap, gline_for_p, (char*)target);
+ heap_remove_pred(gline_heap, gline_equal_p, ent);
+ if (ent->issued > lastmod)
+ ent->issued = lastmod;
+ if (ent->lastmod < lastmod)
+ ent->lastmod = lastmod;
if (ent->expires != expires)
ent->expires = expires;
if (ent->lifetime < lifetime)
ent->lifetime = lifetime;
if (ent->expires != expires)
ent->expires = expires;
if (ent->lifetime < lifetime)
ent->lifetime = lifetime;
- if (ent->lastmod < lastmod)
- ent->lastmod = lastmod;
if (strcmp(ent->issuer, issuer)) {
free(ent->issuer);
ent->issuer = strdup(issuer);
if (strcmp(ent->issuer, issuer)) {
free(ent->issuer);
ent->issuer = strdup(issuer);