[open-ils-commits] [GIT] Evergreen ILS branch rel_2_3 updated. 49c9f1214f2663b2a6b12af0ce20a279d095be20

Evergreen Git git at git.evergreen-ils.org
Thu Oct 11 09:56:02 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_3 has been updated
       via  49c9f1214f2663b2a6b12af0ce20a279d095be20 (commit)
      from  9e6ab63c189c3ac177f8422b532c76270f20cafd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 49c9f1214f2663b2a6b12af0ce20a279d095be20
Author: Dan Scott <dscott at laurentian.ca>
Date:   Wed Oct 10 22:06:32 2012 -0400

    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 at laurentian.ca>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
index a70db54..4497c33 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
@@ -439,11 +439,13 @@ sub added_content_stage1 {
     # and back in to reach the top-level virtualhost.
     my $ac_addr = $ENV{SERVER_ADDR};
     my $ac_host = $self->apache->hostname;
+    my $ac_failed = 0;
 
     $logger->info("tpac: added content connecting to $ac_addr / $ac_host");
 
     $ctx->{added_content} = {};
     for my $type (@$ac_types) {
+        last if $ac_failed;
         $ctx->{added_content}->{$type} = {content => ''};
         $ctx->{added_content}->{$type}->{status} = $key ? 3 : 2;
 
@@ -457,14 +459,15 @@ sub added_content_stage1 {
             # or very slow (routing problems).
 
             my $req = Net::HTTP::NB->new(Host => $ac_addr, Timeout => 1);
-            $req->host($self->apache->hostname);
-
             if (!$req) {
                 $logger->warn("Unable to connect to $ac_addr / $ac_host".
                     " for added content lookup for $key: $@");
+                $ac_failed = 1;
                 next;
             }
 
+            $req->host($self->apache->hostname);
+
             my $http_type = ($type eq $sel_type) ? 'GET' : 'HEAD';
             $req->write_request($http_type => "/opac/extras/ac/$type/html/" . uri_escape($key));
             $ctx->{added_content}->{$type}->{request} = $req;

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list