if ($self->_auth ($remote)) {
my $len = length ($msg);
syswrite $remote, "learn $self->{statfile} $len -w $self->{weight}" . $EOL;
- syswrite $remote, $input . $EOL;
+ syswrite $remote, $msg . $EOL;
unless ($self->_get_io_readiness($remote, 0)) {
$res{error} = "Timeout while reading data from socket";
$res{error_code} = 501;
return \%res;
}
- my $len = length ($input);
+ my $len = length ($msg);
$res{error} = "Sending $len bytes...\n";
syswrite $remote, "weights $self->{'statfile'} $len" . $EOL;
- syswrite $remote, $input . $EOL;
+ syswrite $remote, $msg . $EOL;
unless ($self->_get_io_readiness($remote, 0)) {
$res{error} = "Timeout while reading data from socket";
$res{error_code} = 501;
}
elsif ($self->{'command'} =~ /(fuzzy_add|fuzzy_del)/i) {
if ($self->_auth ($remote)) {
- my $len = length ($input);
+ my $len = length ($msg);
syswrite $remote, $self->{'command'} . " $len $self->{'weight'}" . $EOL;
- syswrite $remote, $input . $EOL;
+ syswrite $remote, $msg . $EOL;
unless ($self->_get_io_readiness($remote, 0)) {
$res{error} = "Timeout while reading data from socket";
$res{error_code} = 501;