Bugzilla – Attachment 57871 Details for
Bug 15419
Sipserver problem with stale db handles
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15419 SIP: handle requests with timeout, and refresh dbh if need be
Bug-15419-SIP-handle-requests-with-timeout-and-ref.patch (text/plain), 1.90 KB, created by
Alex Buckley
on 2016-12-02 01:07:36 UTC
(
hide
)
Description:
Bug 15419 SIP: handle requests with timeout, and refresh dbh if need be
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2016-12-02 01:07:36 UTC
Size:
1.90 KB
patch
obsolete
>From 3cb9299647b749bb0215312994832457d00d1ca2 Mon Sep 17 00:00:00 2001 >From: Srdjan <srdjan@catalyst.net.nz> >Date: Mon, 4 Jul 2016 17:08:39 +1200 >Subject: [PATCH] Bug 15419 SIP: handle requests with timeout, and refresh dbh > if need be > >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> >--- > C4/SIP/Sip/MsgType.pm | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index 4e406e2..512d1e8 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -10,6 +10,7 @@ use strict; > use warnings; > use Exporter; > use Sys::Syslog qw(syslog); >+use Time::Out qw(timeout); > > use C4::SIP::Sip qw(:all); > use C4::SIP::Sip::Constants qw(:all); >@@ -385,7 +386,16 @@ sub handle { > print("$last_response\r"); > return REQUEST_ACS_RESEND; > } >- return ( $self->{handler}->( $self, $server ) ); # FIXME >+ >+ local $@; >+ my $ret = timeout (5 => sub { >+ $self->{handler}->( $self, $server ); >+ }); >+ if ($@) { >+ C4::Context->new_dbh; >+ $ret = $self->{handler}->( $self, $server ); >+ } >+ return $ret; > # FIXME: Use of uninitialized value in subroutine entry > # Can't use string ("") as a subroutine ref while "strict refs" in use > } >@@ -1602,7 +1612,15 @@ sub api_auth { > if ($branch) { > $query->param( branch => $branch ); > } >- my ( $status, $cookie, $sessionID ) = check_api_auth( $query, { circulate => 1 }, 'intranet' ); >+ >+ local $@; >+ my ( $status, $cookie, $sessionID ) = timeout (5 => sub { >+ check_api_auth( $query, { circulate => 1 }, 'intranet' ); >+ }); >+ if ($@) { >+ C4::Context->new_dbh; >+ ( $status, $cookie, $sessionID ) = check_api_auth( $query, { circulate => 1 }, 'intranet' ); >+ } > return $status; > } > >-- >2.1.4
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 15419
:
53071
|
55273
| 57871