From 08b650fe0c8f8a897b1d447fb8b3a8468de80941 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 23 Oct 2012 10:52:21 -0400 Subject: [PATCH] Print to STDERR in Sip/Checksum::debug_split_print. 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 --- Sip/Checksum.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sip/Checksum.pm b/Sip/Checksum.pm index 6d6a66b..389a0f8 100644 --- a/Sip/Checksum.pm +++ b/Sip/Checksum.pm @@ -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; } -- 2.11.0