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


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

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/10/31 10:04:34

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&r1=1.1454&r2=1.1455
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/noseek_fd_adapter.cpp?cvsroot=gnash&r1=1.8&r2=1.9

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1454
retrieving revision 1.1455
diff -u -b -r1.1454 -r1.1455
--- ChangeLog   31 Oct 2006 09:46:07 -0000      1.1454
+++ ChangeLog   31 Oct 2006 10:04:33 -0000      1.1455
@@ -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.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- libbase/noseek_fd_adapter.cpp       29 Oct 2006 18:34:11 -0000      1.8
+++ libbase/noseek_fd_adapter.cpp       31 Oct 2006 10:04:34 -0000      1.9
@@ -16,7 +16,7 @@
 
 // 
 
-/* $Id: noseek_fd_adapter.cpp,v 1.8 2006/10/29 18:34:11 rsavoye Exp $ */
+/* $Id: noseek_fd_adapter.cpp,v 1.9 2006/10/31 10:04:34 strk Exp $ */
 
 #if defined(_WIN32) || defined(WIN32)
 #define snprintf _snprintf
@@ -226,13 +226,19 @@
 
        char* buf = new char[bytes_needed];
        size_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]