[SOUP] Return early in ResourceHandle::receivedCancellation if the load has already...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Dec 2013 08:34:32 +0000 (08:34 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Dec 2013 08:34:32 +0000 (08:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=126287

Reviewed by Martin Robinson.

This situation can happen when using the network process, because
the ReceivedCancellation message can be received when the resource
loader has already been removed, but the authentication challenge
still has a reference to the ResourceHandleClient.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::receivedCancellation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161179 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp

index 2d08a33..8b7e497 100644 (file)
@@ -1,5 +1,20 @@
 2013-12-31  Carlos Garcia Campos  <cgarcia@igalia.com>
 
+        [SOUP] Return early in ResourceHandle::receivedCancellation if the load has already cancelled
+        https://bugs.webkit.org/show_bug.cgi?id=126287
+
+        Reviewed by Martin Robinson.
+
+        This situation can happen when using the network process, because
+        the ReceivedCancellation message can be received when the resource
+        loader has already been removed, but the authentication challenge
+        still has a reference to the ResourceHandleClient.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::ResourceHandle::receivedCancellation):
+
+2013-12-31  Carlos Garcia Campos  <cgarcia@igalia.com>
+
         [SOUP] The initiating page is lost after a redirection
         https://bugs.webkit.org/show_bug.cgi?id=126293
 
index 04eecde..ae471b7 100644 (file)
@@ -1263,6 +1263,13 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
     if (challenge != d->m_currentWebChallenge)
         return;
 
+    if (cancelledOrClientless()) {
+        clearAuthentication();
+        return;
+    }
+
+    ASSERT(challenge.soupSession());
+    ASSERT(challenge.soupMessage());
     soup_session_unpause_message(challenge.soupSession(), challenge.soupMessage());
 
     if (client())