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: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog libbase/curl_adapter.cpp
Date: Wed, 28 May 2008 13:52:42 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/05/28 13:52:42

Modified files:
        .              : ChangeLog 
        libbase        : curl_adapter.cpp 

Log message:
                * libbase/curl_adapter.cpp: don't pass _running to
                  curl_multi_info_read (completely wrong). Return from
                  fillCache when enough bytes have been cached.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6740&r2=1.6741
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/curl_adapter.cpp?cvsroot=gnash&r1=1.52&r2=1.53

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6740
retrieving revision 1.6741
diff -u -b -r1.6740 -r1.6741
--- ChangeLog   28 May 2008 11:17:49 -0000      1.6740
+++ ChangeLog   28 May 2008 13:52:41 -0000      1.6741
@@ -1,3 +1,9 @@
+2008-05-28 Benjamin Wolsey <address@hidden>
+
+       * libbase/curl_adapter.cpp: don't pass _running to
+         curl_multi_info_read (completely wrong). Return from
+         fillCache when enough bytes have been cached.
+
 2008-05-28 Udo Giacomozzi <address@hidden>
 
        * backend/render_handler_agg_style.h: fix a bug with alpha-gradients

Index: libbase/curl_adapter.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/curl_adapter.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- libbase/curl_adapter.cpp    28 May 2008 09:36:46 -0000      1.52
+++ libbase/curl_adapter.cpp    28 May 2008 13:52:42 -0000      1.53
@@ -260,7 +260,17 @@
 CurlStreamFile::fillCache(long unsigned size)
 {
 
-       if ( ! _running || _cached >= size ) return;
+#if GNASH_CURL_VERBOSE
+    gnash::log_debug("fillCache(%d), called, currently cached: %d", size, 
_cached);
+#endif 
+
+       if ( ! _running || _cached >= size ) {
+#if GNASH_CURL_VERBOSE
+        if (!_running) gnash::log_debug("Not running: returning");
+        else gnash::log_debug("Already enough bytes cached: returning");
+#endif
+           return;
+       }
 
     fd_set readfd, writefd, exceptfd;
     int maxfd;
@@ -275,7 +285,6 @@
 
                do
                {
-                   //gnash::log_debug("perform!");
                        mcode = curl_multi_perform(_mhandle, &_running);
                } while (mcode == CURLM_CALL_MULTI_PERFORM);
 
@@ -284,6 +293,14 @@
                        throw gnash::GnashException(curl_multi_strerror(mcode));
                }
 
+        // Do this here to avoid calling select() when we have enough
+        // bytes anyway.
+        if (_cached >= size) break;
+
+#if GNASH_CURL_VERBOSE
+        //gnash::log_debug("cached: %d, size: %d", _cached, size);
+#endif
+
         FD_ZERO(&readfd);
         FD_ZERO(&writefd);
         FD_ZERO(&exceptfd);
@@ -297,8 +314,15 @@
             throw gnash::GnashException(curl_multi_strerror(mcode));
         }
 
+#ifdef GNASH_CURL_VERBOSE
+        gnash::log_debug("Max fd: %d", maxfd);
+#endif
+
         // A value of -1 means no file descriptors were added.
-        if (maxfd < 0) break;
+        if (maxfd < 0) {
+            gnash::log_debug("No filedescriptors; breaking");
+            break;
+        }
 
         // Wait for data on the filedescriptors until a timeout set
         // in gnashrc.
@@ -310,7 +334,11 @@
        
        // Does this also decrement the number of active handles (_running)?
        // Should however be no more than one.
-       while ((curl_msg = curl_multi_info_read(_mhandle, &_running))) {
+       
+       // The number of messages left in the queue (not used by us).
+       int msgs;
+       
+       while ((curl_msg = curl_multi_info_read(_mhandle, &msgs))) {
 
                // Only for completed transactions
                if (curl_msg->msg == CURLMSG_DONE) {
@@ -586,7 +614,7 @@
 
        if ( _cached < pos )
        {
-               //fprintf(stderr, "Warning: could not cache anough bytes on 
seek\n");
+               gnash::log_error ("Warning: could not cache anough bytes on 
seek: %d requested, %d cached", pos, _cached);
                return false; // couldn't cache so many bytes
        }
 




reply via email to

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