https://bugs.winehq.org/show_bug.cgi?id=53574
--- Comment #2 from Bernhard Übelacker bernhardu@mailbox.org --- Created attachment 74546 --> https://bugs.winehq.org/attachment.cgi?id=74546 server: Reset reported_events if socket gets reused.
Hello, I took a deeper look and it looks like the issue in dirmngr.exe is caused by it reusing the same socket for multiple failing connection attempts. wineserver stores flags in reported_events, which gets not reset for the second connection attempt. Therefore WSAEnumNetworkEvents returns no events, which causes the function wait_for_events in msys2 to never return.
Attached patch resets this reported_events at the second connection attempt and contains a test that should show the issue.
There are additional issues about file deletion/renaming, but that deserves maybe another bug report.