Permalink
Browse files

Fix idle socket handler corruption.

Don't use 'each' in a loop that may exit early, unless you make sure to reset with 'keys' before you start again, and then in that case might as well just use 'keys' anyways because it's safe.
  • Loading branch information...
1 parent 9b05f6f commit e9a859715ca3656dcb97a3fb3b27eb4bf8b69b63 Jonathan Steinert committed Jan 22, 2011
Showing with 4 additions and 2 deletions.
  1. +2 −0 CHANGES
  2. +2 −2 lib/Perlbal/Socket.pm
View
@@ -1,3 +1,5 @@
+ -- Fix corruption of idle socket handlers introduced by SSL fix in 1.77.
+
1.77: 2011-01-15
-- Import of the documentation project:
View
@@ -178,9 +178,9 @@ sub _do_cleanup {
# No entry in the cache, find out what handler we should assign.
my $handler;
- while (my ($check_class, $check_handler) = each %socket_class_handlers) {
+ foreach my $check_class (keys %socket_class_handlers) {
next unless $sock->isa($check_class);
- $handler = $check_handler;
+ $handler = $socket_class_handlers{$check_class};
last;
}
# Outside the loop, so that we assign undef if none of the loop passes find anything.

0 comments on commit e9a8597

Please sign in to comment.