Skip to content

Commit

Permalink
debug stack logging for client
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Oct 27, 2015
1 parent 1658fa0 commit b16b711
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/netius/base/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,20 @@ def on_read(self, _socket):
error_v = error.args[0] if error.args else None
if error_v in SSL_SILENT_ERRORS:
self.debug(error)


self.log_stack()

elif not error_v in SSL_VALID_ERRORS:
self.warning(error)
self.log_stack()
except socket.error as error:
error_v = error.args[0] if error.args else None
if error_v in SILENT_ERRORS:
self.debug(error)

self.log_stack()

elif not error_v in VALID_ERRORS:
self.warning(error)
self.log_stack()
Expand All @@ -207,13 +214,21 @@ def on_write(self, _socket):
error_v = error.args[0] if error.args else None
if error_v in SSL_SILENT_ERRORS:
self.debug(error)



self.log_stack()

elif not error_v in SSL_VALID_ERRORS:
self.warning(error)
self.log_stack()
except socket.error as error:
error_v = error.args[0] if error.args else None
if error_v in SILENT_ERRORS:
self.debug(error)

self.log_stack()

elif not error_v in VALID_ERRORS:
self.warning(error)
self.log_stack()
Expand Down Expand Up @@ -642,6 +657,9 @@ def on_read(self, _socket):
error_v = error.args[0] if error.args else None
if error_v in SSL_SILENT_ERRORS:
self.debug(error)

self.log_stack()

connection.close()
elif not error_v in SSL_VALID_ERRORS:
self.warning(error)
Expand All @@ -651,6 +669,9 @@ def on_read(self, _socket):
error_v = error.args[0] if error.args else None
if error_v in SILENT_ERRORS:
self.debug(error)

self.log_stack()

connection.close()
elif not error_v in VALID_ERRORS:
self.warning(error)
Expand Down Expand Up @@ -681,6 +702,10 @@ def on_write(self, _socket):
error_v = error.args[0] if error.args else None
if error_v in SSL_SILENT_ERRORS:
self.debug(error)

self.log_stack()


connection.close()
elif not error_v in SSL_VALID_ERRORS:
self.warning(error)
Expand All @@ -690,6 +715,10 @@ def on_write(self, _socket):
error_v = error.args[0] if error.args else None
if error_v in SILENT_ERRORS:
self.debug(error)


self.log_stack()

connection.close()
elif not error_v in VALID_ERRORS:
self.warning(error)
Expand Down

0 comments on commit b16b711

Please sign in to comment.