This commit is contained in:
Bennett Kanuka 2015-05-13 20:04:38 +00:00
commit 1633c0534d
1 changed files with 10 additions and 3 deletions

View File

@ -11,12 +11,12 @@ as taken from http://docs.python.org/dev/library/ssl.html#certificates
''' '''
import signal, socket, optparse, time, os, sys, subprocess, logging import signal, socket, optparse, time, os, sys, subprocess, logging, errno
try: from socketserver import ForkingMixIn try: from socketserver import ForkingMixIn
except: from SocketServer import ForkingMixIn except: from SocketServer import ForkingMixIn
try: from http.server import HTTPServer try: from http.server import HTTPServer
except: from BaseHTTPServer import HTTPServer except: from BaseHTTPServer import HTTPServer
from select import select import select
from websockify import websocket from websockify import websocket
try: try:
from urllib.parse import parse_qs, urlparse from urllib.parse import parse_qs, urlparse
@ -133,7 +133,14 @@ Traffic Legend:
if tqueue: wlist.append(target) if tqueue: wlist.append(target)
if cqueue or c_pend: wlist.append(self.request) if cqueue or c_pend: wlist.append(self.request)
ins, outs, excepts = select(rlist, wlist, [], 1) try:
ins, outs, excepts = select.select(rlist, wlist, [], 1)
except select.error, err:
if err[0] != errno.EINTR:
raise
else:
continue
if excepts: raise Exception("Socket exception") if excepts: raise Exception("Socket exception")
if self.request in outs: if self.request in outs: