]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib: turned some knobs
authorMarek Vavruša <marek.vavrusa@nic.cz>
Sat, 27 Jun 2015 19:51:36 +0000 (21:51 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Sat, 27 Jun 2015 19:51:36 +0000 (21:51 +0200)
daemon/worker.c
lib/nsrep.c

index bd6d518caa205995a7aede0fa26cb8fdecaccaff..bfcfd1dc9a01bca7f29e7b4b2ad2ac0d8b2f4bb3 100644 (file)
@@ -140,15 +140,15 @@ static void qr_task_free(uv_handle_t *handle)
                array_push(worker->pools, mp_context);
        } else {
                mp_delete(mp_context);
+       }
 #if defined(__GLIBC__) && defined(_GNU_SOURCE)
-               /* Decommit memory every once in a while */
-               static size_t mp_delete_count = 0;
-               if (++mp_delete_count == 100 * MP_FREELIST_SIZE) {
-                       malloc_trim(0);
-                       mp_delete_count = 0;
-               }
-#endif
+       /* Decommit memory every once in a while */
+       static size_t mp_delete_count = 0;
+       if (++mp_delete_count == 100 * MP_FREELIST_SIZE) {
+               malloc_trim(0);
+               mp_delete_count = 0;
        }
+#endif
 }
 
 static void qr_task_timeout(uv_timer_t *req)
index cb315d72d5c42391e26d3cfe9383bef909bc5ed3..ab015603ffe1a9a7f7192cfcb939aee2dcb94777 100644 (file)
@@ -123,8 +123,8 @@ static int eval_nsrep(const char *k, void *v, void *baton)
                update_nsrep(ns, (const knot_dname_t *)k, addr, score);
                ns->reputation = reputation;
        } else {
-               /* With 10% chance, probe server with a probability given by its RTT / MAX_RTT */
-               if ((kr_rand_uint(100) < 10) && (kr_rand_uint(KR_NS_MAX_SCORE) >= score)) {
+               /* With 5% chance, probe server with a probability given by its RTT / MAX_RTT */
+               if ((kr_rand_uint(100) < 5) && (kr_rand_uint(KR_NS_MAX_SCORE) >= score)) {
                        /* If this is a low-reliability probe, go with TCP to get ICMP reachability check. */
                        if (score >= KR_NS_LONG) {
                                qry->flags |= QUERY_TCP;