curl-library
Deadlock in "FLUSH" with curl share interface
Date: Sun, 13 Jul 2014 12:03:40 +0900
Hi,
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. This condition occurs deadlock.
Attached as "fix_deadlock.patch" is to fix this issue.
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".
These two patches are made from curl 7.36.0.
Please check it.
Thanks,
Yousuke
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- application/octet-stream attachment: fix_deadlock.patch
- application/octet-stream attachment: add_loadcmd.patch