Subject: | POE::Component::Client::HTTP::Request return Error 400 when getting limited length content |
I'm getting an HTTP response "Error 400" coming from subroutine add_eof
of POE::Component::Client::HTTP::Request.pm when I'm using
POE::Component::Client::HTTP v0.77 with GET method and a MaxSize value
lower than the full document's size defined.
The code wich cause it is in the subroutine add_eof:
if (
$self->[REQ_REQUEST]->method() ne "HEAD" and
defined $self->[REQ_RESPONSE]->content_length and
not defined $self->[REQ_RESPONSE]->header("Transfer-Encoding") and
$self->[REQ_OCTETS_GOT] < $self->[REQ_RESPONSE]->content_length
) {
DEBUG and warn(
"got " . $self->[REQ_OCTETS_GOT] . " of " .
$self->[REQ_RESPONSE]->content_length
);
$self->error(400, "incomplete response " . $self->[REQ_ID]);
}
I don't fully understand how it works and what is this triying to do,
but deactivating this part of code, and letting only the "else", all is
running fine, correct HTTP response received is returned.
This is running under Win XP SP2 fully updated with ActivePerl v5.8.8. I
think is not a OS/Perl issue, and I don't know which more information
you may need, I'm very novice in POE.
Great job, thank you!