Rename self.client to self.request, ie adapt to:
>commit b9e1295f7a
> Prepare for solving https://github.com/kanaka/websockify/issues/71:
>
> Rename self.client to self.request, since this is what standard
> SocketServer request handlers are using.
This commit is contained in:
parent
95593ac4bf
commit
09f3ec7125
|
|
@ -28,21 +28,21 @@ class WebSocketEcho(WebSocketServer):
|
||||||
cqueue = []
|
cqueue = []
|
||||||
c_pend = 0
|
c_pend = 0
|
||||||
cpartial = ""
|
cpartial = ""
|
||||||
rlist = [self.client]
|
rlist = [self.request]
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
wlist = []
|
wlist = []
|
||||||
|
|
||||||
if cqueue or c_pend: wlist.append(self.client)
|
if cqueue or c_pend: wlist.append(self.request)
|
||||||
ins, outs, excepts = select.select(rlist, wlist, [], 1)
|
ins, outs, excepts = select.select(rlist, wlist, [], 1)
|
||||||
if excepts: raise Exception("Socket exception")
|
if excepts: raise Exception("Socket exception")
|
||||||
|
|
||||||
if self.client in outs:
|
if self.request in outs:
|
||||||
# Send queued target data to the client
|
# Send queued target data to the client
|
||||||
c_pend = self.send_frames(cqueue)
|
c_pend = self.send_frames(cqueue)
|
||||||
cqueue = []
|
cqueue = []
|
||||||
|
|
||||||
if self.client in ins:
|
if self.request in ins:
|
||||||
# Receive client data, decode it, and send it back
|
# Receive client data, decode it, and send it back
|
||||||
frames, closed = self.recv_frames()
|
frames, closed = self.recv_frames()
|
||||||
cqueue.extend(frames)
|
cqueue.extend(frames)
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class WebSocketLoad(WebSocketServer):
|
||||||
self.recv_cnt = 0
|
self.recv_cnt = 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.responder(self.client)
|
self.responder(self.request)
|
||||||
except:
|
except:
|
||||||
print "accumulated errors:", self.errors
|
print "accumulated errors:", self.errors
|
||||||
self.errors = 0
|
self.errors = 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue