bug-wget
[Top][All Lists]
Advanced

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

[Bug-wget] [PATCH 7/8] Remove defensive assert in cookies.c


From: Darshit Shah
Subject: [Bug-wget] [PATCH 7/8] Remove defensive assert in cookies.c
Date: Sat, 22 Nov 2014 14:52:21 +0530

---
 src/ChangeLog | 5 +++++
 src/cookies.c | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 4a2b1b9..c0d6466 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
 2014-11-22  Darshit Shah  <address@hidden>
 
+       * cookies.c (discard_matching_cookie): Replace defensive assert with a
+       logical check and error message
+
+2014-11-22  Darshit Shah  <address@hidden>
+
        * wget.h: Make extern declaration for program_argstring.
        * warc.c: Remove extern declaration
        * test.c: Make program_argstring a char *, instead of const char *.
diff --git a/src/cookies.c b/src/cookies.c
index 365f8d5..aaec52b 100644
--- a/src/cookies.c
+++ b/src/cookies.c
@@ -304,7 +304,13 @@ discard_matching_cookie (struct cookie_jar *jar, struct 
cookie *cookie)
 
           res = hash_table_get_pair (jar->chains, victim->domain,
                                      &chain_key, NULL);
-          assert (res != 0);
+
+          if (res == 0)
+            {
+              logprintf (LOG_VERBOSE, _("Unable to get cookie for %s"),
+                         victim->domain);
+              DEBUGP(("Cookie details not found in Hash Table."));
+            }
           if (!victim->next)
             {
               /* VICTIM was the only cookie in the chain.  Destroy the
-- 
2.1.3




reply via email to

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