]> git.meshlink.io Git - meshlink/commitdiff
added log info
authorNiklas Hofmann <niklas.hofmann@everbase.net>
Sat, 9 Aug 2014 18:14:01 +0000 (20:14 +0200)
committerNiklas Hofmann <niklas.hofmann@everbase.net>
Sat, 9 Aug 2014 18:14:01 +0000 (20:14 +0200)
src/net.c

index 594d4bf8a51b4b296512e4b785f5889435ef3866..ed12924580e40955218608d5824a6b874c554f3c 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -261,6 +261,9 @@ static void periodic_handler(event_loop_t *loop, void *data) {
                }
 
                bool satisfied = dclass_ccounts_satisfied(mesh->self->dclass, ccounts, num_total);
+               int maxcc = max_ccount_from_dclass(mesh->self->dclass);
+
+               logger(mesh, MESHLINK_INFO, "* num_total = %d, satisfied = %d, maxcc = %d", num_total, satisfied, maxcc);
 
                if(!satisfied) {
                        logger(mesh, MESHLINK_INFO, "* Not enough active connections, try to add one.");
@@ -281,7 +284,7 @@ static void periodic_handler(event_loop_t *loop, void *data) {
                        cond_add_connection(mesh, num_unreachable, &found_random_unreachable_node);
                }
                
-               if(num_total > max_ccount_from_dclass(mesh->self->dclass)) {
+               if(num_total > maxcc) {
                        logger(mesh, MESHLINK_INFO, "* Too many active connections, try to remove one.");
                        /* Too many active connections, try to remove one.
                           Choose a random outgoing connection to a node