added some more diagnostic logging
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 21 Apr 2006 13:04:47 +0000 (13:04 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 21 Apr 2006 13:04:47 +0000 (13:04 +0000)
if we have no data to send to the unixserver, we don't try

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@703 9efc2488-bf62-4759-914b-345cdb29e865

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

index 2bae137..81240bc 100644 (file)
@@ -144,23 +144,33 @@ sub listen {
                my $sock = $self->unix_sock();
                my $o;
 
+               $logger->debug("Inbound listener calling process()");
+
                try {
                        $o = $self->process( -1 );
 
+                       $logger->debug("Inbound listener received ".length($o)." bytes of data");
+
+                       if(!$o){$logger->error(
+                               "Inbound received no data from the Jabber socket in process()")}
+
                } catch OpenSRF::EX::JabberDisconnected with {
+
                        $logger->error("Inbound process lost its ".
                                "jabber connection.  Attempting to reconnect...");
                        $self->initialize;
+                       $o = undef;
                };
 
-               if(defined $o) {
+
+               if($o) {
                        my $socket = IO::Socket::UNIX->new( Peer => $sock  );
-                       throw OpenSRF::EX::Socket( "Unable to connect to UnixServer: socket-file: $sock \n :=> $! " )
+                       throw OpenSRF::EX::Socket( 
+                               "Unable to connect to UnixServer: socket-file: $sock \n :=> $! " )
                                unless ($socket->connected);
                        print $socket $o;
                        $socket->close;
-               }
-
+               } 
        }
 
        throw OpenSRF::EX::Socket( "How did we get here?!?!" );