gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1963-g63de409
Date: Sun, 27 Apr 2014 15:51:30 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  63de409c6d337fc0e5dea9ec98b85e09038757ca (commit)
       via  0e2ee544d45f8eb8e91084ef8d620c3006ef486a (commit)
       via  cfde161e29ed74cd6213955ce735421a774f2078 (commit)
      from  370ddcaf880c5001534cb229fbeb026ddced4f21 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=63de409c6d337fc0e5dea9ec98b85e09038757ca


commit 63de409c6d337fc0e5dea9ec98b85e09038757ca
Author: Bastiaan Jacques <address@hidden>
Date:   Sun Apr 27 17:45:49 2014 +0200

    Savannah #42199: avoid thrashing the stack in case of a high fd by
    using poll() instead of select().

diff --git a/plugin/npapi/pluginScriptObject.cpp 
b/plugin/npapi/pluginScriptObject.cpp
index 29d1408..22033bd 100644
--- a/plugin/npapi/pluginScriptObject.cpp
+++ b/plugin/npapi/pluginScriptObject.cpp
@@ -20,18 +20,8 @@
 #include "gnashconfig.h"
 #endif
 
-#include <iostream>
-#include <fstream>
-#include <sstream>
 #include <map>
 #include <string>
-#include <fcntl.h>
-#include <cstring>
-#include <cstdlib>
-#include <cstdio>
-#include <cerrno>
-#include <sys/types.h>
-#include <unistd.h>
 #if defined(HAVE_WINSOCK_H) && !defined(__OS2__)
 # include <winsock2.h>
 # include <windows.h>
@@ -39,13 +29,9 @@
 # include <io.h>
 # include <ws2tcpip.h>
 #else
-# include <sys/un.h>
 # include <sys/ioctl.h>
 # include <unistd.h>
-# include <sys/select.h>
-# include <netinet/in.h>
-# include <arpa/inet.h>
-# include <sys/socket.h>
+# include <poll.h>
 #endif
 #include "npapi.h"
 #include "npruntime.h"
@@ -703,8 +689,6 @@ GnashPluginScriptObject::readPlayer()
 std::string
 GnashPluginScriptObject::readPlayer(int fd)
 {
-//    log_debug(__PRETTY_FUNCTION__);
-
     std::string empty;
 
     if (fd <= 0) {
@@ -714,31 +698,33 @@ GnashPluginScriptObject::readPlayer(int fd)
 
     // Wait for some data from the player
     int bytes = 0;
-    fd_set fdset;
-    FD_ZERO(&fdset);
-    FD_SET(fd, &fdset);
-    struct timeval tval;
-    tval.tv_sec = 2;
-    tval.tv_usec = 0;
-    // log_debug("Waiting for data... ");
-    if (select(fd+1, &fdset, NULL, NULL, &tval)) {
-        // log_debug("There is data in the network");
-#ifndef _WIN32
-        ioctl(fd, FIONREAD, &bytes);
-#else
-        ioctlSocket(fd, FIONREAD, &bytes);
-#endif
-    }
+
+    pollfd pfds[1] = { pollfd() };
+    pfds[0].fd = fd;
+    pfds[0].events = POLLIN;
+
+    int rv = poll(pfds, 1 /* arraySize */, 1000 /* ms */);
 
     // No data yet
-    if (bytes == 0) {
+    if (rv <= 0) {
         return empty;
     }
 
+#ifndef _WIN32
+    ioctl(fd, FIONREAD, &bytes);
+#else
+    ioctlSocket(fd, FIONREAD, &bytes);
+#endif
+
     log_debug("There are %d bytes in the network buffer", bytes);
 
+    if (bytes <= 0) {
+        return empty;
+    }
+
     std::string buf(bytes, '\0');
 
+    // FIXME: writing into string data buffers is an undefined operation.
     int ret = ::read(fd, &buf[0], bytes);
     if (ret <= 0) {
         return empty;

http://git.savannah.gnu.org/cgit//commit/?id=0e2ee544d45f8eb8e91084ef8d620c3006ef486a


commit 0e2ee544d45f8eb8e91084ef8d620c3006ef486a
Author: Bastiaan Jacques <address@hidden>
Date:   Sat Apr 26 01:41:47 2014 +0200

    Remove unused variable.

diff --git a/libbase/RTMP.cpp b/libbase/RTMP.cpp
index 068fc11..a8b0998 100644
--- a/libbase/RTMP.cpp
+++ b/libbase/RTMP.cpp
@@ -497,9 +497,6 @@ RTMP::readPacketHeader(RTMPPacket& packet)
         return false;
     }
 
-    // nSize is predicted size - 1. Add what we've read already.
-    int hSize = nSize + (header - hbuf);
-
     if (nSize >= 3) {
 
         const boost::uint32_t timestamp = decodeInt24(header);
@@ -542,8 +539,6 @@ RTMP::readPacketHeader(RTMPPacket& packet)
               return false;
             }
           hr._timestamp = amf::readNetworkLong(header+nSize);
-          hSize += 4;
-        
     }
         
     const size_t bufSize = hr.dataSize + RTMPHeader::headerSize;

http://git.savannah.gnu.org/cgit//commit/?id=cfde161e29ed74cd6213955ce735421a774f2078


commit cfde161e29ed74cd6213955ce735421a774f2078
Author: Bastiaan Jacques <address@hidden>
Date:   Fri Apr 25 23:31:18 2014 +0200

    Remove unused header.

diff --git a/librender/GnashTexture.h b/librender/GnashTexture.h
index 7df7a0e..4e3ab8d 100644
--- a/librender/GnashTexture.h
+++ b/librender/GnashTexture.h
@@ -22,7 +22,6 @@
 #define GNASH_GNASHTEXTURE_H
 
 #include "GnashImage.h"
-#include <boost/shared_ptr.hpp>
 
 namespace gnash {
 

-----------------------------------------------------------------------

Summary of changes:
 libbase/RTMP.cpp                    |    5 ---
 librender/GnashTexture.h            |    1 -
 plugin/npapi/pluginScriptObject.cpp |   52 +++++++++++++----------------------
 3 files changed, 19 insertions(+), 39 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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