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: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2235-gba67fb6
Date: Tue, 15 Dec 2015 08:24:41 +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  ba67fb63be2392e25f3744391d8c6ff9f6d26565 (commit)
      from  45b945d35e701cca19b3e393ca51ce0d12b4691b (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=ba67fb63be2392e25f3744391d8c6ff9f6d26565


commit ba67fb63be2392e25f3744391d8c6ff9f6d26565
Author: Nutchanon Wetchasit <address@hidden>
Date:   Tue Dec 15 09:02:23 2015 +0100

    Make ExternalInterface::readBrowser() wait for return value data.
    
    See bug #46131

diff --git a/libcore/ExternalInterface.cpp b/libcore/ExternalInterface.cpp
index 55c5461..3f24c95 100644
--- a/libcore/ExternalInterface.cpp
+++ b/libcore/ExternalInterface.cpp
@@ -336,13 +336,32 @@ std::string
 ExternalInterface::readBrowser(int fd)
 {
     std::string empty;
-    // Wait for some data from the player
+    fd_set fdset;
+    struct timeval timeout;
+    int fdstatus;
     int bytes = 0;
 
-    ioctlSocket(fd, FIONREAD, &bytes);
+    // Wait for some data from the player
+    FD_ZERO(&fdset);
+    FD_SET(fd, &fdset);
+    timeout.tv_sec = 10;
+    timeout.tv_usec = 0;
+    fdstatus = select(fd + 1, &fdset, nullptr, nullptr, &timeout);
+    if (fdstatus == 0) {
+        // Timed out, return no data
+        log_error("Host container communication timed out\n");
+        return empty;
+    } else if(fdstatus < 0) {
+        // select() failed, return no data
+        log_error("select failed on host container communication: %s",
+                  std::strerror(errno));
+        return empty;
+    }
 
-    // No data yet
+    // Check for the size of available data
+    ioctlSocket(fd, FIONREAD, &bytes);
     if (bytes == 0) {
+        // No more data to read (end of stream, or stream error)
         return empty;
     }
 

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

Summary of changes:
 libcore/ExternalInterface.cpp |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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