bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] [PATCH 8/8] Supplement logical assumption assert with error m


From: Darshit Shah
Subject: [Bug-wget] [PATCH 8/8] Supplement logical assumption assert with error message
Date: Sat, 22 Nov 2014 14:52:22 +0530

---
 src/ChangeLog | 5 +++++
 src/host.c    | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/src/ChangeLog b/src/ChangeLog
index c0d6466..51ce88b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
 2014-11-22  Darshit Shah  <address@hidden>
 
+       * hosts.c (address_list_set_faulty): Add a helpful error message for 
when a
+       logical assumption fails
+
+2014-11-22  Darshit Shah  <address@hidden>
+
        * cookies.c (discard_matching_cookie): Replace defensive assert with a
        logical check and error message
 
diff --git a/src/host.c b/src/host.c
index 904650b..2e9b4f8 100644
--- a/src/host.c
+++ b/src/host.c
@@ -151,6 +151,12 @@ address_list_set_faulty (struct address_list *al, int 
index)
      "faulty" attempt is always preceded with all-faulty addresses,
      and this is how Wget uses it.  */
   assert (index == al->faulty);
+  if (index != al->faulty)
+    {
+      logprintf (LOG_ALWAYS, "index: %d\nal->faulty: %s\n", index, al->faulty);
+      logprintf (LOG_ALWAYS, _("Error in handling the address list.\nPlease 
report this issue to address@hidden"));
+      abort();
+    }
 
   ++al->faulty;
   if (al->faulty >= al->count)
-- 
2.1.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]