… | |
… | |
499 | } |
499 | } |
500 | |
500 | |
501 | sub fh_ready_r { |
501 | sub fh_ready_r { |
502 | my ($self) = @_; |
502 | my ($self) = @_; |
503 | |
503 | |
504 | if (sysread $self->{fh}, $self->{buf}, 65536, length $self->{buf}) { |
504 | if (sysread $self->{fh}, $self->{buf}, 16384 + 1024, length $self->{buf}) { |
505 | for (;;) { |
505 | for (;;) { |
506 | if ($self->{datalen}) { |
506 | if ($self->{datalen}) { |
507 | #warn "expecting new datachunk $self->{datalen}, got ".(length $self->{buf})."\n";#d# |
507 | #warn "expecting new datachunk $self->{datalen}, got ".(length $self->{buf})."\n";#d# |
508 | if (length $self->{buf} >= $self->{datalen}) { |
508 | if (length $self->{buf} >= $self->{datalen}) { |
509 | $self->rcv_data (substr $self->{buf}, 0, delete $self->{datalen}, ""); |
509 | $self->rcv_data (substr $self->{buf}, 0, delete $self->{datalen}, ""); |