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}, |