/[pdpsoft]/trunk/fetchcrl/TrustAnchor.pm
ViewVC logotype

Diff of /trunk/fetchcrl/TrustAnchor.pm

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

revision 1759 by davidg, Fri Jun 11 15:41:40 2010 UTC revision 1767 by davidg, Fri Jun 11 19:44:35 2010 UTC
# Line 184  sub loadAnchor($$) { Line 184  sub loadAnchor($$) {
184           nametemplate_der nametemplate_pem           nametemplate_der nametemplate_pem
185           cadir catemplate statedir           cadir catemplate statedir
186        / ) {        / ) {
187      $self->{$key} =      $self->{$key} = $self->{$key} ||
188        $::cnf->{$self->{"alias"}}->{$key} ||        $::cnf->{$self->{"alias"}}->{$key} ||
189        $::cnf->{$self->{"anchorname"}}->{$key} ||        $::cnf->{$self->{"anchorname"}}->{$key} ||
190        $::cnf->{_}->{$key} or delete $self->{$key};        $::cnf->{_}->{$key} or delete $self->{$key};
# Line 269  sub loadCAfiles($) { Line 269  sub loadCAfiles($) {
269    my $self         = shift;    my $self         = shift;
270    my $idx = 0;    my $idx = 0;
271    
272    -d $self->{"cadir"} or    # try to find a CA dir, whatever it takes, almost
273      $::log->err("CA directory",$self->{"cadir"},"does not exist") and    my $cadir = $self->{"cadir"} || $self->{"infodir"};
274    
275      -d $cadir or
276        $::log->err("CA directory",$cadir,"does not exist") and
277      return 0;      return 0;
278    
279    @{$self->{"cafile"}} = ();    @{$self->{"cafile"}} = ();
# Line 278  sub loadCAfiles($) { Line 281  sub loadCAfiles($) {
281      my $cafile;      my $cafile;
282      foreach my $catpl ( split /&/, $self->{"catemplate"} ) {      foreach my $catpl ( split /&/, $self->{"catemplate"} ) {
283        $catpl =~ s/\@R\@/$idx/g;        $catpl =~ s/\@R\@/$idx/g;
284        -e $self->{"cadir"}.'/'.$catpl and        -e $cadir.'/'.$catpl and
285          $cafile = $self->{"cadir"}.'/'.$catpl and last;          $cafile = $cadir.'/'.$catpl and last;
286      }      }
287      defined $cafile or do {      defined $cafile or do {
288        $idx or do $::log->err("Cannot find any CA for",        $idx or do $::log->err("Cannot find any CA for",
289                                $self->{"alias"},"in",$self->{"cadir"});                                $self->{"alias"},"in",$cadir);
290        return $idx?1:0;        return $idx?1:0;
291      };      };
292      push @{$self->{"cafile"}}, $cafile;      push @{$self->{"cafile"}}, $cafile;
# Line 532  sub retrieve($) { Line 535  sub retrieve($) {
535      # be used for all (like  Last-Modified, and cache control data)      # be used for all (like  Last-Modified, and cache control data)
536    
537      # if we have a cached piece of fresh data, return that one      # if we have a cached piece of fresh data, return that one
538      if ( ($self->{"crl"}[$i]{"state"}{"freshuntil"} || 0) > time and      if ( !$self->{"nocache"} and
539              ($self->{"crl"}[$i]{"state"}{"freshuntil"} || 0) > time and
540            $self->{"crl"}[$i]{"state"}{"b64data"} ) {            $self->{"crl"}[$i]{"state"}{"b64data"} ) {
541        $::log->verb(3,"Using cached content for",$self->{"alias"},"index",$i);        $::log->verb(3,"Using cached content for",$self->{"alias"},"index",$i);
542        $::log->verb(4,"Content dated",        $::log->verb(4,"Content dated",
# Line 605  sub retrieve($) { Line 609  sub retrieve($) {
609    
610      $self->{"crl"}[$i]{"state"}{"retrievaltime"} = time;      $self->{"crl"}[$i]{"state"}{"retrievaltime"} = time;
611      $self->{"crl"}[$i]{"state"}{"sourceurl"} = $response{"sourceurl"}||"null:";      $self->{"crl"}[$i]{"state"}{"sourceurl"} = $response{"sourceurl"}||"null:";
612      $self->{"crl"}[$i]{"state"}{"freshuntil"} =      $self->{"crl"}[$i]{"state"}{"freshuntil"} = $response{"freshuntil"}||time;
       ($self->{"nocache"}? 0 : $response{"freshuntil"}||time);  
613      $self->{"crl"}[$i]{"state"}{"lastmod"} = $response{"lastmod"}||time;      $self->{"crl"}[$i]{"state"}{"lastmod"} = $response{"lastmod"}||time;
614    
615    }    }

Legend:
Removed from v.1759  
changed lines
  Added in v.1767

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