From: Jens Hamisch Date: Fri, 27 Apr 2001 17:00:36 +0000 (+0200) Subject: Re: [ID 20010303.009] SOCKS5 work around breaks other sockets X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=af130d4569250a70a5454519dc1efae1a891ab62;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20010303.009] SOCKS5 work around breaks other sockets Message-ID: <20010427170036.K1372@Strawberry.COM> SOCKS5_VERSION_NAME is the right symbol to detect the presence of SOCKS5. (HAS_SOCKS5_INIT is telling whether function called socks5_init() is available, and even that is not universal, most SOCKS5 installations use SOCKSinit()). p4raw-id: //depot/perl@9914 --- diff --git a/perlio.c b/perlio.c index 13ef151..3f15c4e 100644 --- a/perlio.c +++ b/perlio.c @@ -2187,13 +2187,13 @@ IV PerlIOStdio_close(PerlIO *f) { dTHX; -#ifdef HAS_SOCKS5_INIT +#ifdef SOCKS5_VERSION_NAME int optval; Sock_size_t optlen = sizeof(int); #endif FILE *stdio = PerlIOSelf(f,PerlIOStdio)->stdio; return( -#ifdef HAS_SOCKS5_INIT +#ifdef SOCKS5_VERSION_NAME (getsockopt(PerlIO_fileno(f), SOL_SOCKET, SO_TYPE, (void *)&optval, &optlen) < 0) ? PerlSIO_fclose(stdio) : close(PerlIO_fileno(f))