From a0a0e057c0620a49246d0b5c55a6013b1f664780 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 13 Jul 2016 11:59:28 +0200 Subject: [PATCH] Bug 15006: [QA Follow-up] Only handle login requests in raw_transport MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Although mainly hypothetical, it would still be possible to get response from the server for an acs resend request. (This exception is allowed in MsgType::handle.) I also noticed that the response may well be a message from an older session still. This patch just removes that exception by only passing login requests to sub handle in the raw_transport loop. Test plan: [1] Verify normal login procedure for raw. [2] Check a few acs resend requests in raw. They should terminate without a response. Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall (cherry picked from commit e465d1aa4b16d7392950b2b682f99eb0c58c1ffd) Signed-off-by: Frédéric Demians --- C4/SIP/SIPServer.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm index 814e0ffc29..5e1e3a6ee3 100755 --- a/C4/SIP/SIPServer.pm +++ b/C4/SIP/SIPServer.pm @@ -146,7 +146,9 @@ sub raw_transport { return; } $input =~ s/[\r\n]+$//sm; # Strip off trailing line terminator(s) - last if C4::SIP::Sip::MsgType::handle($input, $self, LOGIN); + my $reg = qr/^${\(LOGIN)}/; + last if $input !~ $reg || + C4::SIP::Sip::MsgType::handle($input, $self, LOGIN); } alarm 0; -- 2.39.5