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: Sun, 25 Feb 2007 20:30:56 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/02/25 20:30:56

Modified files:
        .              : ChangeLog 
        libbase        : curl_adapter.cpp 

Log message:
                * libbase/curl_adapter.cpp: implemented seek_to_end
                  for curl-based stream.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2467&r2=1.2468
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/curl_adapter.cpp?cvsroot=gnash&r1=1.21&r2=1.22

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2467
retrieving revision 1.2468
diff -u -b -r1.2467 -r1.2468
--- ChangeLog   25 Feb 2007 19:02:02 -0000      1.2467
+++ ChangeLog   25 Feb 2007 20:30:56 -0000      1.2468
@@ -1,5 +1,7 @@
 2007-02-25 Sandro Santilli <address@hidden>
 
+       * libbase/curl_adapter.cpp: implemented seek_to_end 
+         for curl-based stream.
        * server/as_object.cpp (enumerateProperties):
          Fix wrong 'this_ptr' send to PropertyList::enumerateKeyValue()
 

Index: libbase/curl_adapter.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/curl_adapter.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- libbase/curl_adapter.cpp    22 Feb 2007 16:36:13 -0000      1.21
+++ libbase/curl_adapter.cpp    25 Feb 2007 20:30:56 -0000      1.22
@@ -16,7 +16,7 @@
 
 // 
 
-/* $Id: curl_adapter.cpp,v 1.21 2007/02/22 16:36:13 strk Exp $ */
+/* $Id: curl_adapter.cpp,v 1.22 2007/02/25 20:30:56 strk Exp $ */
 
 #if defined(_WIN32) || defined(WIN32)
 #define snprintf _snprintf
@@ -122,6 +122,9 @@
        /// Put read pointer at given position
        bool seek(size_t pos);
 
+       /// Put read pointer at eof
+       bool seek_to_end();
+
 private:
 
        void init(const std::string& url);
@@ -469,6 +472,33 @@
 
 }
 
+/*public*/
+bool
+CurlStreamFile::seek_to_end()
+{
+       CURLMcode mcode;
+       while (_running)
+       {
+               do
+               {
+                       mcode=curl_multi_perform(_mhandle, &_running);
+               } while ( mcode == CURLM_CALL_MULTI_PERFORM );
+               
+               if ( mcode != CURLM_OK )
+               {
+                       throw gnash::GnashException(curl_multi_strerror(mcode));
+               }
+       }
+
+       if ( fseek(_cache, 0, SEEK_END) == -1 ) {
+               fprintf(stderr, "Warning: fseek to end failed\n");
+               return false;
+       } else {
+               return true;
+       }
+
+}
+
 /***********************************************************************
  *
  * Adapter calls
@@ -507,10 +537,11 @@
 }
 
 static int
-seek_to_end(void* /*appdata*/)
+seek_to_end(void* appdata)
 {
-       assert(0); // not supported
-       return 0;
+       CurlStreamFile* stream = (CurlStreamFile*) appdata;
+       if ( stream->seek_to_end() ) return 0;
+       else return TU_FILE_SEEK_ERROR;
 }
 
 static int




reply via email to

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