diff --git a/src/ChangeLog b/src/ChangeLog index c0d64666..51ce88b0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-11-22 Darshit Shah <darnir@gmail.com> + + * hosts.c (address_list_set_faulty): Add a helpful error message for when a + logical assumption fails + 2014-11-22 Darshit Shah <darnir@gmail.com> * cookies.c (discard_matching_cookie): Replace defensive assert with a diff --git a/src/host.c b/src/host.c index 904650bc..14380e5b 100644 --- a/src/host.c +++ b/src/host.c @@ -151,6 +151,13 @@ 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: %d\n", index, al->faulty); + logprintf (LOG_ALWAYS, _("Error in handling the address list.\n")); + logprintf (LOG_ALWAYS, _("Please report this issue to bug-wget@gnu.org\n")); + abort(); + } ++al->faulty; if (al->faulty >= al->count)