[PATCH 0/7] MR195: winhttp: Abort web socket receive operations when the socket handle is closed

Paul Gofman pgofman at codeweavers.com
Tue Jun 7 09:05:32 CDT 2022



> On 7 Jun 2022, at 07:54, Hans Leidekker (@hans) <wine at gitlab.winehq.org> wrote:
> 
> Hans Leidekker (@hans) commented about dlls/winhttp/request.c:
>>     return !ret;
>> }
>> 
>> +static void socket_handle_closing( struct object_header *hdr )
>> +{
>> +    struct socket *socket = (struct socket *)hdr;
>> +
>> +    if (socket->request->netconn->secure)
>> +    {
>> +        cancel_queue( &socket->send_q );
>> +        cancel_queue( &socket->recv_q );
>> +    }
>> +    if (!is_queue_empty( &socket->send_q ) || !is_queue_empty( &socket->recv_q ))
>> +        netconn_cancel_io( socket->request->netconn );
>> +}
> I doesn't make a lot of sense that async behavior depends on the connection being secure. Do we really need to replicate this?
> 
I don’t have any examples of apps which are happy with one way of doing it and not another. I’d suggest to keep ‘secure’ variant then as I think secure connection is used more often. Also, this variant should deliver callbacks earlier (before exiting close handle call, except for handle closing notification) and apps are more likely to depend on that (e. g. a game where I saw crash on exit without these patches seems to have a race and not crashing depends on all the notifications delivered during WinHttpHandleClose or very shortly after; it also uses secure connection).


> -- 
> https://gitlab.winehq.org/wine/wine/-/merge_requests/195#note_1639
> 



More information about the wine-devel mailing list