cURL / Mailing Lists / curl-library / Single Mail

curl-library

Fix deadlock patch in "FLUSH" cookie and more

From: <yousuke.kimoto_at_gmail.com>
Date: Sun, 13 Jul 2014 08:58:48 +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. 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.

Thanks,
Yousuke

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2014-07-13