summaryrefslogtreecommitdiff
path: root/tests/libtest/lib506.c
diff options
context:
space:
mode:
authorBenjamin Gilbert <bgilbert@backtick.net>2013-06-17 23:28:35 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-06-17 23:28:35 +0200
commit03a3dd9ee39e2ca4eea101360ae976e13586c01a (patch)
tree168d4e6b5c5b5b20dde2e961a756a07f5daf7302 /tests/libtest/lib506.c
parent5fc24a5297e642a2e7056ac670398556928fd49a (diff)
downloadcurl-03a3dd9ee39e2ca4eea101360ae976e13586c01a.tar.gz
test506: verify that CURLOPT_COOKIELIST takes share lock
It doesn't right now: http://curl.haxx.se/bug/view.cgi?id=1215
Diffstat (limited to 'tests/libtest/lib506.c')
-rw-r--r--tests/libtest/lib506.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c
index 4477eaa50..bddda128c 100644
--- a/tests/libtest/lib506.c
+++ b/tests/libtest/lib506.c
@@ -202,6 +202,32 @@ int test(char *URL)
return TEST_ERR_MAJOR_BAD;
}
+ /* initial cookie manipulation */
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_share_cleanup(share);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+ printf( "CURLOPT_SHARE\n" );
+ test_setopt( curl, CURLOPT_SHARE, share );
+ printf( "CURLOPT_COOKIELIST injected_and_clobbered\n" );
+ test_setopt( curl, CURLOPT_COOKIELIST,
+ "Set-Cookie: injected_and_clobbered=yes; "
+ "domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030" );
+ printf( "CURLOPT_COOKIELIST ALL\n" );
+ test_setopt( curl, CURLOPT_COOKIELIST, "ALL" );
+ printf( "CURLOPT_COOKIELIST session\n" );
+ test_setopt( curl, CURLOPT_COOKIELIST, "Set-Cookie: session=elephants" );
+ printf( "CURLOPT_COOKIELIST injected\n" );
+ test_setopt( curl, CURLOPT_COOKIELIST,
+ "Set-Cookie: injected=yes; domain=host.foo.com; "
+ "expires=Sat Feb 2 11:56:27 GMT 2030" );
+ printf( "CURLOPT_COOKIELIST SESS\n" );
+ test_setopt( curl, CURLOPT_COOKIELIST, "SESS" );
+ printf( "CLEANUP\n" );
+ curl_easy_cleanup( curl );
+
res = 0;
@@ -238,6 +264,8 @@ int test(char *URL)
test_setopt( curl, CURLOPT_SHARE, share );
printf( "CURLOPT_COOKIEJAR\n" );
test_setopt( curl, CURLOPT_COOKIEJAR, JAR );
+ printf( "CURLOPT_COOKIELIST FLUSH\n" );
+ test_setopt( curl, CURLOPT_COOKIELIST, "FLUSH" );
printf( "PERFORM\n" );
curl_easy_perform( curl );