Re: Bug in Protocol::http->request()

Graham Barr (GBARR@pobox.com)
Tue, 9 Jun 1998 19:44:54 -0500


On Tue, Jun 09, 1998 at 04:53:22PM +0200, Gisle Aas wrote:
> > sub _closed_already
> > {
> >     my ($self, $sock) = @_;
> >     if (stat $sock)
> >     {
> >         return 0;
> >     }
> >     else
> >     {
> >         return 1;
> >     }
> > }
> 
> stat() on a socket - hmm, interesting.  Does it work for you?

On some systems this will work, but it is not gauranteed.

> Wouldn't a better fix be to make $sock->peerhost and $sock->peerport

Yes it would.

> work by fixing IO::Socket::INET (i.e. make them return undef instead
> of croaking if the underlying getpeername(2) does not work.)

They do not croak, well not in my version. But ->peername will not
croak in the released version. But unfortunately because of something
IO::Socket does this will not work. But you could use
getpeername($sock) that will work

Graham.

-- 
Graham Barr <gbarr@pobox.com>
Life would be so much easier if we could just look at the source code.