2 patches for setting CURLOPT_COOKIEFILE and CURLOPT_COOKIE options in libcurl

203 views
Skip to first unread message

chuyeow

unread,
Jun 11, 2009, 4:46:16 AM6/11/09
to Curb - Ruby libcurl Bindings
Hi there,

I've been trying to use some of the cookie-related arguments to curl
in Curb but they seem to be missing from the current implementation.
I've written 2 patches in my fork and hopefully a commiter can review
them.

This first one is a way to replicate this curl command:
curl -b cookies-to-send.txt www.example.com

http://curl.haxx.se/libcurl/c/curl_easy_setopt.html says that
CURLOPT_COOKIEFILE is the option I'm looking for so I added this to
Curb in my fork - see commit http://github.com/chuyeow/curb/commit/99c71de50e1106a99244f09b5d4dbdee4febcddc

The other patch is to add a way to replicate this curl command.
curl -b "name1=content1; name2=content2;" www.example.com
where "name1" and "name2" are cookie names to send with the request.

This corresponds to the CURLOPT_COOKIE option in libcurl, and I've
added a way to access it in this commit
http://github.com/chuyeow/curb/commit/f5992da9be30d401f0acc4a0715e76bcb1f6e6e4

Would appreciate a review and tests. I'm using this in a scraper type
project I'm coding right now.


Cheers,
Chu Yeow

Todd Fisher

unread,
Jun 13, 2009, 11:37:09 AM6/13/09
to curb---ruby-li...@googlegroups.com
Hi thanks for the patches!  I've added them to my branch and will make them available to rubyforge shortly.

chuyeow

unread,
Jun 17, 2009, 12:58:31 AM6/17/09
to Curb - Ruby libcurl Bindings
Hi Todd,

Thanks for committing my patches!

I think the latest changes haven't been pushed to Rubyforge though,
when you get a chance could you check it out? Totally not urgent, just
thought you should know. Thanks!

Cheers,
Chu Yeow

On Jun 13, 11:37 pm, Todd Fisher <todd.fis...@gmail.com> wrote:
> Hi thanks for the patches!  I've added them to my branch and will make them
> available to rubyforge shortly.
>
> On Thu, Jun 11, 2009 at 4:46 AM, chuyeow <chuy...@gmail.com> wrote:
>
> > Hi there,
>
> > I've been trying to use some of the cookie-related arguments to curl
> > in Curb but they seem to be missing from the current implementation.
> > I've written 2 patches in my fork and hopefully a commiter can review
> > them.
>
> > This first one is a way to replicate this curl command:
> >  curl -b cookies-to-send.txtwww.example.com
>
> >http://curl.haxx.se/libcurl/c/curl_easy_setopt.htmlsays that
> > CURLOPT_COOKIEFILE is the option I'm looking for so I added this to
> > Curb in my fork - see commit
> >http://github.com/chuyeow/curb/commit/99c71de50e1106a99244f09b5d4dbde...
>
> > The other patch is to add a way to replicate this curl command.
> >  curl -b "name1=content1; name2=content2;"www.example.com
> > where "name1" and "name2" are cookie names to send with the request.
>
> > This corresponds to the CURLOPT_COOKIE option in libcurl, and I've
> > added a way to access it in this commit
>
> >http://github.com/chuyeow/curb/commit/f5992da9be30d401f0acc4a0715e76b...

Todd Fisher

unread,
Jun 17, 2009, 3:16:43 PM6/17/09
to curb---ruby-li...@googlegroups.com
Hi Chu,

  Thanks, for the reminder - have a new release out now 0.3.7 includes your changes as well as addresses a potential bus error in Curl::Multi.   It also includes additional libcurl error codes.

-Todd

Thufir

unread,
Jan 31, 2010, 8:21:27 PM1/31/10
to chuyeow, THUFIR HAWAT, curb---ruby-li...@googlegroups.com
what's the syntax for creating a cookie with multiple properties,
please?

-Thufir

On Jun 11 2009, 12:46 am, chuyeow <chuy...@gmail.com> wrote:
> Hi there,
>

> I've been trying to use some of thecookie-related arguments to curl


> in Curb but they seem to be missing from the current implementation.
> I've written 2 patches in my fork and hopefully a commiter can review
> them.
>
> This first one is a way to replicate this curl command:
>   curl -b cookies-to-send.txtwww.example.com
>

> http://curl.haxx.se/libcurl/c/curl_easy_setopt.htmlsays that


> CURLOPT_COOKIEFILE is the option I'm looking for so I added this to

> Curb in my fork - see commithttp://github.com/chuyeow/curb/commit/99c71de50e1106a99244f09b5d4dbde...


>
> The other patch is to add a way to replicate this curl command.
>   curl -b "name1=content1; name2=content2;"www.example.com

> where "name1" and "name2" arecookienames to send with the request.


>
> This corresponds to the CURLOPT_COOKIE option in libcurl, and I've

> added a way to access it in this commithttp://github.com/chuyeow/curb/commit/f5992da9be30d401f0acc4a0715e76b...

Reply all
Reply to author
Forward
0 new messages