quit command for telnet
This commit is contained in:
parent
c672b79523
commit
6f5180ded0
|
@ -704,9 +704,17 @@ def tcp_client_thread(ipaddr,conn):
|
||||||
if s ==-1:
|
if s ==-1:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
c = msg[0:s]
|
c = msg[0:s].strip()
|
||||||
msg = msg[s+1:]
|
msg = msg[s+1:]
|
||||||
|
if c == 'quit':
|
||||||
|
conn.close()
|
||||||
|
close_session(session_id)
|
||||||
|
return
|
||||||
|
try:
|
||||||
c = json.loads(c)
|
c = json.loads(c)
|
||||||
|
except:
|
||||||
|
print "json error", repr(c)
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
cmd = c['method']
|
cmd = c['method']
|
||||||
data = c['params']
|
data = c['params']
|
||||||
|
@ -718,6 +726,7 @@ def tcp_client_thread(ipaddr,conn):
|
||||||
input_queue.put((session_id, cmd, data))
|
input_queue.put((session_id, cmd, data))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# read commands from the input queue. perform requests, etc. this should be called from the main thread.
|
# read commands from the input queue. perform requests, etc. this should be called from the main thread.
|
||||||
def process_input_queue():
|
def process_input_queue():
|
||||||
while not stopping:
|
while not stopping:
|
||||||
|
|
Loading…
Reference in New Issue