[Curl] Deadlock when downloading.
authorpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Sep 2015 17:33:19 +0000 (17:33 +0000)
committerpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Sep 2015 17:33:19 +0000 (17:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149596

Reviewed by Alex Christensen.

Avoid grabbing the same lock twice.

* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::init):
(WebCore::CurlDownload::addHeaders):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/curl/CurlDownload.cpp

index 23690ff..6de3de7 100644 (file)
@@ -1,3 +1,16 @@
+2015-09-28  Per Arne Vollan  <peavo@outlook.com>
+
+        [Curl] Deadlock when downloading.
+        https://bugs.webkit.org/show_bug.cgi?id=149596
+
+        Reviewed by Alex Christensen.
+
+        Avoid grabbing the same lock twice.
+
+        * platform/network/curl/CurlDownload.cpp:
+        (WebCore::CurlDownload::init):
+        (WebCore::CurlDownload::addHeaders):
+
 2015-09-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         An SVG inherits the container size of the previously drawn HTMLImageElement when drawing it on a canvas
index 809cf08..475a69a 100644 (file)
@@ -297,8 +297,6 @@ void CurlDownload::init(CurlDownloadListener* listener, ResourceHandle*, const R
     if (!listener)
         return;
 
-    LockHolder locker(m_mutex);
-
     URL url(ParsedURLString, request.url());
 
     init(listener, url);
@@ -366,6 +364,8 @@ void CurlDownload::writeDataToFile(const char* data, int size)
 
 void CurlDownload::addHeaders(const ResourceRequest& request)
 {
+    LockHolder locker(m_mutex);
+
     if (request.httpHeaderFields().size() > 0) {
         struct curl_slist* headers = 0;