X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fgline.c;h=3ca7e1a682760be649f126eb2dfb236a21cd30f3;hb=4a2c9aa9ab119a212d78c6a3a73261de56800251;hp=dab6954ca58076ab159181f2c585e0f1988ee9c4;hpb=eab92374e96aaa3faae341d4a0b8cc3fd0102ebd;p=srvx.git diff --git a/src/gline.c b/src/gline.c index dab6954..3ca7e1a 100644 --- a/src/gline.c +++ b/src/gline.c @@ -93,7 +93,7 @@ delete_gline_for_p(UNUSED_ARG(void *key), void *data, void *extra) static void gline_expire(UNUSED_ARG(void *data)) { - time_t stopped; + unsigned long stopped; void *wraa; stopped = 0; @@ -135,7 +135,7 @@ gline_remove(const char *target, int announce) } struct gline * -gline_add(const char *issuer, const char *target, unsigned long duration, const char *reason, time_t issued, time_t lastmod, int announce) +gline_add(const char *issuer, const char *target, unsigned long duration, const char *reason, unsigned long issued, unsigned long lastmod, int announce) { struct gline *ent; struct gline *prev_first; @@ -146,7 +146,7 @@ gline_add(const char *issuer, const char *target, unsigned long duration, const ent = dict_find(gline_dict, target, NULL); if (ent) { heap_remove_pred(gline_heap, gline_for_p, (char*)target); - if (ent->expires < (time_t)(now + duration)) + if (ent->expires < now + duration) ent->expires = now + duration; if (ent->lastmod < lastmod) ent->lastmod = lastmod; @@ -162,8 +162,8 @@ gline_add(const char *issuer, const char *target, unsigned long duration, const } heap_insert(gline_heap, ent, ent); if (!prev_first || (ent->expires < prev_first->expires)) { - timeq_del(0, gline_expire, 0, TIMEQ_IGNORE_WHEN|TIMEQ_IGNORE_DATA); - timeq_add(ent->expires, gline_expire, 0); + timeq_del(0, gline_expire, 0, TIMEQ_IGNORE_WHEN|TIMEQ_IGNORE_DATA); + timeq_add(ent->expires, gline_expire, 0); } if (announce) irc_gline(NULL, ent); @@ -255,15 +255,15 @@ gline_add_record(const char *key, void *data, UNUSED_ARG(void *extra)) { struct record_data *rd = data; const char *issuer, *reason, *dstr; - time_t issued, expiration, lastmod; + unsigned long issued, expiration, lastmod; if (!(reason = database_get_data(rd->d.object, KEY_REASON, RECDB_QSTRING))) { - log_module(MAIN_LOG, LOG_ERROR, "Missing reason for gline %s", key); - return 0; + log_module(MAIN_LOG, LOG_ERROR, "Missing reason for gline %s", key); + return 0; } if (!(dstr = database_get_data(rd->d.object, KEY_EXPIRES, RECDB_QSTRING))) { - log_module(MAIN_LOG, LOG_ERROR, "Missing expiration for gline %s", key); - return 0; + log_module(MAIN_LOG, LOG_ERROR, "Missing expiration for gline %s", key); + return 0; } expiration = strtoul(dstr, NULL, 0); dstr = database_get_data(rd->d.object, KEY_LASTMOD, RECDB_QSTRING);