mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 17:43:14 +00:00
Report on bad session ids
If an authorized user tries to use a session id that isn't recognized (for example, a laptop coming out of suspend), cleanly return error rather than traceback.
This commit is contained in:
parent
1b6c258934
commit
0e84935876
@ -217,12 +217,18 @@ def resourcehandler(env, start_response):
|
||||
for idx in xrange(0, len(querydict['keys']), 2):
|
||||
input += chr(int(querydict['keys'][idx:idx+2],16))
|
||||
sessid = querydict['session']
|
||||
if sessid not in consolesessions:
|
||||
start_response('400 Expired Session', headers)
|
||||
return
|
||||
consolesessions[sessid]['expiry'] = time.time() + 90
|
||||
consolesessions[sessid]['session'].write(input)
|
||||
start_response('200 OK', headers)
|
||||
return # client has requests to send or receive, not both...
|
||||
else: #no keys, but a session, means it's hooking to receive data
|
||||
sessid = querydict['session']
|
||||
if sessid not in consolesessions:
|
||||
start_response('400 Expired Session', headers)
|
||||
return
|
||||
consolesessions[sessid]['expiry'] = time.time() + 90
|
||||
outdata = consolesessions[sessid]['session'].get_next_output(timeout=45)
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user