04-14-07 06:11 PM
Forwarded to the list in case this bites anyone else... this patch
works and now all tests pass.
cr
Begin forwarded message:
> From: Radu Greab <radu@yx.ro>
> Date: April 13, 2007 2:46:38 PM CDT
> To: cremes.devlist@mac.com
> Subject: Re: perlbal fails on OSX
>
>
> Hi,
>
>
> The above code assumes that the loop will be left when a reading
> from a
> closed socket is tried (errno will be set). May I ask you to try the
> change below, which will make the loop finish when EOF is read from
> the socket?
>
>
> === lib/Perlbal/Test.pm
> ========================================
==========================
> --- lib/Perlbal/Test.pm (revision 75559)
> +++ lib/Perlbal/Test.pm (local)
> @@ -189,9 +189,9 @@
> my $cl = $resp->header('Content-Length');
> if (defined $cl && $cl > 0) {
> my $content = '';
> - while (($cl -= read($sock, $content, $cl)) > 0) {
> - # assume an error means connection closed
> - last if $!;
> + my $rv;
> + while (($rv = read($sock, $content, $cl)) &&
> + ($cl -= $rv) > 0) {
> # don't do anything, the loop is it
> }
> $resp->content($content);
>
[ Post a follow-up to this message ]
|