[Patches] [ python-Patches-644895 ] socketmodule.c cleanup

noreply@sourceforge.net noreply@sourceforge.net
Wed, 27 Nov 2002 14:02:57 -0800


Patches item #644895, was opened at 2002-11-27 19:54
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=644895&group_id=5470

Category: Build
Group: Python 2.2.x
Status: Closed
Resolution: Rejected
Priority: 5
Submitted By: Tim Rice (tim1470)
Assigned to: Nobody/Anonymous (nobody)
Summary: socketmodule.c cleanup

Initial Comment:
Modules/socketmodule.c is uses socklen_t in some places
and int in
others. This patch corrects this. This is important on
any platform
where socklen_t should be something other than int.

patch against release22-maint branch pulled 29 Nov 2002



----------------------------------------------------------------------

>Comment By: Martin v. Lwis (loewis)
Date: 2002-11-27 23:02

Message:
Logged In: YES 
user_id=21627

Sure. On Solaris 32bit, and on Unixware, int is 4 bytes, on
64-bit Solaris, it is 8 bytes, so
sizeof(socklen_t)<=sizeof(int) on all systems.

However, the values for socklen_t are never >150 or so
(sizeof(sockaddr_in6) is 32). So I don't see how you could
ever provoke an error by converting freely between int and
socklen_t.

Converting between int* and socklen_t* is another issue; I
don't think Python has any errors in this respect.

----------------------------------------------------------------------

Comment By: Tim Rice (tim1470)
Date: 2002-11-27 22:47

Message:
Logged In: YES 
user_id=618097

On Solaris 32bit, socklen_t is an unsigned int.
On Solaris 64bit, socklen_t is an unsigned long.
On UnixWare, socklen_t is an unsitned int.

----------------------------------------------------------------------

Comment By: Martin v. Lwis (loewis)
Date: 2002-11-27 22:35

Message:
Logged In: YES 
user_id=21627

Atleast for Solaris, I think the socket module is correct:
int is a type that is always equal in size or wider than
socklen_t, so converting from socklen_t to int is a safe
operation.

I'll reject this patch for 2.2; if you can produce an
appropriate patch for 2.3, I see no problems accepting it.

----------------------------------------------------------------------

Comment By: Tim Rice (tim1470)
Date: 2002-11-27 22:03

Message:
Logged In: YES 
user_id=618097

UnixWare, Solaris.
I'ts only compiler warnings. It does build.
Ignore it if you want. I'll try and find some time for 2.3

----------------------------------------------------------------------

Comment By: Martin v. Lwis (loewis)
Date: 2002-11-27 21:55

Message:
Logged In: YES 
user_id=21627

What platforms specifically have this problem, i.e. on what
system does the socket module actually behave incorrectly?

For Python 2.2.x, no patches will be accepted that are
merely beautifications, without actually fixing any real bug
on real systems.

So I suggest that you port your patch to CVS Python 2.3.

----------------------------------------------------------------------

Comment By: Tim Rice (tim1470)
Date: 2002-11-27 21:10

Message:
Logged In: YES 
user_id=618097

Rats,  the checkbox got me again.

----------------------------------------------------------------------

Comment By: Martin v. Lwis (loewis)
Date: 2002-11-27 20:54

Message:
Logged In: YES 
user_id=21627

There's no uploaded file!  You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file.

Please try again.

(This is a SourceForge annoyance that we can do
nothing about. :-( )

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=644895&group_id=5470