https://bugs.winehq.org/show_bug.cgi?id=31438
--- Comment #188 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Heiko from comment #186)
Created attachment 50384 [details] Reset WSAerror on successful recv
Reset WSAerror/errno value on successful receive operation, like WS2_sendto already does. There're probably some more places to check for missing error value resetting.
This fixes problems with Qt applications, because Qt also checks WSAGetLastError if WSArecv returns 0 and then thinks some old error still is encountered.
Nice catch, congratulations. No one would expect Qt to have that bad behavior. To get the patch commited it will be good to have tests proving that and since you added the SetLastError to recv_base both recv() and WSARecv() will need tests. You can see more about tests at: http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ws2_32/tests/sock.c#l5... http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ws2_32/tests/sock.c#l6...