checking socket connect state before sending final packet and calling shutdown (to...
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 7 May 2008 14:40:50 +0000 (14:40 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 7 May 2008 14:40:50 +0000 (14:40 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1317 9efc2488-bf62-4759-914b-345cdb29e865

src/perlmods/OpenSRF/Transport/SlimJabber/XMPPReader.pm

index b0705ab..086a7a6 100644 (file)
@@ -136,8 +136,10 @@ sub connect {
 
 sub disconnect {
     my $self = shift;
-    $self->send(JABBER_DISCONNECT); 
-    shutdown($self->socket, 2);
+    if($self->tcp_connected) {
+        $self->send(JABBER_DISCONNECT); 
+        shutdown($self->socket, 2);
+    }
     close($self->socket);
 }