gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog libbase/curl_adapter.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libbase/curl_adapter.cpp
Date: Tue, 27 May 2008 16:45:06 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/05/27 16:45:06

Modified files:
        .              : ChangeLog 
        libbase        : curl_adapter.cpp 

Log message:
        add support for GNASH_COOKIES_IN and GNASH_COOKIES_OUT environment 
variable;
        always enable the libcurl cookie engine.
        
        This will need to be documented, but better test it more first as I 
guess
        it needs to be put in a better shape (like reading just once, writing 
just
        once)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6727&r2=1.6728
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/curl_adapter.cpp?cvsroot=gnash&r1=1.49&r2=1.50

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6727
retrieving revision 1.6728
diff -u -b -r1.6727 -r1.6728
--- ChangeLog   27 May 2008 16:13:14 -0000      1.6727
+++ ChangeLog   27 May 2008 16:45:04 -0000      1.6728
@@ -1,3 +1,9 @@
+2008-05-27 Sandro Santilli <address@hidden>
+
+       * libbase/curl_adapter.cpp (CurlStreamFile::init): add support
+         for GNASH_COOKIES_IN and GNASH_COOKIES_OUT environment variable;
+         always enable the libcurl cookie engine.
+
 2008-05-27 Benjamin Wolsey <address@hidden>
 
        * libbase/container.h, libbase/grid_index.h: drop more dead files.

Index: libbase/curl_adapter.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/curl_adapter.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- libbase/curl_adapter.cpp    8 May 2008 22:37:54 -0000       1.49
+++ libbase/curl_adapter.cpp    27 May 2008 16:45:06 -0000      1.50
@@ -492,6 +492,28 @@
                }
        }
 
+       // Read cookies from file if requested.
+       // TODO: only read the file once, not at every request !
+       const char *cookiein = getenv("GNASH_COOKIES_IN");
+       // Or just enable cookie engine.
+       if ( ! cookiein ) cookiein = "";
+       ccode = curl_easy_setopt(_handle, CURLOPT_COOKIEFILE , cookiein);
+       if ( ccode != CURLE_OK ) {
+               throw gnash::GnashException(curl_easy_strerror(ccode));
+       }
+
+       // Write gathered cookies from file if requested.
+       // TODO: only write the file once, not at every cleanup !
+       const char *cookieout = getenv("GNASH_COOKIES_OUT");
+       if ( cookieout )
+       {
+               // Dump cookies to a file
+               ccode = curl_easy_setopt(_handle, CURLOPT_COOKIEJAR , 
cookieout);
+               if ( ccode != CURLE_OK ) {
+                       throw gnash::GnashException(curl_easy_strerror(ccode));
+               }
+       }
+
        ccode = curl_easy_setopt(_handle, CURLOPT_USERAGENT, "Gnash-" VERSION);
        if ( ccode != CURLE_OK ) {
                throw gnash::GnashException(curl_easy_strerror(ccode));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]