Gisle Aas <[EMAIL PROTECTED]> writes:

> Hmmm, returning a TRUE value on failure is quite unperlish.  I wonder
> how much software got this wrong?  For instance among the core modules
> we find code like this.

I looked at the LWP code as well.  It got it wrong in both places it
uses select directly...

LWP::Protocol::http does this:

            my $nfound = select($rbits, $wbits, undef, $sel_timeout);
            unless (defined $nfound) {
                die "select failed: $!";
            }

HTTP::Daemon does this:

    if ($_[1]) {
        my($timeout, $fdset) = @_[1,2];
        print STDERR "select(,,,$timeout)\n" if $DEBUG;
        my $n = select($fdset,undef,undef,$timeout);
        unless ($n) {
            $self->reason(defined($n) ? "Timeout" : "select: $!");
            return;
        }
    }
    print STDERR "sysread()\n" if $DEBUG;
    my $n = sysread($self, $_[0], 2048, length($_[0]));
    $self->reason(defined($n) ? "Client closed" : "sysread: $!") unless $n;

:-(

Are you sure we can't just make perl's select behave as I obviously
thought it did instead?

--Gisle

Reply via email to