[PATCH v3] ws2_32: Check if waiting asyncs exist in WSARecv/WSASend

Zebediah Figura (she/her) zfigura at codeweavers.com
Tue May 18 12:09:30 CDT 2021


On 5/18/21 4:19 AM, Paul Gofman wrote:
> On 5/18/21 09:03, Dongwan Kim wrote:
>> Thanks for your clear review.
>>
>> (1)
>> I found this misbehavior from KakaoTalk which is the major messenger app
>> in South Korea. Login rarely fails when I execute the app in wine.
>>
>> Also I made  simple server/client programs that the message ordering always fails.
>>
>> (2)
>> I made the simplified test case based on the programs I mentioned,
>> and I will submit it in next revision.
>>
>>
>>
> As Zebediah noted, this will have a noticable performance impact
> (additional server call) for all the socket send and receive operation,
> which is very unfortunate, to say the least. Is it maybe possible to
> introduce something like a shared memory section to store the dynamic
> state for the state that can't be cached locally (the question is also
> for Zebediah)? Maybe it will be easier to do once the winsock IO move to
> ntdll is complete?
> 
> 

I have suspicions that native ws2_32 stores some state on the client 
side, probably in shared memory, but I'm not sure. I think that shared 
memory will definitely make things uglier, though.

For what it's worth, currently most instances of recv() take two server 
calls (or more) anyway. The only case that doesn't is when data is 
already available and the operation is not overlapped. I believe it 
should be possible to add protection against incorrect ordering in an 
architecturally sensible way and without adding an extra server call for 
any other case.



More information about the wine-devel mailing list