[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 210/256: cookies: use lock when using CURLINFO_COOK
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 210/256: cookies: use lock when using CURLINFO_COOKIELIST |
Date: |
Fri, 06 Oct 2017 19:45:01 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 5fe85587ccd2d3365540cd652e6a3bb1b0393f3a
Author: Pavel P <address@hidden>
AuthorDate: Mon Sep 18 15:50:16 2017 -0700
cookies: use lock when using CURLINFO_COOKIELIST
Closes #1896
---
lib/cookie.c | 11 ++++++++++-
tests/data/test506 | 16 +++++++++-------
2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/lib/cookie.c b/lib/cookie.c
index 1231882ed..0374f94c1 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -1402,7 +1402,7 @@ static int cookie_output(struct CookieInfo *c, const char
*dumphere)
return 0;
}
-struct curl_slist *Curl_cookie_list(struct Curl_easy *data)
+static struct curl_slist *cookie_list(struct Curl_easy *data)
{
struct curl_slist *list = NULL;
struct curl_slist *beg;
@@ -1433,6 +1433,15 @@ struct curl_slist *Curl_cookie_list(struct Curl_easy
*data)
return list;
}
+struct curl_slist *Curl_cookie_list(struct Curl_easy *data)
+{
+ struct curl_slist *list;
+ Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
+ list = cookie_list(data);
+ Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
+ return list;
+}
+
void Curl_flush_cookies(struct Curl_easy *data, int cleanup)
{
if(data->set.str[STRING_COOKIEJAR]) {
diff --git a/tests/data/test506 b/tests/data/test506
index 40eee2532..70d2daada 100644
--- a/tests/data/test506
+++ b/tests/data/test506
@@ -195,6 +195,8 @@ CURLOPT_COOKIEJAR
CURLOPT_COOKIELIST RELOAD
lock: cookie [Pigs in space]: 78
unlock: cookie [Pigs in space]: 79
+lock: cookie [Pigs in space]: 80
+unlock: cookie [Pigs in space]: 81
loaded cookies:
-----------------
.host.foo.com TRUE / FALSE 1896263787 injected
yes
@@ -207,17 +209,17 @@ loaded cookies:
www.host.foo.com FALSE / FALSE 1993463787 test6 six_more
-----------------
try SHARE_CLEANUP...
-lock: share [Pigs in space]: 80
-unlock: share [Pigs in space]: 81
+lock: share [Pigs in space]: 82
+unlock: share [Pigs in space]: 83
SHARE_CLEANUP failed, correct
CLEANUP
-lock: cookie [Pigs in space]: 82
-unlock: cookie [Pigs in space]: 83
-lock: share [Pigs in space]: 84
-unlock: share [Pigs in space]: 85
-SHARE_CLEANUP
+lock: cookie [Pigs in space]: 84
+unlock: cookie [Pigs in space]: 85
lock: share [Pigs in space]: 86
unlock: share [Pigs in space]: 87
+SHARE_CLEANUP
+lock: share [Pigs in space]: 88
+unlock: share [Pigs in space]: 89
GLOBAL_CLEANUP
</stdout>
<stderr>
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 128/256: mime: tests and examples., (continued)
- [GNUnet-SVN] [gnurl] 128/256: mime: tests and examples., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 146/256: MAIL-ETIQUETTE: added "1.9 Your emails are public", gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 137/256: docs: curl_mime_*.3 man page formatting edits, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 249/256: libcurl-tutorial: add casts in example to avoid compilation warnings., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 130/256: mime: remove support "-" stdin pseudo-file name in curl_mime_filedata()., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 29/256: CURL_SIZEOF_LONG: removed, use only SIZEOF_LONG, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 163/256: mime: drop internal FILE * support., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 145/256: curl.h: fix "unused checksrc ignore", remove dangling reference, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 159/256: mime: fix a trivial warning., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 220/256: tests: make the imap server not verify user+password, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 210/256: cookies: use lock when using CURLINFO_COOKIELIST,
gnunet <=
- [GNUnet-SVN] [gnurl] 208/256: mime:escape_string minor clarification change, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 160/256: openssl: Integrate Peter Wu's SSLKEYLOGFILE implementation, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 177/256: configure: use -Wno-varargs on clang 3.9[.X] debug builds, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 172/256: KNOWN_BUGS: Remove CMake symbol hiding issue, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 213/256: curl: check fseek() return code and bail on error, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 120/256: non-ascii: allow conversion functions to be called with a NULL data handle., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 244/256: libcurl-tutorial: fix two typos., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 205/256: travis: on mac, don't install openssl or libidn, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 247/256: test1153: verify quoted double-qoutes in PWD response, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 228/256: ntlm: move NTLM_NEEDS_NSS_INIT define into core NTLM header, gnunet, 2017/10/06