Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <mabaul@microsoft.com>2020-01-09 20:09:29 +0300
committerGitHub <noreply@github.com>2020-01-09 20:09:29 +0300
commit50c317c3a48b00dbd1b8e3f92318b138158ec642 (patch)
tree73f07722d876c44de6a5f0c5d78b8b475af8cc41
parent040fc1343f38e54ee16aef83728162ff87775b7a (diff)
parent094ee57c4cf687dacb8f66eb7e97f2b2faf61f6a (diff)
Merge pull request #389 from baulig/work-18030
[Sockets]: Always reset internal SAEA completion when reattempting connection in MultipleConnectAsync.
-rw-r--r--src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs b/src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs
index 5a3d9f897e..c9c5afa7d0 100644
--- a/src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs
+++ b/src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs
@@ -187,6 +187,15 @@ namespace System.Net.Sockets
// Keep track of this because it will be overwritten by AttemptConnection
SocketError currentFailure = args.SocketError;
+#if MONO
+ // Make sure we're always resetting the Mono-specific `in_progress` field when
+ // re-attempting a connection.
+ // If a previous connection failed asynchronously, then it will already have been
+ // resetted, but not on synchronous connection failures (such as for instance, the
+ // host not supporting IPv6 or the network being down).
+ // This should fix https://github.com/mono/mono/issues/18030.
+ args.in_progress = 0;
+#endif
Exception connectException = AttemptConnection();
if (connectException == null)