version 1.9, 2007/03/03 15:35:44 |
version 1.10, 2007/03/04 00:49:24 |
Line 16 if 0; # not running under some shell |
|
Line 16 if 0; # not running under some shell |
|
# Released under the terms of the GNU General Public License v2 |
# Released under the terms of the GNU General Public License v2 |
# |
# |
|
|
|
use Authen::SASL qw(Perl); |
use Net::XMPP; |
use Net::XMPP; |
use Getopt::Long; |
use Getopt::Long; |
use strict; |
use strict; |
Line 400 sub xmpp_logout($) { |
|
Line 401 sub xmpp_logout($) { |
|
# xmpp_check_result: check the return value from some xmpp function execution |
# xmpp_check_result: check the return value from some xmpp function execution |
# input: text, result, [connection] |
# input: text, result, [connection] |
# |
# |
sub xmpp_check_result { |
sub xmpp_check_result |
|
{ |
my ($txt,$res,$cnx)=@_; |
my ($txt, $res, $cnx)=@_; |
|
|
error_exit ("Error '$txt': result undefined") |
error_exit ("Error '$txt': result undefined") |
unless (defined $res); |
unless (defined $res); |
|
|
# res may be 0 |
# res may be 0 |
if ($res == 0) { |
if ($res == 0) { |
debug_print "$txt"; |
debug_print "$txt"; |
# result can be true or 'ok' |
# result can be true or 'ok' |
} elsif ((@$res == 1 && $$res[0]) || $$res[0] eq 'ok') { |
} |
debug_print "$txt: " . $$res[0]; |
elsif ((@$res == 1 && $$res[0]) || $$res[0] eq 'ok') { |
# otherwise, there is some error |
debug_print "$txt: " . $$res[0]; |
} else { |
# otherwise, there is some error |
my $errmsg = $cnx->GetErrorCode() || '?'; |
} |
error_exit ("Error '$txt': " . join (': ',@$res) . "[$errmsg]", $cnx); |
else { |
} |
my $errmsg = $cnx->GetErrorCode() || '?'; |
|
error_exit ("Error '$txt': " . join (': ',@$res) . "[$errmsg]", $cnx); |
|
} |
} |
} |
|
|
|
|