From: Dan Scott Date: Wed, 15 Jun 2011 19:17:31 +0000 (-0400) Subject: Prevent corruption of SIP messages in logs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=39c0aaa28789e13ff55082307e565925b1a14fe0;p=working%2FSIPServer.git Prevent corruption of SIP messages in logs Non-ASCII characters were not being decoded before being written to the logs, thus resulting in heinous corruption in the logs. decode_utf8() is our friend. Signed-off-by: Dan Scott Signed-off-by: Thomas Berezansky --- diff --git a/Sip.pm b/Sip.pm index 065e7ff..1e57916 100644 --- a/Sip.pm +++ b/Sip.pm @@ -167,7 +167,7 @@ sub read_SIP_packet { { # adapted from http://perldoc.perl.org/5.8.8/functions/readline.html for ( my $tries = 1 ; $tries <= 3 ; $tries++ ) { undef $!; - $record = readline($fh); + $record = decode_utf8(readline($fh)); if ( defined($record) ) { while ( chomp($record) ) { 1; } $len1 = length($record);