Revert "openvpn-authenticator: Avoid infinite loop when losing socket connection"

This reverts commit 92a9ce54bc.
This commit is contained in:
Peter Müller
2022-12-13 15:27:30 +00:00
parent 6d4110d214
commit 6619aed611

View File

@@ -104,16 +104,11 @@ class OpenVPNAuthenticator(object):
log.info("OpenVPN Authenticator started")
try:
while True:
line = self._read_line()
while True:
line = self._read_line()
if line.startswith(">CLIENT"):
self._client_event(line)
# Terminate the daemon when it loses its connection to the OpenVPN daemon
except ConnectionResetError as e:
log.error("Connection to OpenVPN has been lost: %s" % e)
if line.startswith(">CLIENT"):
self._client_event(line)
log.info("OpenVPN Authenticator terminated")
@@ -262,7 +257,7 @@ class OpenVPNAuthenticator(object):
@staticmethod
def _b64decode(s):
return base64.b64decode(s.encode()).decode()
@staticmethod
def _escape(s):
return s.replace(" ", "\ ")