put back Version.pm, auto update to difficult
[spider.git] / perl / DXChannel.pm
index 958fe61860b3cb69122df0101fe8741c6afcc805..a000e17ac4657159c5a212514cf9c31a1320a53f 100644 (file)
@@ -699,17 +699,14 @@ sub broadcast_list
 sub process
 {
        foreach my $dxchan (get_all()) {
-
+               next if $dxchan->{disconnecting};
+               
                while (my $data = shift @{$dxchan->{inqueue}}) {
                        my ($sort, $call, $line) = $dxchan->decode_input($data);
                        next unless defined $sort;
 
                        # do the really sexy console interface bit! (Who is going to do the TK interface then?)
                        dbg("<- $sort $call $line") if $sort ne 'D' && isdbg('chan');
-                       if ($dxchan->{disconnecting}) {
-                               dbg('In disconnection, ignored');
-                               next;
-                       }
 
                        # handle A records
                        my $user = $dxchan->user;
@@ -746,6 +743,16 @@ sub handle_xml
        return $r;
 }
 
+sub error_handler
+{
+       my $self = shift;
+       my $error = shift || '';
+       dbg("$self->{call} ERROR '$error', closing") if isdbg('chan');
+       $self->{conn}->set_error(undef) if exists $self->{conn};
+       $self->disconnect(1);
+}
+
+
 #no strict;
 sub AUTOLOAD
 {