… | |
… | |
46 | package Net::FCP; |
46 | package Net::FCP; |
47 | |
47 | |
48 | use Carp; |
48 | use Carp; |
49 | use IO::Socket::INET; |
49 | use IO::Socket::INET; |
50 | |
50 | |
51 | $VERSION = 0.04; |
51 | $VERSION = 0.05; |
|
|
52 | |
|
|
53 | no warnings; |
52 | |
54 | |
53 | our $EVENT = Net::FCP::Event::Auto::; |
55 | our $EVENT = Net::FCP::Event::Auto::; |
54 | $EVENT = Net::FCP::Event::Event::;#d# |
56 | $EVENT = Net::FCP::Event::Event;#d# |
55 | |
57 | |
56 | sub import { |
58 | sub import { |
57 | shift; |
59 | shift; |
58 | |
60 | |
59 | for (@_) { |
61 | for (@_) { |
… | |
… | |
434 | |
436 | |
435 | if (sysread $self->{fh}, $self->{buf}, 65536, length $self->{buf}) { |
437 | if (sysread $self->{fh}, $self->{buf}, 65536, length $self->{buf}) { |
436 | for (;;) { |
438 | for (;;) { |
437 | if ($self->{datalen}) { |
439 | if ($self->{datalen}) { |
438 | if (length $self->{buf} >= $self->{datalen}) { |
440 | if (length $self->{buf} >= $self->{datalen}) { |
439 | $self->rcv_data (substr $self->{buf}, 0, $self->{datalen}, ""); |
441 | $self->rcv_data (substr $self->{buf}, 0, delete $self->{datalen}, ""); |
440 | } else { |
442 | } else { |
441 | last; |
443 | last; |
442 | } |
444 | } |
443 | } elsif ($self->{buf} =~ s/^DataChunk\015?\012Length=([0-9a-fA-F]+)\015?\012Data\015?\012//) { |
445 | } elsif ($self->{buf} =~ s/^DataChunk\015?\012Length=([0-9a-fA-F]+)\015?\012Data\015?\012//) { |
444 | $self->{datalen} = hex $1; |
446 | $self->{datalen} = hex $1; |