first attempt at fixing ssh/sh escaping problem with perl_command - works but isn...
[scpubgit/Object-Remote.git] / lib / Object / Remote / ReadChannel.pm
index 6b27348..6bfc369 100644 (file)
@@ -33,7 +33,7 @@ sub _receive_data_from {
   Dlog_trace { "Preparing to read data from $_" } $fh;
   my $rb = $self->_receive_data_buffer;
   my $len = sysread($fh, $$rb, 32768, length($$rb));
-  my $err = defined($len) ? '' : ": $!";
+  my $err = defined($len) ? 'eof' : ": $!";
   if (defined($len) and $len > 0) {
     log_trace { "Read $len bytes of data" };
     while (my $cb = $self->on_line_call and $$rb =~ s/^(.*)\n//) {
@@ -49,6 +49,7 @@ sub _receive_data_from {
                       handle => $self->fh,
                       on_read_ready => 1
                     );
+    log_trace { "Invoking on_close_call() for dead read channel" };
     $self->on_close_call->($err);
   }
 }