From 9fc0462a0e3a33835e0997ac2479240eb133c80b Mon Sep 17 00:00:00 2001 From: ahmedsobeh Date: Mon, 8 Nov 2021 15:21:10 +0100 Subject: [PATCH 1/4] feat(client): cancel blocking DNS lookup if GaiFuture dropped --- src/client/connect/dns.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/connect/dns.rs b/src/client/connect/dns.rs index 6be80b6e0f..86fa0c55cf 100644 --- a/src/client/connect/dns.rs +++ b/src/client/connect/dns.rs @@ -159,6 +159,10 @@ impl fmt::Debug for GaiFuture { } } +impl Drop for GaiFuture { + fn drop(&mut self){JoinHandle::abort(self)} +} + impl Iterator for GaiAddrs { type Item = SocketAddr; From 1c6329d4c0c0ebdfdeff7633cff5fc6fc4ae8f83 Mon Sep 17 00:00:00 2001 From: ahmedsobeh Date: Mon, 8 Nov 2021 15:24:51 +0100 Subject: [PATCH 2/4] feat(client): cancel blocking DNS lookup if GaiFuture dropped --- src/client/connect/dns.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/connect/dns.rs b/src/client/connect/dns.rs index 86fa0c55cf..266376dbb3 100644 --- a/src/client/connect/dns.rs +++ b/src/client/connect/dns.rs @@ -160,7 +160,7 @@ impl fmt::Debug for GaiFuture { } impl Drop for GaiFuture { - fn drop(&mut self){JoinHandle::abort(self)} + fn drop(&mut self) { JoinHandle::abort(self) } } impl Iterator for GaiAddrs { From 376992ef80944243e5ddfcce27697f1d550b3725 Mon Sep 17 00:00:00 2001 From: ahmedsobeh Date: Mon, 8 Nov 2021 19:57:46 +0100 Subject: [PATCH 3/4] feat(client): cancel blocking DNS lookup if GaiFuture dropped --- src/client/connect/dns.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/connect/dns.rs b/src/client/connect/dns.rs index 266376dbb3..979051cea8 100644 --- a/src/client/connect/dns.rs +++ b/src/client/connect/dns.rs @@ -160,7 +160,7 @@ impl fmt::Debug for GaiFuture { } impl Drop for GaiFuture { - fn drop(&mut self) { JoinHandle::abort(self) } + fn drop(&mut self) { self.inner.abort() } } impl Iterator for GaiAddrs { From dfce6a6f338202eaf10927b86cb530822cd06507 Mon Sep 17 00:00:00 2001 From: Ahmed Sobeh Date: Mon, 8 Nov 2021 20:45:44 +0100 Subject: [PATCH 4/4] feat(client): cancel blocking DNS lookup if GaiFuture dropped Co-authored-by: Sean McArthur --- src/client/connect/dns.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/connect/dns.rs b/src/client/connect/dns.rs index 979051cea8..968d8567cb 100644 --- a/src/client/connect/dns.rs +++ b/src/client/connect/dns.rs @@ -160,7 +160,9 @@ impl fmt::Debug for GaiFuture { } impl Drop for GaiFuture { - fn drop(&mut self) { self.inner.abort() } + fn drop(&mut self) { + self.inner.abort(); + } } impl Iterator for GaiAddrs {