only add ban timers with a duration lower than 7 days to the timeq (prevent counter...
[NeonServV5.git] / src / timeq.c
index 335032519f52a837b01c9f5e58bce5cc88face4e..7689b316f0fb35d2614c47d1b9ac212d31baa981 100644 (file)
@@ -29,6 +29,7 @@ static IOHANDLER_CALLBACK(timeq_callback) {
     switch(event->type) {
     case IOEVENT_TIMEOUT:
         entry->callback(entry->data);
+        entry->iofd = NULL;
         timeq_del(entry);
         break;
     default:
@@ -92,7 +93,8 @@ int timeq_del(struct timeq_entry* entry) {
         timeq_events = entry->next;
     if(entry->name)
         free(entry->name);
-    iohandler_close(entry->iofd);
+    if(entry->iofd)
+        iohandler_close(entry->iofd);
     free(entry);
     DESYNCHRONIZE(synchronized);
     return 1;