do not traceback when ft_override_host_to_send is not valid, just ignor and print an error message. Fixes #2231

This commit is contained in:
Yann Leboulanger 2006-08-22 08:02:55 +00:00
parent 3175c9113a
commit bbe93c5b86
1 changed files with 6 additions and 1 deletions

View File

@ -169,7 +169,12 @@ class ConnectionBytestream:
file_props['sha_str'] = sha_str
if not ft_override_host_to_send:
ft_override_host_to_send = self.peerhost[0]
ft_override_host_to_send = socket.gethostbyname(ft_override_host_to_send)
try:
ft_override_host_to_send = socket.gethostbyname(
ft_override_host_to_send)
except socket.gaierror:
self.dispatch('ERROR', (_('Wrong host'), _('The host you configured as the ft_override_host_to_send advanced option is not valid, so ignored.')))
ft_override_host_to_send = self.peerhost[0]
listener = gajim.socks5queue.start_listener(self.peerhost[0], port,
sha_str, self._result_socks5_sid, file_props['sid'])
if listener == None: