openbsd,tcp: special handling of EINVAL on connect
Map `EINVAL` to `ECONNREFUSED` and return error on the next tick. Fixes: https://github.com/libuv/libuv/issues/2155 PR-URL: https://github.com/libuv/libuv/pull/2154 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
f66eda7cba
commit
110eb817bd
@ -235,12 +235,16 @@ int uv__tcp_connect(uv_connect_t* req,
|
||||
if (r == -1 && errno != 0) {
|
||||
if (errno == EINPROGRESS)
|
||||
; /* not an error */
|
||||
else if (errno == ECONNREFUSED)
|
||||
/* If we get a ECONNREFUSED wait until the next tick to report the
|
||||
* error. Solaris wants to report immediately--other unixes want to
|
||||
* wait.
|
||||
else if (errno == ECONNREFUSED
|
||||
#if defined(__OpenBSD__)
|
||||
|| errno == EINVAL
|
||||
#endif
|
||||
)
|
||||
/* If we get ECONNREFUSED (Solaris) or EINVAL (OpenBSD) wait until the
|
||||
* next tick to report the error. Solaris and OpenBSD wants to report
|
||||
* immediately -- other unixes want to wait.
|
||||
*/
|
||||
handle->delayed_error = UV__ERR(errno);
|
||||
handle->delayed_error = UV__ERR(ECONNREFUSED);
|
||||
else
|
||||
return UV__ERR(errno);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user