LP#1070466: Print to STDERR in Sip/Checksum::debug_split_print.
authorJason Stephenson <jstephenson@mvlc.org>
Tue, 23 Oct 2012 14:52:21 +0000 (10:52 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 8 Jul 2014 15:46:28 +0000 (08:46 -0700)
debug_split_print was printing to STDOUT, which goes to the client. This
causes the client to hang up because it is not receiving the expected
response from the server.  Explicitly printing to STDERR in this
function resolves this and you can continue your session while also
debugging checksum calculations.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Sip/Checksum.pm

index 6d6a66b..389a0f8 100644 (file)
@@ -54,11 +54,11 @@ sub debug_split_print {
     scalar(@row) and push @rows, \@row;
     foreach (@rows) {
         my $subtotal = 0;
-        print map {"   $_ "} @$_;
-        printf "\n%-50s", join '', map {sprintf " %3d ", $_} map {$subtotal += ord($_); ord($_)} @$_;
-        printf "= %4d\n\n", $subtotal;
+        print STDERR map {"   $_ "} @$_;
+        printf STDERR "\n%-50s", join '', map {sprintf " %3d ", $_} map {$subtotal += ord($_); ord($_)} @$_;
+        printf STDERR "= %4d\n\n", $subtotal;
     }
-    printf "%56d\n", $total;
+    printf STDERR "%56d\n", $total;
     return $total;
 }