Fix deadlock patch in "FLUSH" cookie and more
Date: Sun, 13 Jul 2014 08:58:48 +0900
This issue was reported in http://curl.haxx.se/mail/lib-2014-02/0184.html.
Unfortunately the reporter didn't suggest his patch.
This issue is caused by locking CURL_LOCK_DATA_COOKIE with specified cookie files.
In this case, CURL_LOCK_DATA_COOKIE is locked before executing "FLUSH", and then
Curl_cookie_loadfiles locks CURL_LOCK_DATA_COOKIE. That is deadlock.
Attached as "fix_deadlock.patch" is to fix this issue but there is more better
solution to fix it.
In addition, a simple function to load cookie files is needed for Curl library.
When libcurl users just want to load their cookie files, they don't need a "FLUSH"
cookie process. So I suggest that "LOAD" should be added as a new function of
CURLOPT_COOKIELIST. I made a patch attached as "add_loadcmd.patch".
Those two patches are made from curl 7.36.0.
Please check it.
- application/octet-stream attachment: fix_deadlock.patch
- application/octet-stream attachment: add_loadcmd.patch