Skip to content

Commit

Permalink
Remove clp_sockets hash
Browse files Browse the repository at this point in the history
This hash is not used but it prevents these sockets to be able to
be closed by running out of scope.
  • Loading branch information
donald committed Dec 7, 2017
1 parent fa4a96e commit e61ecda
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions clusterd
Original file line number Diff line number Diff line change
Expand Up @@ -1196,8 +1196,6 @@ sub run_cmd {
our $CLP_PORT=235;
our $clp_listen_socket;

our %clp_sockets;

our %CLP_HANDLER=('CMD'=>\&clp_rx_CMD,'LSOF'=>\&clp_rx_LSOF);

sub clp_init {
Expand All @@ -1219,15 +1217,13 @@ sub clp_connect_request {
my $buffer='';

My::Select::reader($socket,sub{clp_receive($socket,\$buffer)});
$clp_sockets{$socket}=$socket;
}

sub clp_receive {
my ($s,$bufref)=@_;
my $data;
defined $s->recv($data,$TCP_MAX) or return;
if (!length($data) ) {
delete $clp_sockets{$s};
$s->close;
return;
}
Expand Down

0 comments on commit e61ecda

Please sign in to comment.