Re: Possible bug in socketmodule.c: listen(1) vs. listen(0)

Steve Kirsch (stk@infoseek.com)
Fri, 10 Jun 1994 12:45:57 -0700

This is not a bug.

I'd have to guess that Guido put that in when I pointed out that ftplib.py
did not work on Solaris 2.3.

The reason was makeport in ftplib has a listen(0) which really
should have been a listen(1) since numbers less than 1 don't work at all
on Solaris, even though it did on 4.1.x.

By a strict interpretation of the wording of the man page on listen,
since the listen is done well before there is traffic available,
*theoretically* listen(0) should have worked, but it didn't.

So putting the check in makes the code more robust.

But then again, I don't know why anyone would want to set a queue size less
than 1. Do you? I'm not sure there are any cases on Solaris, for example, where
that would even work at all.

-steve

> From python-list-request@cwi.nl Fri Jun 10 12:03 PDT 1994
> To: python-list@cwi.nl
> Sender: python-list-request@cwi.nl
> Errors-To: python-list-request@cwi.nl
> From: faridf@watson.ibm.com (Farzad FARID)
> Subject: Possible bug in socketmodule.c
> Date: 10 Jun 1994 14:01:33 GMT
> X-Organization: IBM T.J. Watson Research Center
> Content-Type: text
> Content-Length: 581
> X-Lines: 15
>
> In Modules/socketmodule.c in the sock_listen function, I found:
> if (backlog < 1)
> backlog == 1;
> Is that a bug?
>
> And also by compiling the Modules directory with the -Wall option of
> EMX/GCC under OS/2 I get a bunch of warnings, mostly harmless, but some say
> something like "function returns void in a non-void-return-type function",
> are these warning a problem?
>
> --
> Farzad Farid, 38-013. Tel: (914) 945-2175, tie 862-2175
> NetDoor/CORE Support.
> IBM T.J. Watson Research Center, Yorktown Heights NY.
> *** The opinions expressed here are only mine and not those of IBM ***
>