<div dir="ltr">On Tue, Feb 16, 2016 at 9:30 AM, Sebastian Lackner <span dir="ltr"><<a href="mailto:sebastian@fds-team.de" target="_blank">sebastian@fds-team.de</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Sebastian Lackner <<a href="mailto:sebastian@fds-team.de">sebastian@fds-team.de</a>><br>
---<br>
<br>
@Bruno: As far as I remember you were working on a fix for this, what is the progress?<br></blockquote><div><br></div><div>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.</div><div><br></div><div>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?</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Best wishes,</div><div>Bruno</div></div></div></div>