Ticket #13042: 0001-Fix-13042-Make-sure-all-cookies-are-saved.patch

File 0001-Fix-13042-Make-sure-all-cookies-are-saved.patch, 1.4 KB (added by markh, 8 years ago)
  • src/kits/network/libnetapi/NetworkCookieJar.cpp

    From 0d472990e7d3b657f2fc5a4211f5ed8a5e72224a Mon Sep 17 00:00:00 2001
    From: Mark Hellegers <mark@firedisk.net>
    Date: Sun, 30 Oct 2016 15:30:50 +0000
    Subject: [PATCH] Fix #13042: Make sure all cookies are saved
    
    ---
     src/kits/network/libnetapi/NetworkCookieJar.cpp | 14 ++++++++++++++
     1 file changed, 14 insertions(+)
    
    diff --git a/src/kits/network/libnetapi/NetworkCookieJar.cpp b/src/kits/network/libnetapi/NetworkCookieJar.cpp
    index 677cdb2..c94e0a1 100644
    a b BNetworkCookieJar::Iterator::NextDomain()  
    603603        fList = *fIterator->fCookieMapIterator.NextValue();
    604604        fList->LockForReading();
    605605
     606        while (fList->CountItems() == 0 && fIterator->fCookieMapIterator.HasNext()) {
     607            // Empty list. Skip it
     608            fList->Unlock();
     609            fList = *fIterator->fCookieMapIterator.NextValue();
     610            fList->LockForReading();
     611        }
     612
    606613        fCookieJar->fCookieHashMap->Unlock();
    607614    }
    608615
    BNetworkCookieJar::Iterator::_FindNext()  
    686693        fList = *(fIterator->fCookieMapIterator.NextValue());
    687694        fList->LockForReading();
    688695
     696        while (fList->CountItems() == 0 && fIterator->fCookieMapIterator.HasNext()) {
     697            // Empty list. Skip it
     698            fList->Unlock();
     699            fList = *fIterator->fCookieMapIterator.NextValue();
     700            fList->LockForReading();
     701        }
     702
    689703        fCookieJar->fCookieHashMap->Unlock();
    690704    }
    691705