IMPORTANT: clean up after Z39.50 connections

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Galen Charlton 2008-03-04 13:25:04 +13:00 committed by Joshua Ferraro
parent a0236d1460
commit bf2e91560c
1 changed files with 8 additions and 0 deletions

View File

@ -498,6 +498,14 @@ sub Zconn {
return $context->{"Zconn"}->{$server};
# No connection object or it died. Create one.
}else {
# release resources if we're closing a connection and making a new one
# FIXME: this needs to be smarter -- an error due to a malformed query or
# a missing index does not necessarily require us to close the connection
# and make a new one, particularly for a batch job. However, at
# first glance it does not look like there's a way to easily check
# the basic health of a ZOOM::Connection
$context->{"Zconn"}->{$server}->destroy() if defined($context->{"Zconn"}->{$server});
$context->{"Zconn"}->{$server} = &_new_Zconn($server,$async,$auth,$piggyback,$syntax);
return $context->{"Zconn"}->{$server};
}