mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-06-06 04:19:42 +00:00
Close on empty read
This commit is contained in:
@@ -60,7 +60,7 @@ B ` '
|
||||
888b R'"B ,', R"'B d888
|
||||
j888888bd8gf"' ':' `"?g8bd888888k
|
||||
R'Y'B .8' d' 'b '8. R'Y'X
|
||||
R!B .8' RdbB d'; ;`b RdbB '8. R!
|
||||
R!B .8' RdbB d'; ;`b RdbB '8. R!B
|
||||
d88 R`'B 8 ; ; 8 R`'B 88b Rbutterfly Zv %sB
|
||||
d888b .g8 ',' 8g. d888b
|
||||
:888888888Y' 'Y888888888: AConnecting to:B
|
||||
@@ -245,13 +245,14 @@ class TermWebSocket(Route, tornado.websocket.WebSocketHandler):
|
||||
try:
|
||||
read = self.reader.read()
|
||||
except IOError:
|
||||
pass
|
||||
read = ''
|
||||
|
||||
self.log.info('READ>%r' % read)
|
||||
if len(read) != 0 and self.ws_connection:
|
||||
self.write_message(read.decode('utf-8', 'replace'))
|
||||
else:
|
||||
self.log.info('READ>%r' % read)
|
||||
if self.ws_connection:
|
||||
self.write_message(read.decode('utf-8', 'replace'))
|
||||
else:
|
||||
events = ioloop.ERROR
|
||||
events = ioloop.ERROR
|
||||
|
||||
if events & ioloop.ERROR:
|
||||
self.log.info('Error on fd, closing')
|
||||
# Terminated
|
||||
|
||||
@@ -87,7 +87,7 @@ class Socket(object):
|
||||
self.user = User(uid=int(line[7]))
|
||||
self.env = get_socket_env(line[9])
|
||||
except Exception:
|
||||
log.debug('procfs was no good, aight')
|
||||
log.debug('procfs was no good, aight', exc_info=True)
|
||||
|
||||
if self.user is None:
|
||||
# Try with lsof
|
||||
@@ -95,7 +95,7 @@ class Socket(object):
|
||||
self.user = User(name=get_lsof_socket_line(
|
||||
self.remote_addr, self.remote_port)[1])
|
||||
except Exception:
|
||||
log.debug('lsof was no good either')
|
||||
log.debug('lsof was no good', exc_info=True)
|
||||
|
||||
@property
|
||||
def local(self):
|
||||
|
||||
Reference in New Issue
Block a user