Bugzilla – Attachment 45039 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]
Proposed Patch
0001-Bug-15006-Sip-separate-global-from-login-timeouts.patch (text/plain), 3.62 KB, created by
Colin Campbell
on 2015-11-20 12:47:16 UTC
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2015-11-20 12:47:16 UTC
Size:
3.62 KB
patch
obsolete
>From 4f137bb67e847d769eb03ce6e4470496b6b02438 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 > >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 >--- > 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..296be3d 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.5.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