Bug 26897

Summary: Blank SIP message closes SIP server connection
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: SIP2Assignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: colin.campbell, edward.m.veal, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 26897: Don't close SIP connection when empty message is received

Description Nick Clemens (kidclamp) 2020-11-02 15:15:26 UTC
in SIPServer.pm
sub sip_protocol_loop
308         my $previous_alarm = alarm($timeout);
309 
310         while ( my $inputbuf = read_request() ) {
311             if ( !defined $inputbuf ) {
312                 return;    #EOF
313             }


It seems some machines can send an empty response when sending store and forward requests. Rather than close on an empty string we should just ignore and keep processing, only disconnecting when requested or when timed out
Comment 1 Jonathan Druart 2020-12-14 09:56:47 UTC
Created attachment 114373 [details] [review]
Bug 26897: Don't close SIP connection when empty message is received
Comment 2 Jonathan Druart 2020-12-14 09:57:12 UTC
Nick, can you test this patch where you faced the problem?