Bugzilla – Attachment 45594 Details for
Bug 15006
Need to distinguish client timeout from login timeout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15006 Sip separate global from login timeouts
Bug-15006-Sip-separate-global-from-login-timeouts.patch (text/plain), 3.83 KB, created by
Jonathan Druart
on 2015-12-11 10:23:21 UTC
(
hide
)
Description:
Bug 15006 Sip separate global from login timeouts
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-12-11 10:23:21 UTC
Size:
3.83 KB
patch
obsolete
>From 5517219eee544e825b7ea9940f06c1a64c752850 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Fri, 20 Nov 2015 12:12:48 +0000 >Subject: [PATCH] Bug 15006 Sip separate global from login timeouts >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Timeout logic has been added to the main sip loop >However the timeout parameter was initially for the login process which >requires a short duration applying such a brief timeout to >the main sip loop causes instability in many selfcheck units > >Most selfchecks have persistent connections and send a >periodic status request at intervals (approx every 5mins appears >the norm) The timeout was dropping connections by default every 30secs >which for the client appears as a very flakey network > >This patch adds a separate parameter client_timeout that can be >used if you do want to force a disconnect if the client sends >no requests for a period. By not defining it you can switch off >the timeout in the main loop, I recommend this unless you >have a good reason not too. If you do want this behaviour you can >at least now set it to a more realistic value (see sample config >file) > >Removed the commented out html entry in the config file, this was >dead code born of a misconception and was just a source >of confusion for users > >Signed-off-by: Frédéric Demians <f.demians@tamil.fr> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/SIP/SIPServer.pm | 12 ++++++++---- > etc/SIPconfig.xml | 19 +++++++++++++------ > 2 files changed, 21 insertions(+), 10 deletions(-) > >diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm >index 8722ab6..85cfe75 100755 >--- a/C4/SIP/SIPServer.pm >+++ b/C4/SIP/SIPServer.pm >@@ -241,7 +241,7 @@ sub sip_protocol_loop { > my $self = shift; > my $service = $self->{service}; > my $config = $self->{config}; >- my $timeout = $self->{service}->{timeout} || $config->{timeout} || 30; >+ my $timeout = $self->{service}->{client_timeout} || $config->{client_timeout}; > my $input; > > # The spec says the first message will be: >@@ -258,10 +258,12 @@ sub sip_protocol_loop { > # > # In short, we'll take any valid message here. > #my $expect = SC_STATUS; >- local $SIG{ALRM} = sub { die "SIP Timed Out!\n"; }; >+ local $SIG{ALRM} = sub { die "SIP Timed Out!\n"; } if $timeout; > my $expect = ''; > while (1) { >- alarm $timeout; >+ if ($timeout) { >+ alarm $timeout; >+ } > $input = read_SIP_packet(*STDIN); > unless ($input) { > return; # EOF >@@ -287,7 +289,9 @@ sub sip_protocol_loop { > } > # We successfully received and processed what we were expecting > $expect = ''; >- alarm 0; >+ if ($timeout ) { >+ alarm 0; >+ } > } > } > >diff --git a/etc/SIPconfig.xml b/etc/SIPconfig.xml >index 141bc4f..6931dc9 100644 >--- a/etc/SIPconfig.xml >+++ b/etc/SIPconfig.xml >@@ -16,12 +16,6 @@ > /> > > <listeners> >-<!-- vestigial HTTP, never implemented: just use the OPAC! >- <service >- port="0:8080/tcp" >- transport="http" >- protocol="NCIP/1.0" /> >---> > <service > port="8023/tcp" > transport="telnet" >@@ -33,6 +27,19 @@ > transport="RAW" > protocol="SIP/2.00" > timeout="60" /> >+<!-- client_timeout times out active connections which have not received >+ input from the client. Many persistemt connections will send a status request >+ every 5-7 mins so setting this to less than that will add instability to the connection >+ if not set then no timeout is applied to the connection >+ NB the parameter timeout applies to the login process only and should be set to a lower value >+ to time out failed connections >+--> >+ <service >+ port="6002/tcp" >+ transport="RAW" >+ protocol="SIP/2.00" >+ timeout="60" >+ client_timeout="600" /> > </listeners> > > <accounts> >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15006
:
45039
|
45583
|
45594
|
52477
|
52478
|
52479
|
52480
|
52784
|
52785
|
52786
|
52787
|
52849
|
52850
|
52851
|
52852
|
52853
|
53009
|
53010
|
53011
|
53012
|
53013
|
53014
|
53132
|
53133
|
53134
|
53135
|
53309
|
53310
|
53311
|
53312
|
53355
|
53356
|
53357
|
53358
|
53359
|
53360
|
53363
|
53364
|
53365
|
53366
|
53367
|
53368
|
53369