3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 19:22:40 +01:00

SelectHandler: fix reader subref when closing handle

This commit is contained in:
Pragmatic Software 2021-06-21 07:30:42 -07:00
parent 06d986e11e
commit d395fd41af

View File

@ -56,8 +56,8 @@ sub on_select_read {
if ($ret == 0) { if ($ret == 0) {
# is there anything in reader's buffer? # is there anything in reader's buffer?
if (length $self->{buffers}->{$handle}) { if (length $self->{buffers}->{$handle}) {
# send buffer to reader subref # send buffer to reader's consumer subref
$self->{readers}->{$handle}->($self->{buffers}->{$handle}); $subref->($self->{buffers}->{$handle});
} }
# remove reader # remove reader