22 Mar
2022
22 Mar
'22
4:41 p.m.
On 3/19/22 17:28, Jinoh Kang wrote:> +static void send_socket_completion_callback( void *private )
+{ + struct send_req *send_req = private; + struct iosb *iosb = send_req->iosb; + struct sock *sock = send_req->sock; + + if (iosb->status != STATUS_SUCCESS) + { + /* send() calls only clear and reselect events if unsuccessful. */ + sock->pending_events &= ~AFD_POLL_WRITE; + sock->reported_events &= ~AFD_POLL_WRITE; + } + + sock_reselect( sock ); + I'd move this inside the prior if block. The point of reselecting here is that our events just changed, and that might trigger us to need reselect for POLLOUT.
+ release_object( iosb ); + release_object( sock ); + free( send_req ); +} +