]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
db: don't loose one packet on reconnect
authorEric Leblond <eric@regit.org>
Sun, 26 Jan 2014 10:33:54 +0000 (11:33 +0100)
committerEric Leblond <eric@regit.org>
Sun, 26 Jan 2014 10:33:54 +0000 (11:33 +0100)
This patch improves database reconnection handling in ring buffer
mode. Ulogd now redo the failed query and do not loose anymore
one packet.

util/db.c

index 1f74712d6a61aa1f4bc7571a422c2559b17be772..24966a52e097cadcab400ded62b422681e36a6a3 100644 (file)
--- a/util/db.c
+++ b/util/db.c
@@ -590,7 +590,8 @@ static void *__inject_thread(void *gdi)
                                                  "permanently disabling plugin\n");
                                        di->interp = &disabled_interp_db;
                                        return NULL;
-                               }
+                               } else /* try to re run query */
+                                       continue;
                        }
                        *wr_place = RING_NO_QUERY;
                        di->ring.rd_item++;