Subject: | on_notifier callback when using ->listen on an existing socket |
Hi,
Ran into a minor issue when playing around passing listening sockets
between forks - line 998 in IO::Async::Loop pulls out the on_notifier
callback:
my $on_notifier = delete $params{on_notifier};
and then line 1020-1022 hit that if the socket's already in listening state:
if( $listener->is_listening ) {
$on_notifier->( $listener );
}
but if on_notifier isn't provided, that'll fail since $on_notifier is
undef. Just guarding that with an if() is probably sufficient here?
cheers,
Tom
Subject: | 2011-10-18-on_notifier.patch |
=== modified file 'lib/IO/Async/Loop.pm'
--- lib/IO/Async/Loop.pm 2011-10-15 12:49:35 +0000
+++ lib/IO/Async/Loop.pm 2011-10-18 21:42:37 +0000
@@ -1018,7 +1018,7 @@
$self->add( $listener );
if( $listener->is_listening ) {
- $on_notifier->( $listener );
+ $on_notifier->( $listener ) if $on_notifier;
}
else {
my $on_listen = delete $params{on_listen};