gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog libbase/noseek_fd_adapter.cpp [release_0_


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libbase/noseek_fd_adapter.cpp [release_0_7_2]
Date: Tue, 31 Oct 2006 10:03:39 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         release_0_7_2
Changes by:     Sandro Santilli <strk>  06/10/31 10:03:39

Modified files:
        .              : ChangeLog 
        libbase        : noseek_fd_adapter.cpp 

Log message:
                * libbase/noseek_fd_adapter.cpp (fill_cache): fixed compiler
                  warnings, plugged leaks, throw an exception on errro.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.1412.2.20&r2=1.1412.2.21
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/noseek_fd_adapter.cpp?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.6.2.1&r2=1.6.2.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1412.2.20
retrieving revision 1.1412.2.21
diff -u -b -r1.1412.2.20 -r1.1412.2.21
--- ChangeLog   31 Oct 2006 09:42:46 -0000      1.1412.2.20
+++ ChangeLog   31 Oct 2006 10:03:39 -0000      1.1412.2.21
@@ -1,3 +1,8 @@
+2006-10-31 Sandro Santilli <address@hidden>
+
+       * libbase/noseek_fd_adapter.cpp (fill_cache): fixed compiler
+         warnings, plugged leaks, throw an exception on errro.
+
 2006-10-31 Markus Gothe <address@hidden>
 
        * server/shm.h DSOEXPORT ctor and dtor.

Index: libbase/noseek_fd_adapter.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/noseek_fd_adapter.cpp,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -b -r1.6.2.1 -r1.6.2.2
--- libbase/noseek_fd_adapter.cpp       30 Oct 2006 14:28:47 -0000      1.6.2.1
+++ libbase/noseek_fd_adapter.cpp       31 Oct 2006 10:03:39 -0000      1.6.2.2
@@ -16,7 +16,7 @@
 
 // 
 
-/* $Id: noseek_fd_adapter.cpp,v 1.6.2.1 2006/10/30 14:28:47 rsavoye Exp $ */
+/* $Id: noseek_fd_adapter.cpp,v 1.6.2.2 2006/10/31 10:03:39 strk Exp $ */
 
 #if defined(_WIN32) || defined(WIN32)
 #define snprintf _snprintf
@@ -226,13 +226,19 @@
 
        char* buf = new char[bytes_needed];
        ssize_t bytes_read = read(_fd, (void*)buf, bytes_needed);
-       if ( bytes_read == -1 )
+       if ( bytes_read == static_cast<ssize_t>(-1) )
        {
-               fprintf(stderr, "Error reading " SIZET_FMT " bytes from input 
stream",
+               fprintf(stderr,
+                       "Error reading " SIZET_FMT " bytes from input stream",
                        bytes_needed);
+               _running = false;
+               delete [] buf;
+               // this looks like a CRITICAL error (since we don't handle it..)
+               throw gnash::GnashException("Error reading from input stream");
+               return;
        }
 
-       if ( (size_t)bytes_read < bytes_needed )
+       if ( static_cast<size_t>(bytes_read) < bytes_needed )
        {
                if ( bytes_read == 0 )
                {
@@ -240,10 +246,9 @@
                        fprintf(stderr, "EOF reached\n");
 #endif
                        _running = false;
+                       delete [] buf;
                        return;
                }
-               //delete [] buf;
-               //throw gnash::GnashException("short read in fill_cache. EOF 
?");
        }
 
        cache(buf, bytes_read);




reply via email to

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