develooper Front page | perl.perl5.porters | Postings from November 2000

Re: [ID 20001109.006] [MAILER-DAEMON@tmtowtdi.perl.org: failure notice]

Thread Previous | Thread Next
From:
Jens Hamisch
Date:
November 9, 2000 21:58
Subject:
Re: [ID 20001109.006] [MAILER-DAEMON@tmtowtdi.perl.org: failure notice]
Message ID:
20001110065615.P6958@Strawberry.COM
Nicolas,

> On Thu, Nov 09, 2000 at 03:07:29PM +0100, Jens Hamisch wrote:
> > Running the C preprocessor on this code shows, what goes wrong:
> > 
> >         ch =  SOCKSgetc ( ( ( XPVIO * ) ( io ) -> sv_any ) -> xio_ifp );
> >         if (ch !=  ( - 1 )) {
> >             (void) ungetc ( ch , ( ( XPVIO * ) ( io ) -> sv_any ) -> xio_ifp );
> >             return  ( 0 );
> >         }
> > 
> > The getc funktion is replaced by the SOCKSgetc while ungetc is left
> > unchanged.
> 
> 
> Does SOCKS state that it provides full ANSI stdio?
> If does then I interpret this as SOCKS is buggy because ungetc() is
> defined by ANSI. [as you can get a FILE* without using the non-ANSI
> fdopen() if you're a child of inetd, for example]

Another interpretation could be a buggy libc bundled with the
Sun Forte C 6.0  compiler ...
The problem is present on Sparc with 64 bit enabled. I cannot
reproduce the problem on Intel 32 bit Solaris using the same
version of that compiler! Unfortunatelly my SOCKS lib is 64 bit
only, so i cannot try Perl + Socks + 32bit on Sparc.

SOCKS uses the real getc for non-socket operations and read(2) for
sockets. So if everything is ANSI, read(2) also should take care
of things put back to the stream using ungetc, right?

I tried to locate some hints to this on SunSolve yesterday, but
didn't find any.

> Note that if SOCKS is buggy it doesn't stop perl working around it.

I thought of perl being configurable to work around the buffer bug
by changing the PerlIO_(un)getc in a way, that buffering is done
before the real (un)getc call ... would you also do it that way? Of
course there's more than one ;-) It could be done for the Solaris
Sparc Forte C compiler at 64 bit only by enclosing it in '#ifdef _LP64'
and '#ifdef sparc' conditions.

Regards
-- Jens

--------------------------------------------------------------------------------
     /
 +##+|##+   STRAWBERRY                     Jens Hamisch
+v#+v v##+  EDV-Systeme GmbH               Managing director
/ v    v\v
| . .  . |  Brauneckweg 2                  Car (Voice):  (+49 172) 81 04 162
|     .  |  D-82549 Koenigsdorf            Voice:        (+49 8179) 9305-50
 | .     |                                 Fax:          (+49 8179) 9305-38
 \   .  /   Tel./Fax: (+49 8179) 9305-50   Email:        jens@Strawberry.COM
  \____/    Strawberry@Strawberry.COM      


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About