forcing int on timeout values in process and timed_read
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 26 Mar 2007 17:41:51 +0000 (17:41 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 26 Mar 2007 17:41:51 +0000 (17:41 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@853 9efc2488-bf62-4759-914b-345cdb29e865

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

index 1122457..657f719 100644 (file)
@@ -178,6 +178,7 @@ sub set_block {
 
 sub timed_read {
        my ($self, $timeout) = @_;
+    $timeout = defined($timeout) ? int($timeout) : undef;
 
        $logger->transport( "Temp Buffer Contained: \n". $self->{temp_buffer}, INTERNAL) if $self->{temp_buffer};
        if( $self->can( "app" ) ) {
@@ -549,7 +550,8 @@ sub process {
        my( $self, $timeout ) = @_;
 
        $timeout ||= 0;
-       undef $timeout if ( $timeout == -1 );
+    $timeout = int($timeout);
+       undef $timeout if ( $timeout < 0 );
 
        unless( $self->{_socket}->connected ) {
                OpenSRF::EX::JabberDisconnected->throw(