TPAC: Avoid 500 errs on record page due to ipv6 ignorance user/dbs/tpac_avoid_ac_crash
authorDan Scott <dscott@laurentian.ca>
Thu, 11 Oct 2012 02:06:32 +0000 (22:06 -0400)
committerDan Scott <dscott@laurentian.ca>
Thu, 11 Oct 2012 02:06:32 +0000 (22:06 -0400)
commit35548857202107dc7da40a88acf8be7cc2d9a050
treee579ee403477774f55810b338f680206410f15c7
parentf64b4a4aca8884e46e1e60c7a4a38fd7e9157952
TPAC: Avoid 500 errs on record page due to ipv6 ignorance

Net::HTTP does not handle ipv6 addresses properly, and is subject to
failing to return a request object if handed one (some systems seem to
prefer ipv6). This commit checks the value of the request object before
invoking any methods on it, and also short-circuits the AC lookup loop
if the host could not be resolved to avoid flooding the logs with
multiple "Unable to connect..." warnings.

If Net::HTTP grows ipv6 support, this commit can still stay in place and
the lookups will just start magically working.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm