From a947a1d88b1616a4eca3f8e7937c45932f1dc52c Mon Sep 17 00:00:00 2001 From: Safihre Date: Mon, 14 May 2018 11:07:48 +0200 Subject: [PATCH] Always send NNTP QUIT after server-test --- sabnzbd/utils/servertests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sabnzbd/utils/servertests.py b/sabnzbd/utils/servertests.py index 234af67..5468915 100644 --- a/sabnzbd/utils/servertests.py +++ b/sabnzbd/utils/servertests.py @@ -119,8 +119,12 @@ def test_nntp_server(host, port, server=None, username=None, password=None, ssl= nw.clear_data() nw.recv_chunk(block=True) except: + # Some internal error, not always safe to close connection return False, unicode(sys.exc_info()[1]) + # Close the connection + nw.terminate(quit=True) + if nw.status_code == '480': return False, T('Server requires username and password.') @@ -136,5 +140,3 @@ def test_nntp_server(host, port, server=None, username=None, password=None, ssl= else: return False, T('Could not determine connection result (%s)') % nntp_to_msg(nw.data) - # Close the connection - nw.terminate(quit=True)