On Mon, Nov 29, 2021 at 4:03 PM Bastien Orivel eijebong@bananium.fr wrote:
case TCP_NODELAY: { INT nodelay = optval[1]; return server_setsockopt( s, IOCTL_AFD_WINE_SET_TCP_NODELAY, nodelay, sizeof(nodelay) ); }
Shouldn't it be `INT nodelay = *optval;` or `optval[0]` ?
Yes, my neurons got crossed. Thanks for catching that.
After some testing I'm getting this:
optlen = -1, 1, 4, 8, 64, 1337 with optval = 1, -> tcp_nodelay = 1
optlen = 4, optval = 0x100 -> tcp_nodelay = 0
It's only reading the first byte which makes sense.
I'll add tests to confirm that. I will also add `getsockopt` calls to check that the value changed accordingly.
Great!
-Alex