From 28e0bef90b23932c0d473fdbcdf5af78c21dff06 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 22 May 2006 18:18:32 +0000 Subject: [PATCH] added error message for cached data on a closed socket git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@721 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm b/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm index 075afcf..e646fc1 100644 --- a/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm +++ b/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm @@ -578,7 +578,7 @@ sub flush_socket { my $self = shift; my $socket = $self->{_socket}; - if( $socket and $socket->connected() ) { + if( $socket ) { my $buf; my $flags = fcntl($socket, F_GETFL, 0); @@ -586,9 +586,14 @@ sub flush_socket { fcntl($socket, F_SETFL, $flags | O_NONBLOCK); while( my $n = sysread( $socket, $buf, 8192 ) ) { $logger->debug("flush_socket dropped $n bytes of data"); + if(!$socket->connected()) { + $logger->error("flush_socket dropped data on disconnected socket: $buf"); + } } fcntl($socket, F_SETFL, $flags); + return 0 unless $socket->connected(); + return 1; } else { -- 2.11.0