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)