cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re[3]: Cookies

From: Anton Fedorov <datacompboy_at_call2ru.com>
Date: Fri, 22 Feb 2008 23:43:17 +0600

Hello, Anton.

Your wrote 22 февраля 2008 г. 18:29:00:

DS>> You'd need to use the share interface to make multiple easy handles share cookies.
AF> O!!! But... there no share interface binding for perl :(
AF> Many thanks for pointing :) going to make share bind, and some fixes.
Ok, have made WWW::Curl::Share.
But, can't get it working right...
What correct sequence of calls?
i'm do:

 my $curl = WWW::Curl::Easy->new();
 my $curl2 = WWW::Curl::Easy->new();
 my $share = WWW::Curl::Share->new();
 $curl2->setopt(CURLOPT_DEBUGFUNCTION, \&debug_callback);
 $curl2->setopt(CURLOPT_VERBOSE, 1);
 $curl->setopt(CURLOPT_URL, $url);
 $curl2->setopt(CURLOPT_URL, $url);
 my $retcode=$curl->perform();
 if ($retcode != 0) {
    print "# perform = $retcode ".$curl->strerror($retcode)."\n";
    print "not ";
 }
 print "ok ".++$count."\n";

 $retcode=$curl2->perform();
 if ($retcode != 0) {
     print "not ";
 }
 print "ok ".++$count."\n";

 print "not " unless ($cookies);
 print "ok ".++$count."\n";

  and i'm get cookies on curl->perform, but no cookies sent on
 curl2->perform.

 Where I can miss ?

And, http://curl.haxx.se/libcurl/c/curl_share_setopt.html here
described only CURL_LOCK_DATA_COOKIE and CURL_LOCK_DATA_DNS, but in
curl.h there more values:

       CURL_LOCK_DATA_COOKIE
       CURL_LOCK_DATA_DNS
       CURL_LOCK_DATA_SSL_SESSION
       CURL_LOCK_DATA_CONNECT
is them for future use, or just not described?

-- 
Best regards,
 Anton
 Call2Ru service
 datacompboy_at_call2ru.com

  • application/pgp-signature attachment: stored
Received on 2008-02-22