/hg/icedtea-web: Fix possible endless loop while waiting for the...

meyert at icedtea.classpath.org meyert at icedtea.classpath.org
Thu Jul 19 10:18:45 PDT 2012


changeset d6e1139ec7d9 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=d6e1139ec7d9
author: Thomas Meyer <thomas at m3y3r.de>
date: Thu Jul 19 18:44:51 2012 +0200

	Fix possible endless loop while waiting for the applet object instance to get create get created


diffstat:

 ChangeLog                                                |   6 ++++++
 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java |  11 ++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diffs (36 lines):

diff -r 01544fb82384 -r d6e1139ec7d9 ChangeLog
--- a/ChangeLog	Wed Jul 11 16:18:58 2012 +0200
+++ b/ChangeLog	Thu Jul 19 18:44:51 2012 +0200
@@ -1,3 +1,9 @@
+2012-07-18  Thomas Meyer  <thomas at m3y3r.de>
+
+	* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (handleMessage):
+	Fix possible endless loop while waiting for the applet object instance to 
+	get created.
+
 2012-07-11  Jiri Vanek  <jvanek at redhat.com>
 
 	try to close browser before kill it
diff -r 01544fb82384 -r d6e1139ec7d9 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Thu Jul 19 18:44:51 2012 +0200
@@ -745,9 +745,18 @@
             long maxTimeToSleep = APPLET_TIMEOUT;
             panelLock.lock();
             try {
-                while (panel == null || !panel.isAlive())
+                while (panel == null || !panel.isAlive()) {
                     maxTimeToSleep -= waitTillTimeout(panelLock, panelLive,
                                                       maxTimeToSleep);
+
+                    /* we already waited till timeout, give up here directly,
+                     *  instead of waiting 180s again in below waitForAppletInit()
+                     */
+                    if(maxTimeToSleep < 0) {
+                        streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization timed out");
+                        return;
+                    }
+                }
             }
             finally {
                 panelLock.unlock();



More information about the distro-pkg-dev mailing list