You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uv_tcp_close_reset() sets SO_LINGER then call uv_close().
If errno set in setsockopt() is EINVAL, it is converted to 0 then uv_close() is called.
While the man page tells different from the implementation, setsockopt() on NetBSD can return the other errno's which is better to be ignored in some situations (ECONNRESET, etc). It is not the case in other operating systems.
A caller of uv_tcp_close_reset() needs to check the return value and call uv_close() by hand if it encounters such errno's. As EINVAL (the socket has been shut down already) is handled explicitly, it would be better to also handle ECONNRESET (the socket has been reset by the remote) or such soft-failures gracefully.
Version: 1.48.0
Platform: NetBSD 9.2
https://github.com/libuv/libuv/blob/v1.48.0/src/unix/tcp.c#L399-L408
uv_tcp_close_reset() sets SO_LINGER then call uv_close().
If errno set in setsockopt() is EINVAL, it is converted to 0 then uv_close() is called.
While the man page tells different from the implementation, setsockopt() on NetBSD can return the other errno's which is better to be ignored in some situations (ECONNRESET, etc). It is not the case in other operating systems.
A caller of uv_tcp_close_reset() needs to check the return value and call uv_close() by hand if it encounters such errno's. As EINVAL (the socket has been shut down already) is handled explicitly, it would be better to also handle ECONNRESET (the socket has been reset by the remote) or such soft-failures gracefully.
Though it is a NetBSD-specific issue, a pkgsrc maintainer suggested to report this to the upstream.
https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58234
The text was updated successfully, but these errors were encountered: