wsproxy.py: python2.4 fixes.
This commit is contained in:
parent
c32e00c67f
commit
66937e399a
|
@ -23,7 +23,7 @@ except:
|
||||||
from urlparse import urlsplit
|
from urlparse import urlsplit
|
||||||
from cgi import parse_qsl
|
from cgi import parse_qsl
|
||||||
|
|
||||||
class WebSocketServer():
|
class WebSocketServer(object):
|
||||||
"""
|
"""
|
||||||
WebSockets server class.
|
WebSockets server class.
|
||||||
Must be sub-classed with new_client method definition.
|
Must be sub-classed with new_client method definition.
|
||||||
|
@ -344,6 +344,7 @@ Connection: Upgrade\r
|
||||||
signal.signal(signal.SIGINT, self.do_SIGINT)
|
signal.signal(signal.SIGINT, self.do_SIGINT)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
try:
|
||||||
try:
|
try:
|
||||||
csock = startsock = None
|
csock = startsock = None
|
||||||
pid = err = 0
|
pid = err = 0
|
||||||
|
@ -359,10 +360,10 @@ Connection: Upgrade\r
|
||||||
except Exception, exc:
|
except Exception, exc:
|
||||||
if hasattr(exc, 'errno'):
|
if hasattr(exc, 'errno'):
|
||||||
err = exc.errno
|
err = exc.errno
|
||||||
elif type(exc) == select.error:
|
else:
|
||||||
err = exc[0]
|
err = exc[0]
|
||||||
if err == errno.EINTR:
|
if err == errno.EINTR:
|
||||||
self.vmsg("Ignoring interrupted syscall()")
|
self.vmsg("Ignoring interrupted syscall")
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
@ -388,6 +389,7 @@ Connection: Upgrade\r
|
||||||
self.msg("handler exception: %s" % str(exc))
|
self.msg("handler exception: %s" % str(exc))
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
self.msg(traceback.format_exc())
|
self.msg(traceback.format_exc())
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
if csock and csock != startsock:
|
if csock and csock != startsock:
|
||||||
csock.close()
|
csock.close()
|
||||||
|
|
Loading…
Reference in New Issue