add cr to end of message if not allready there
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 17 Dec 2009 00:29:02 +0000 (01:29 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 17 Dec 2009 00:29:02 +0000 (01:29 +0100)
lib/SIP2/SC.pm

index e4fb42c..a068aab 100644 (file)
@@ -31,12 +31,13 @@ sub message {
 
        local $/ = "\r";
 
-
        my $sock = $self->{sock} || die "no sock?";
        my $ip = $self->{sock}->peerhost;
 
+       $send .= "\r" unless $send =~ m/\r/;
+
        $self->dump_message( ">>>> $ip ", $send );
-       print $sock "$send\r\n";        # FIXME we should have only CR here per protocol!
+       print $sock $send;
        $sock->flush;
 
        my $expect = substr($send,0,2) | 0x01;