From 8e48c4f3fe2a8beb5fa9482adf6b344a02c9dce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Tue, 6 May 2008 19:13:08 +0000 Subject: [PATCH] Bias quality to avoid exposure of transient errors --- transports.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transports.c b/transports.c index 8b7275f2..19da2cd3 100644 --- a/transports.c +++ b/transports.c @@ -248,11 +248,14 @@ transport_get_prio(th_transport_t *t) * * But for sorting, we want low numbers first * + * Also, we bias and trim with an offset of two to avoid counting any + * transient errors. */ + static int transport_get_quality(th_transport_t *t) { - return t->tht_quality_index ? -(t->tht_quality_index(t)) : 0; + return t->tht_quality_index ? -MIN(t->tht_quality_index(t) + 2, 0) : 0; }