<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -128,6 +128,7 @@ void curl_easy_mark(ruby_curl_easy *rbce) {
   rb_gc_mark(rbce-&gt;userpwd);
   rb_gc_mark(rbce-&gt;proxypwd);  
   rb_gc_mark(rbce-&gt;headers);
+  rb_gc_mark(rbce-&gt;cookiefile);
   rb_gc_mark(rbce-&gt;cookiejar);
   rb_gc_mark(rbce-&gt;cert);
   rb_gc_mark(rbce-&gt;encoding);
@@ -190,6 +191,7 @@ static VALUE ruby_curl_easy_new(int argc, VALUE *argv, VALUE klass) {
   rbce-&gt;userpwd = Qnil;
   rbce-&gt;proxypwd = Qnil;
   rbce-&gt;headers = rb_hash_new();
+  rbce-&gt;cookiefile = Qnil;
   rbce-&gt;cookiejar = Qnil;
   rbce-&gt;cert = Qnil;
   rbce-&gt;encoding = Qnil;
@@ -437,10 +439,33 @@ static VALUE ruby_curl_easy_proxypwd_get(VALUE self) {
 
 /*
  * call-seq:
+ *   easy.cookiefile = &quot;cookies.txt&quot;                =&gt; &quot;pwd string&quot;
+ *
+ * Set a file that contains cookies to be sent in subsequent requests by this Curl::Easy instance.
+ * 
+ * *Note* that you must set enable_cookies true to enable the cookie
+ * engine, or this option will be ignored.
+ */
+static VALUE ruby_curl_easy_cookiefile_set(VALUE self, VALUE cookiefile) {
+  CURB_OBJECT_SETTER(ruby_curl_easy, cookiefile);
+}
+
+/*
+ * call-seq:
+ *   easy.cookiefile                                   =&gt; &quot;cookies.txt&quot;&quot;
+ * 
+ * Obtain the cookiefile file for this Curl::Easy instance. 
+ */ 
+static VALUE ruby_curl_easy_cookiefile_get(VALUE self) {
+  CURB_OBJECT_GETTER(ruby_curl_easy, cookiefile);
+}
+
+/*
+ * call-seq:
  *   easy.cookiejar = &quot;cookiejar.file&quot;                =&gt; &quot;pwd string&quot;
  * 
- * Set a cookiejar file to use for this Curl::Easy instance. This file
- * will be used to persist cookies.
+ * Set a cookiejar file to use for this Curl::Easy instance.
+ * Cookies from the response will be written into this file.
  * 
  * *Note* that you must set enable_cookies true to enable the cookie
  * engine, or this option will be ignored.
@@ -1380,6 +1405,10 @@ VALUE ruby_curl_easy_setup( ruby_curl_easy *rbce, VALUE *body_buffer, VALUE *hea
   if (rbce-&gt;enable_cookies) {
     if (rbce-&gt;cookiejar != Qnil) {
       curl_easy_setopt(curl, CURLOPT_COOKIEJAR, StringValuePtr(rbce-&gt;cookiejar));
+    }
+
+    if (rbce-&gt;cookiefile != Qnil) {
+      curl_easy_setopt(curl, CURLOPT_COOKIEFILE, StringValuePtr(rbce-&gt;cookiefile));
     } else {
       curl_easy_setopt(curl, CURLOPT_COOKIEFILE, &quot;&quot;); /* &quot;&quot; = magic to just enable */
     }
@@ -2556,6 +2585,8 @@ void init_curb_easy() {
   rb_define_method(cCurlEasy, &quot;userpwd&quot;, ruby_curl_easy_userpwd_get, 0);
   rb_define_method(cCurlEasy, &quot;proxypwd=&quot;, ruby_curl_easy_proxypwd_set, 1);
   rb_define_method(cCurlEasy, &quot;proxypwd&quot;, ruby_curl_easy_proxypwd_get, 0);
+  rb_define_method(cCurlEasy, &quot;cookiefile=&quot;, ruby_curl_easy_cookiefile_set, 1);
+  rb_define_method(cCurlEasy, &quot;cookiefile&quot;, ruby_curl_easy_cookiefile_get, 0);
   rb_define_method(cCurlEasy, &quot;cookiejar=&quot;, ruby_curl_easy_cookiejar_set, 1);
   rb_define_method(cCurlEasy, &quot;cookiejar&quot;, ruby_curl_easy_cookiejar_get, 0);
   rb_define_method(cCurlEasy, &quot;cert=&quot;, ruby_curl_easy_cert_set, 1);</diff>
      <filename>ext/curb_easy.c</filename>
    </modified>
    <modified>
      <diff>@@ -32,6 +32,7 @@ typedef struct {
   VALUE userpwd;
   VALUE proxypwd;
   VALUE headers;        /* ruby array of strings with headers to set */
+  VALUE cookiefile;     /* filename */
   VALUE cookiejar;      /* filename */
   VALUE cert;
   VALUE encoding;</diff>
      <filename>ext/curb_easy.h</filename>
    </modified>
    <modified>
      <diff>@@ -432,7 +432,14 @@ class TestCurbCurlEasy &lt; Test::Unit::TestCase
     assert c.enable_cookies = true
     assert c.enable_cookies?
   end
-  
+
+  def test_cookiefile
+    c = Curl::Easy.new
+    assert_nil c.cookiefile
+    assert_equal &quot;some.file&quot;, c.cookiefile = &quot;some.file&quot;
+    assert_equal &quot;some.file&quot;, c.cookiefile       
+  end
+
   def test_cookiejar
     c = Curl::Easy.new
     assert_nil c.cookiejar</diff>
      <filename>tests/tc_curl_easy.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ba9a49bf4169b3a29795900a2dba3b2c619dbeb6</id>
    </parent>
  </parents>
  <author>
    <name>Cheah Chu Yeow</name>
    <email>chuyeow@gmail.com</email>
  </author>
  <url>http://github.com/taf2/curb/commit/a4910c25198441796f8e6d1958e144998833c7ec</url>
  <id>a4910c25198441796f8e6d1958e144998833c7ec</id>
  <committed-date>2009-06-13T08:27:45-07:00</committed-date>
  <authored-date>2009-06-07T07:46:59-07:00</authored-date>
  <message>Add a cookiefile option that allows a file that contains cookies to be sent in curl requests.

This is different from the cookiejar setting which tells curl where to store cookies in responses, and augments the enable_cookies setting with a specific file to read cookies from.

Signed-off-by: Todd Fisher &lt;todd.fisher@gmail.com&gt;</message>
  <tree>c243e1f4a1284e6df40d16a14d37b2ae9f9852b6</tree>
  <committer>
    <name>Todd Fisher</name>
    <email>todd.fisher@gmail.com</email>
  </committer>
</commit>
