gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r10009: don't try to remove a pollfd


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r10009: don't try to remove a pollfd from a bogus hit.
Date: Sat, 21 Feb 2009 16:08:01 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10009
committer: address@hidden
branch nick: rtmp
timestamp: Sat 2009-02-21 16:08:01 -0700
message:
  don't try to remove a pollfd from a bogus hit.
modified:
  cygnal/cygnal.cpp
=== modified file 'cygnal/cygnal.cpp'
--- a/cygnal/cygnal.cpp 2009-02-21 18:57:24 +0000
+++ b/cygnal/cygnal.cpp 2009-02-21 23:08:01 +0000
@@ -667,25 +667,29 @@
                    if ((it->revents & POLLRDHUP) || (it->revents & POLLNVAL))  
{
                        log_debug("Revents has a POLLRDHUP or POLLNVAL set to 
%d for fd #%d",
                                  it->revents, it->fd);
-                       net->erasePollFD(it->fd);
-                       net->closeNet(it->fd);
+                       if (it->fd > 0) {
+                           net->erasePollFD(it->fd);
+                           net->closeNet(it->fd);
+                       }
 //                     continue;
                        break;
                    } else {
                        // We got some data, so process it
                        log_debug("Got something on fd #%d, 0x%x", it->fd, 
it->revents);
-                       // Call the protocol handler for this network connection
-                       bool ret = net->getEntry(it->fd)(args);
+                       if (it->fd > 0) {
+                           // Call the protocol handler for this network 
connection
+                           bool ret = net->getEntry(it->fd)(args);
                        
 //                     log_debug("Handler returned %s", (ret) ? "true" : 
"false");
-                       // FIXME: we currently force a 'close connection' at 
the end
-                       // of sending a file, since apache does too. This 
pretty much
-                       // blows persistance,
+                           // FIXME: we currently force a 'close connection' 
at the end
+                           // of sending a file, since apache does too. This 
pretty much
+                           // blows persistance,
 //                     if (ret) {
                            networks[args->tid] = 0;
                            net->closeNet(it->fd);
                            net->erasePollFD(it->fd);
 //                     }
+                       }
                    }
                }
            } catch (std::exception& e) {


reply via email to

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