Skip to content

Commit

Permalink
Close connections with greater paranoia
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Jul 4, 2024
1 parent 71f7a4d commit 61bab49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/zinolib/controllers/zino1.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,15 @@ def authenticate(session, username=None, password=None):

@staticmethod
def close_push_channel(session):
if hasattr(session.push, '_sock'):
if hasattr(session, 'push') and hasattr(session.push, '_sock'):
session.push._sock.close()
session.push = None

@classmethod
def close_session(cls, session):
cls.close_push_channel(session)
session.request.close()
if hasattr(session, 'request'):
session.request.close()
session.request = None
return None

Expand Down

0 comments on commit 61bab49

Please sign in to comment.