From 251821cb274cb5800f3aca03842da3250197b9d2 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 23 Oct 2012 10:52:21 -0400 Subject: [PATCH] LP#1070466: 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 Signed-off-by: Galen Charlton --- 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