diff -u sendxmpp-1.14/sendxmpp sendxmpp-1.14.patched/sendxmpp --- sendxmpp-1.14/sendxmpp 2008-12-18 03:37:49.000000000 +0100 +++ sendxmpp-1.14.patched/sendxmpp 2008-12-18 04:47:07.000000000 +0100 @@ -290,14 +290,15 @@ componentname => $comp }; $arghash->{port} = $port if ($port); - if (!$port) { - @res = $cnx->Connect(%$arghash); - error_exit ("Could not connect to server '$host': $@") unless @res; - } else { - @res = $cnx->Connect(%$arghash); - error_exit ("Could not connect to '$host' on port $port: $@") unless @res; - } + @res = $cnx->Connect(%$arghash); + if (!@res) { + my $err = $cnx->GetErrorCode() || $@; + $err = ($err->{'text'} ? $err->{'text'} : $err->{'type'}) unless (ref $err ne "HASH"); + error_exit ("Could not connect to server '$host'" . ($port ? " on port $port" : "") . ($err ? ": $err" : ".")) unless @res; + } + xmpp_check_result("Connect",\@res,$cnx); if ($comp) {