http://bugs.winehq.org/show_bug.cgi?id=59787 Bug ID: 59787 Summary: macos (socket): select malfunctioning when recv on closed socket (common HTTP usage) Product: Wine Version: unspecified Hardware: x86-64 OS: MacOS Status: UNCONFIRMED Severity: major Priority: P2 Component: winsock Assignee: wine-bugs@list.winehq.org Reporter: kr4uzi@gmail.com Created attachment 81010 --> http://bugs.winehq.org/attachment.cgi?id=81010 patch, demo.c and Makefile First discovered on macOS with Battlefield 2 online accounts (the login doesn't proceed). Underlying issue: If a ::select is done on a socket that can be ::recv'ed from, but is already closed at that time, the socket will be part of the except-fd_set. This does *not* happen under linux (or windows). I have attached a patch for the wineserver that fixes it under my machine and also a proof of concept to show the deviation between wine, linux and native. This being said: The Quality of this is "it works on my machine" and I do not have sufficient knowledge of the macos/linux polling mechanism to evaluate it properly. -------------- Proof-Of-Concept (pseudo code): -------------- s = socket(IPv4, TCP); connect(s, "bf2web.gamespy.com") select(s, null, &canwrite, &hasexception); send(s, "GET /ASP/ge.....") for i in 0..2: select(s, &canread, null, &hasexception) recv(s) -------------- -------------- Results -------------- -------------- Native: -------------- select (write): res=1 write=1 except=1 send: res=147 select (read): res=1 read=1 except=0 recv: res=71 select (read): res=1 read=1 except=0 recv: res=0 -------------- -------------- wine: -------------- select (write): res=1 write=1 except=1 send: res=147 select (read): res=2 read=1 except=1 recv: res=71 select (read): res=2 read=1 except=1 recv: res=0 -------------- -------------- wine (patched): -------------- select (write): res=1 write=1 except=1 send: res=147 select (read): res=1 read=1 except=0 recv: res=71 select (read): res=1 read=1 except=0 recv: res=0 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.