Commit Diff
Diff:
f6fb606b0ebf42cb8c2566e471014b24764abefe
9c31b73467dc4c2071872a0f1cd050362718de2f
Commit:
9c31b73467dc4c2071872a0f1cd050362718de2f
Tree:
96a009937083697134ad80e78497da70f57cb143
Author:
pbug <pbug@delphinusdns.org>
Committer:
pbug <pbug@delphinusdns.org>
Date:
Sun Mar 14 08:25:29 2010 UTC
Message:
* if we can't update the zone for X tries syslog it and exit, this is better than spinning forever
blob - a7196518bfd38fe66e692518a197b45a7f3df03d
blob + 22800f6c57d4f1b9bbe66dd8f60f60967b6ee141
--- reply.c
+++ reply.c
@@ -49,7 +49,7 @@ extern int additional_ptr(char *, int, struct domain *
void update_db(DB *, struct domain *);
-static const char rcsid[] = "$Id: reply.c,v 1.14 2010/03/13 20:20:44 pbug Exp $";
+static const char rcsid[] = "$Id: reply.c,v 1.15 2010/03/14 08:25:29 pbug Exp $";
/*
* REPLY_A() - replies a DNS question (*q) on socket (so)
@@ -1708,10 +1708,16 @@ void
update_db(DB *db, struct domain *sd)
{
int ret;
+ int i = 0;
DBT key, data;
do {
+ if (++i == 32) {
+ syslog(LOG_ERR, "could not update zone for 32 tries, giving up entire database, quit");
+ exit(1);
+ }
+
memset(&key, 0, sizeof(key));
memset(&data, 0, sizeof(data));
repomaster@centroid.eu