| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a1dea66 commit 773f587
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -865,6 +865,20 @@ static int uv__try_write(uv_stream_t* stream, | |||
| 865 | 865 | if (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS) | |
| 866 | 866 | return UV_EAGAIN; | |
| 867 | 867 | ||
| 868 | + #ifdef __APPLE__ | ||
| 869 | + /* macOS versions 10.10 and 10.15 - and presumbaly 10.11 to 10.14, too - | ||
| 870 | + * have a bug where a race condition causes the kernel to return EPROTOTYPE | ||
| 871 | + * because the socket isn't fully constructed. It's probably the result of | ||
| 872 | + * the peer closing the connection and that is why libuv translates it to | ||
| 873 | + * ECONNRESET. Previously, libuv retried until the EPROTOTYPE error went | ||
| 874 | + * away but some VPN software causes the same behavior except the error is | ||
| 875 | + * permanent, not transient, turning the retry mechanism into an infinite | ||
| 876 | + * loop. See https://github.com/libuv/libuv/pull/482. | ||
| 877 | + */ | ||
| 878 | + if (errno == EPROTOTYPE) | ||
| 879 | + return UV_ECONNRESET; | ||
| 880 | + #endif /* __APPLE__ */ | ||
| 881 | + | ||
| 868 | 882 | return UV__ERR(errno); | |
| 869 | 883 | } | |
| 870 | 884 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments