fix: connection close should stay outside the poll loop (#2308)
This commit is contained in:
+1
-1
@@ -291,11 +291,11 @@ fn poll<H>(
|
||||
.map(|a| a.to_string())
|
||||
.unwrap_or("?".to_owned())
|
||||
);
|
||||
let _ = conn.shutdown(Shutdown::Both);
|
||||
break;
|
||||
}
|
||||
|
||||
thread::sleep(sleep_time);
|
||||
}
|
||||
let _ = conn.shutdown(Shutdown::Both);
|
||||
});
|
||||
}
|
||||
|
||||
+3
-1
@@ -526,7 +526,9 @@ impl TrackingAdapter {
|
||||
if known.len() > MAX_TRACK_SIZE {
|
||||
known.truncate(MAX_TRACK_SIZE);
|
||||
}
|
||||
known.insert(0, hash);
|
||||
if !known.contains(&hash) {
|
||||
known.insert(0, hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user