Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 773f587

Browse filesBrowse files
bnoordhuisdanielleadams
authored andcommitted
deps: cherry-pick libuv/libuv@3a7b955
Original commit log follows: darwin: translate EPROTOTYPE to ECONNRESET (libuv/libuv#3413) macOS versions 10.10 and 10.15 - and presumbaly 10.11 to 10.14, too - have a bug where a race condition causes the kernel to return EPROTOTYPE because the socket isn't fully constructed. It's probably the result of the peer closing the connection and that is why libuv translates it to ECONNRESET. Previously, libuv retried until the EPROTOTYPE error went away but some VPN software causes the same behavior except the error is permanent, not transient, turning the retry mechanism into an infinite loop. Refs: libuv/libuv#482 Refs: libuv/libuv#3405 Fixes: #43916 PR-URL: #43950 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent a1dea66 commit 773f587
Copy full SHA for 773f587

File tree

Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed
Open diff view settings
Collapse file

‎deps/uv/src/unix/stream.c‎

Copy file name to clipboardExpand all lines: deps/uv/src/unix/stream.c
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,20 @@ static int uv__try_write(uv_stream_t* stream,
865865
if (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS)
866866
return UV_EAGAIN;
867867

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+
868882
return UV__ERR(errno);
869883
}
870884

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.