Re: [Python-Dev] socket.setsockopt() with optval=NULL

2016-08-22 Thread Benjamin Peterson
Another option would be add a setalg method with whatever (nice, pythonic) API we want. Emulating the crummy C-level API needn't be a goal I think. On Sun, Aug 21, 2016, at 05:37, Christian Heimes wrote: > Hi, > > the socket.setsockopt(level, optname, value) method has two calling > variants. Whe

Re: [Python-Dev] socket.setsockopt() with optval=NULL

2016-08-21 Thread Martin Panter
On 21 August 2016 at 12:37, Christian Heimes wrote: > the socket.setsockopt(level, optname, value) method has two calling > variants. When it is called with a buffer-like object as value, it calls > the C API function setsockopt() with optval=buffer.buf and > optlen=buffer.len. When value is an in

Re: [Python-Dev] socket.setsockopt() with optval=NULL

2016-08-21 Thread Guido van Rossum
Wouldn't setsockopt(socket.SOL_ALG, socket.ALG_SET_AEAD_AUTHSIZE, None, taglen) be more consistent? --Guido (mobile) On Aug 21, 2016 5:40 AM, "Christian Heimes" wrote: > Hi, > > the socket.setsockopt(level, optname, value) method has two calling > variants. When it is called with a buffer-lik

[Python-Dev] socket.setsockopt() with optval=NULL

2016-08-21 Thread Christian Heimes
Hi, the socket.setsockopt(level, optname, value) method has two calling variants. When it is called with a buffer-like object as value, it calls the C API function setsockopt() with optval=buffer.buf and optlen=buffer.len. When value is an integer, setsockopt() packs it as int32 and sends it with