gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r9760: Add a CLOSED state, that unlik


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9760: Add a CLOSED state, that unlike NO_STATE is for a file that has been handled
Date: Fri, 21 Nov 2008 09:39:45 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9760
committer: address@hidden
branch nick: rtmp
timestamp: Fri 2008-11-21 09:39:45 -0700
message:
  Add a CLOSED state, that unlike NO_STATE is for a file that has been handled
  already.
  Actually close the disk file descriptor so Cygnal doesn't run out of file
  descriptors.
  Improve debug messages for easier grepping.
modified:
  libnet/diskstream.cpp
  libnet/diskstream.h
=== modified file 'libnet/diskstream.cpp'
--- a/libnet/diskstream.cpp     2008-11-20 20:57:02 +0000
+++ b/libnet/diskstream.cpp     2008-11-21 16:39:45 +0000
@@ -123,13 +123,22 @@
 DiskStream::close()
 {
 //    GNASH_REPORT_FUNCTION;
+
+    log_debug("Closing %s on fd #%d", _filespec, _filefd);
+
+    if (_filefd) {
+        ::close(_filefd);
+    }
+    
     _filesize = 0;
     _offset = 0;
     if ((_dataptr != MAP_FAILED) && (_dataptr != 0)) {
        munmap(_dataptr, _pagesize);
     }
     _dataptr = 0;
-    _filespec.clear();
+    _filefd = 0;
+    _state == CLOSED;
+//    _filespec.clear();
 }
 
 /// \brief Load a chunk (pagesize) of the file into memory.
@@ -312,7 +321,7 @@
        _filesize = st.st_size;
        boost::mutex::scoped_lock lock(io_mutex);
        _filefd = ::open(filespec.c_str(), O_RDONLY);
-       log_debug (_("File %s is %lld bytes in size."), filespec,
+       log_debug (_("Opening file %s (fd #%d), %lld bytes in size."), 
filespec, _filefd,
                 (long long int) _filesize);
     } else {
        log_error (_("File %s doesn't exist"), filespec);

=== modified file 'libnet/diskstream.h'
--- a/libnet/diskstream.h       2008-11-20 20:57:02 +0000
+++ b/libnet/diskstream.h       2008-11-21 16:39:45 +0000
@@ -46,6 +46,7 @@
     ///                This represents the state of the current stream.
     typedef enum {
         NO_STATE,
+       CLOSED,
         OPEN,
         PLAY,
         PREVIEW,


reply via email to

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