/[pdpsoft]/nl.nikhef.pdp.fetchcrl/trunk/TrustAnchor.pm
ViewVC logotype

Diff of /nl.nikhef.pdp.fetchcrl/trunk/TrustAnchor.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3107 by davidg, Fri Sep 9 15:32:11 2016 UTC revision 3275 by davidg, Thu Jan 16 20:33:09 2020 UTC
# Line 423  sub retrieveHTTP($$) { Line 423  sub retrieveHTTP($$) {
423    
424    $::log->verb(3,"Downloading data from $url");    $::log->verb(3,"Downloading data from $url");
425    my $ua = LWP::UserAgent->new;    my $ua = LWP::UserAgent->new;
426    
427    $ua->agent('fetch-crl/'.$::cnf->{_}->{version} . ' ('.    $ua->agent('fetch-crl/'.$::cnf->{_}->{version} . ' ('.
428               $ua->agent . '; '.$::cnf->{_}->{packager} . ')'               $ua->agent . '; '.$::cnf->{_}->{packager} . ')'
429             );             );
430      # allow overriding of userAgent string to bypass Fortigates and like filters
431      if ( defined $::cnf->{$self->{"alias"}}->{user_agent} ) {
432        $ua->agent($::cnf->{$self->{"alias"}}->{user_agent});
433        $::log->verb(5,"Setting user agent for " .
434                       $self->{"alias"} . " to \"" .
435                       $::cnf->{$self->{"alias"}}->{user_agent} . "\"" );
436      } elsif ( defined $::cnf->{_}->{user_agent} ) {
437        $ua->agent($::cnf->{_}->{user_agent});
438        $::log->verb(5,"Setting user agent to global value \"" .
439                       $::cnf->{_}->{user_agent} . "\"" );
440      }
441    
442    $ua->timeout($self->{"httptimeout"});    $ua->timeout($self->{"httptimeout"});
443    $ua->use_eval(0);    $ua->use_eval(0);
444    if ( $self->{"http_proxy"} ) {    if ( $self->{"http_proxy"} ) {
# Line 466  sub retrieveHTTP($$) { Line 479  sub retrieveHTTP($$) {
479      alarm 0; # make sure the alarm stops ticking, regardless of the eval      alarm 0; # make sure the alarm stops ticking, regardless of the eval
480    
481      if ( $@ ) { # died, alarm hit: server bad, so try next URL      if ( $@ ) { # died, alarm hit: server bad, so try next URL
482        $::log->verb(2,"HEAD error $url:", $@);        chomp($@);
483          my $shorterror = $@; $shorterror =~ s/\n.*$//gs;
484          $::log->verb(2,"HEAD error $url:", $shorterror);
485          # underlying socket library may be verybose - filter and qualify messages
486          if ( $shorterror ne $@ ) {
487            foreach my $errorline ( split(/\n/,$@) ) {
488              chomp($errorline); $errorline eq $shorterror and next; # nodups
489              $errorline and $::log->verb(4,"HEAD error detail:", $errorline);
490            }
491          }
492        return undef;        return undef;
493      }      }
494    
# Line 509  sub retrieveHTTP($$) { Line 531  sub retrieveHTTP($$) {
531    
532    if ( $@ ) {    if ( $@ ) {
533      chomp($@);      chomp($@);
534      $::log->verb(0,"Download error $url:", $@);      my $shorterror = $@; $shorterror =~ s/\n.*$//gs;
535        $::log->verb(0,"Download error $url:", $shorterror);
536        # underlying socket library may be verybose - filter and qualify messages
537        if ( $shorterror ne $@ ) {
538          foreach my $errorline ( split(/\n/,$@) ) {
539            chomp($errorline); $errorline eq $shorterror and next; # nodups
540            $errorline and $::log->verb(4,"Download error detail:", $errorline);
541          }
542        }
543      return undef;      return undef;
544    }    }
545    

Legend:
Removed from v.3107  
changed lines
  Added in v.3275

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28