[PATCH 6/7] winhttp: Support abort in task_socket_close().

Paul Gofman wine at gitlab.winehq.org
Mon Jun 6 23:02:34 CDT 2022


From: Paul Gofman <pgofman at codeweavers.com>

---
 dlls/winhttp/request.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index 3a239966c69..397421ebcd0 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -4153,13 +4153,18 @@ static void task_socket_close( void *ctx, BOOL abort )
     struct socket *socket = (struct socket *)s->task_hdr.obj;
     DWORD ret;
 
-    if (abort) return;
+    if (abort)
+    {
+        socket_close_complete( socket, ERROR_WINHTTP_OPERATION_CANCELLED );
+        return;
+    }
 
     TRACE("running %p\n", ctx);
 
     ret = socket_close( socket );
     receive_io_complete( socket );
-    socket_close_complete( socket, ret );
+    if (task_needs_completion( &s->task_hdr ))
+        socket_close_complete( socket, ret );
 }
 
 DWORD WINAPI WinHttpWebSocketClose( HINTERNET hsocket, USHORT status, void *reason, DWORD len )
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/195



More information about the wine-devel mailing list