Reap websockify zombies. Add IE9 fix for websock.js.

Reap websockify zombies. Fixes:
https://github.com/kanaka/noVNC/issues#issue/47. Thanks NeilW.

Changes to get web-socket-js to work with IE9. Right now it's a hack to get
around: https://github.com/gimite/web-socket-js/issues#issue/41. The hack is to
disable caching of the flash objects by appending "?" + Math.random() to the
end of the flash object path (but only when using IE).
This commit is contained in:
Joel Martin 2011-01-31 10:34:42 -06:00
parent 58995c6f10
commit 0a2f850267
3 changed files with 20 additions and 3 deletions

View File

@ -3,3 +3,9 @@
- create gevent version:
http://nichol.as/benchmark-of-python-web-servers
http://n01se.net/paste/QXO
- Need at least libevent-1.4 (i.e. not 9.04 Jaunty)
sudo aptitude install python-dev libevent-dev python-setuptools
sudo easy_install gevent

View File

@ -32,7 +32,11 @@ if (window.WebSocket) {
end = "'><\/script>", extra = "";
WEB_SOCKET_SWF_LOCATION = get_INCLUDE_URI() +
"web-socket-js/WebSocketMain.swf";
"web-socket-js/WebSocketMain.swf?" + Math.random();
if (Util.Engine.trident) {
Util.Debug("Forcing uncached load of WebSocketMain.swf");
WEB_SOCKET_SWF_LOCATION += "?" + Math.random();
}
extra += start + "web-socket-js/swfobject.js" + end;
extra += start + "web-socket-js/FABridge.js" + end;
extra += start + "web-socket-js/web_socket.js" + end;

View File

@ -315,8 +315,15 @@ Connection: Upgrade\r
#self.vmsg("Running poll()")
pass
def top_SIGCHLD(self, sig, stack):
# Reap zombies after calling child SIGCHLD handler
self.do_SIGCHLD(sig, stack)
self.vmsg("Got SIGCHLD, reaping zombies")
os.waitpid(-1, os.WNOHANG)
def do_SIGCHLD(self, sig, stack):
self.vmsg("Got SIGCHLD, ignoring")
pass
def do_SIGINT(self, sig, stack):
self.msg("Got SIGINT, exiting")
@ -345,7 +352,7 @@ Connection: Upgrade\r
self.started() # Some things need to happen after daemonizing
# Reep zombies
signal.signal(signal.SIGCHLD, self.do_SIGCHLD)
signal.signal(signal.SIGCHLD, self.top_SIGCHLD)
signal.signal(signal.SIGINT, self.do_SIGINT)
while True: