diff options
author | jperkin <jperkin> | 2013-12-04 15:14:19 +0000 |
---|---|---|
committer | jperkin <jperkin> | 2013-12-04 15:14:19 +0000 |
commit | 7e2fc0743bd1a333f83090ffc7daa41222b97de9 (patch) | |
tree | 7265e45a9dfe2d16aafb7d60abd7111e85188f4a /mail/spamassassin/patches/patch-lib_Mail_SpamAssassin_AsyncLoop.pm | |
parent | 79481e9edc66a71d9e86715b63e549ca3937272b (diff) | |
download | pkgsrc-7e2fc0743bd1a333f83090ffc7daa41222b97de9.tar.gz |
Apply backported patch for SpamAssassin bug#6937 which resolves some
issues running with perl 5.18.
Bump PKGREVISION.
Diffstat (limited to 'mail/spamassassin/patches/patch-lib_Mail_SpamAssassin_AsyncLoop.pm')
-rw-r--r-- | mail/spamassassin/patches/patch-lib_Mail_SpamAssassin_AsyncLoop.pm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mail/spamassassin/patches/patch-lib_Mail_SpamAssassin_AsyncLoop.pm b/mail/spamassassin/patches/patch-lib_Mail_SpamAssassin_AsyncLoop.pm new file mode 100644 index 00000000000..e75b6d7bd14 --- /dev/null +++ b/mail/spamassassin/patches/patch-lib_Mail_SpamAssassin_AsyncLoop.pm @@ -0,0 +1,31 @@ +$NetBSD: patch-lib_Mail_SpamAssassin_AsyncLoop.pm,v 1.1 2013/12/04 15:14:19 jperkin Exp $ + +Part of backport of bug#6937 + +--- lib/Mail/SpamAssassin/AsyncLoop.pm.orig 2011-06-06 23:59:17.000000000 +0000 ++++ lib/Mail/SpamAssassin/AsyncLoop.pm +@@ -360,7 +360,13 @@ sub complete_lookups { + } + $now = time; # capture new timestamp, after possible sleep in 'select' + +- while (my($key,$ent) = each %$pending) { ++ # A callback routine may generate another DNS query, which may insert ++ # an entry into the %$pending hash thus invalidating the each() context. ++ # So, make sure that callbacks are not called while the each() context ++ # is open, or avoid using each(). [Bug 6937] ++ # ++ foreach my $key (keys %$pending) { ++ my $ent = $pending->{$key}; + my $id = $ent->{id}; + if (defined $ent->{poll_callback}) { # call a "poll_callback" if exists + # be nice, provide fresh info to a callback routine +@@ -448,7 +454,8 @@ sub abort_remaining_lookups { + my $pending = $self->{pending_lookups}; + my $foundcnt = 0; + my $now = time; +- while (my($key,$ent) = each %$pending) { ++ foreach my $key (keys %$pending) { ++ my $ent = $pending->{$key}; + dbg("async: aborting after %.3f s, %s: %s", + $now - $ent->{start_time}, + (defined $ent->{timeout_initial} && |