don't set stream state to disconnected on a non-stream error.
[OpenSRF.git] / src / perl / lib / OpenSRF / Transport / SlimJabber / XMPPReader.pm
index 086a7a6..1e60f70 100644 (file)
@@ -136,6 +136,7 @@ sub connect {
 
 sub disconnect {
     my $self = shift;
+    return unless $self->socket;
     if($self->tcp_connected) {
         $self->send(JABBER_DISCONNECT); 
         shutdown($self->socket, 2);
@@ -287,7 +288,6 @@ sub start_element {
     } elsif($name eq 'error') {
         $self->{message}->{err_type} = $attrs{'type'};
         $self->{message}->{err_code} = $attrs{'code'};
-        $self->{stream_state} = DISCONNECTED;
     }
 }