Fixes: #12963
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
while True:
char = self.sock.recv(1)
+
+ # Break if we could not read from the socket
+ if not char:
+ raise EOFError("Could not read from socket")
+
+ # Append to buffer
buf.append(char)
# Reached end of line
self._client_event(line)
# Terminate the daemon when it loses its connection to the OpenVPN daemon
- except ConnectionResetError as e:
+ except (ConnectionResetError, EOFError) as e:
log.error("Connection to OpenVPN has been lost: %s" % e)
log.info("OpenVPN Authenticator terminated")