From 03a3dd9ee39e2ca4eea101360ae976e13586c01a Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Mon, 17 Jun 2013 23:28:35 +0200 Subject: test506: verify that CURLOPT_COOKIELIST takes share lock It doesn't right now: http://curl.haxx.se/bug/view.cgi?id=1215 --- tests/libtest/lib506.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests/libtest/lib506.c') 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 ); -- cgit v1.2.3