diff src/os/win32/ngx_wsarecv.c @ 8111:56819a9491fe

Win32: event flags handling edge cases in ngx_wsarecv(). Fixed event flags handling edge cases in ngx_wsarecv() and ngx_wsarecv_chain(), notably to always reset rev->ready in case of errors (which wasn't the case after ngx_socket_nread() errors), and after EOF (rev->ready was not cleared if due to a misconfiguration a zero-sized buffer was used for reading).
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 01 Dec 2022 04:22:36 +0300
parents efd71d49bde0
children
line wrap: on
line diff
--- a/src/os/win32/ngx_wsarecv.c
+++ b/src/os/win32/ngx_wsarecv.c
@@ -78,6 +78,7 @@ ngx_wsarecv(ngx_connection_t *c, u_char 
                                      ngx_socket_nread_n " failed");
 
             if (n == NGX_ERROR) {
+                rev->ready = 0;
                 rev->error = 1;
             }
 
@@ -95,6 +96,7 @@ ngx_wsarecv(ngx_connection_t *c, u_char 
     }
 
     if (bytes == 0) {
+        rev->ready = 0;
         rev->eof = 1;
     }