View | Details | Raw Unified | Return to bug 6937
Collapse All | Expand All

(-)Mail/SpamAssassin/AsyncLoop.pm~ (-2 / +10 lines)
Lines 361-365 Link Here
361
    $now = time;  # capture new timestamp, after possible sleep in 'select'
361
    $now = time;  # capture new timestamp, after possible sleep in 'select'
362
362
363
    while (my($key,$ent) = each %$pending) {
363
    # A callback routine may generate another DNS query, which may insert
364
    # an entry into the %$pending hash thus invalidating the each() context.
365
    # So, make sure that callbacks are not called while the each() context
366
    # is open, or avoid using each().  [Bug 6937]
367
    #
368
  # while (my($key,$ent) = each %$pending) {
369
    foreach my $key (keys %$pending) {
370
      my $ent = $pending->{$key};
364
      my $id = $ent->{id};
371
      my $id = $ent->{id};
365
      if (defined $ent->{poll_callback}) {  # call a "poll_callback" if exists
372
      if (defined $ent->{poll_callback}) {  # call a "poll_callback" if exists
Lines 449-453 Link Here
449
  my $foundcnt = 0;
456
  my $foundcnt = 0;
450
  my $now = time;
457
  my $now = time;
451
  while (my($key,$ent) = each %$pending) {
458
  foreach my $key (keys %$pending) {
459
    my $ent = $pending->{$key};
452
    dbg("async: aborting after %.3f s, %s: %s",
460
    dbg("async: aborting after %.3f s, %s: %s",
453
        $now - $ent->{start_time},
461
        $now - $ent->{start_time},
(-)Mail/SpamAssassin/Conf/Parser.pm~ (-1 / +1 lines)
Lines 1249-1253 Link Here
1249
  my $mods = '';
1249
  my $mods = '';
1250
  local ($1,$2);
1250
  local ($1,$2);
1251
  if ($re =~ s/^m{//) {
1251
  if ($re =~ s/^m\{//) {
1252
    $re =~ s/}([a-z]*)$//; $mods = $1;
1252
    $re =~ s/}([a-z]*)$//; $mods = $1;
1253
  }
1253
  }
(-)Mail/SpamAssassin/DnsResolver.pm~ (-1 / +7 lines)
Lines 441-448 Link Here
441
      if (!defined($timeout) || $timeout > 0)
441
      if (!defined($timeout) || $timeout > 0)
442
        { $timer = $self->{main}->time_method("poll_dns_idle") }
442
        { $timer = $self->{main}->time_method("poll_dns_idle") }
443
      $! = 0;
443
      ($nfound, $timeleft) = select($rout=$rin, undef, undef, $timeout);
444
      ($nfound, $timeleft) = select($rout=$rin, undef, undef, $timeout);
444
    }
445
    }
445
    if (!defined $nfound || $nfound < 0) {
446
    if (!defined $nfound || $nfound < 0) {
446
      warn "dns: select failed: $!";
447
      if ($!) { warn "dns: select failed: $!\n" }
448
      else    { info("dns: select interrupted") }
449
      return;
450
    } elsif (!$nfound) {
451
      if (!defined $timeout) { warn("dns: select returned empty-handed\n") }
452
      elsif ($timeout > 0) { dbg("dns: select timed out %.3f s", $timeout) }
447
      return;
453
      return;
448
    }
454
    }
(-)Mail/SpamAssassin/Message.pm~ (-1 / +1 lines)
Lines 567-571 Link Here
567
    # bug 5557: windows requires tmp file be closed before it can be rm'd
567
    # bug 5557: windows requires tmp file be closed before it can be rm'd
568
    if (ref $part->{'raw'} eq 'GLOB') {
568
    if (ref $part->{'raw'} eq 'GLOB') {
569
      close($part->{'raw'})  or die "error closing input file: $!";
569
      close($part->{'raw'})  or warn "error closing input file: $!";
570
    }
570
    }
571
571
(-)Mail/SpamAssassin/PerMsgStatus.pm~ (-8 / +7 lines)
Lines 421-426 Link Here
421
    }
421
    }
422
422
423
    # ignore tests with 0 score in this scoreset
423
    # ignore tests with 0 score (or undefined) in this scoreset
424
    next if ($scores->{$test} == 0);
424
    next if !$scores->{$test};
425
425
426
    # Go ahead and add points to the proper locations
426
    # Go ahead and add points to the proper locations
Lines 1253-1263 Link Here
1253
              my $line = '';
1253
              my $line = '';
1254
              foreach my $test (sort @{$self->{test_names_hit}}) {
1254
              foreach my $test (sort @{$self->{test_names_hit}}) {
1255
                if (!$line) {
1255
                my $score = $self->{conf}->{scores}->{$test};
1256
                  $line .= $test . "=" . $self->{conf}->{scores}->{$test};
1256
                $score = '0'  if !defined $score;
1257
                } else {
1257
                $line .= $arg  if $line ne '';
1258
                  $line .= $arg . $test . "=" . $self->{conf}->{scores}->{$test};
1258
                $line .= $test . "=" . $score;
1259
                }
1260
              }
1259
              }
1261
              $line ? $line : 'none';
1260
              $line ne '' ? $line : 'none';
1262
            },
1261
            },
1263
1262
(-)Mail/SpamAssassin/Util.pm~ (-1 / +1 lines)
Lines 1588-1592 Link Here
1588
    return undef;   # invalid
1588
    return undef;   # invalid
1589
  }
1589
  }
1590
  elsif ($re =~ s/^m{//) {              # m{foo/bar}
1590
  elsif ($re =~ s/^m\{//) {             # m{foo/bar}
1591
    $delim = '}';
1591
    $delim = '}';
1592
  }
1592
  }

Return to bug 6937