ws2_32/tests: Add tests for getsockopt() with SO_SNDBUF and SO_RCVBUF optname.

Bruno Jesus 00cpxxx at gmail.com
Mon Feb 15 23:29:28 CST 2016


On Tue, Feb 16, 2016 at 9:30 AM, Sebastian Lackner <sebastian at fds-team.de>
wrote:

> Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
> ---
>
> @Bruno: As far as I remember you were working on a fix for this, what is
> the progress?
>

Hi, Sebastian. Unfortunately since December I'm buried by real life work
and I thought I could restart working in Wine on February but that was not
possible.

My solution to this is still theoretical, I didn't write any code yet. The
solution is to cache the values of SO_RCVBUF, SO_SNDBU, SO_REUSEADDR and
SO_ACCEPTCONN. Why?

SO_RCVBUF and SO_SNBUF are messed by Linux kernel. So we would cache the
requested value and return a min() between what we have in the cache and
what we read back from the kernel. This would solve this problem and not
require #ifdef.

SO_REUSEADDR because Windows does not have TIME_WAIT at all, so all sockets
would be created with SO_REUSEADDR in the server and we would take care of
it manually. There is a long standing uTorrent bug about this.

SO_ACCEPTCONN is bugged in OSX, it is never updated by the kernel so it is
useless and always fail. To solve this we would set the cache to 1 when
listen() is called and return the cache instead of asking for the kernel.

I'm still reading all bugs and emails so I'm aware of your divide by 2
solution and I really don't mind if it gets accepted as it is ready and
mine is still months to come.

Best wishes,
Bruno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160216/7c727531/attachment.html>


More information about the wine-devel mailing list