--- gvpe/src/connection.C 2013/10/11 04:07:24 1.108 +++ gvpe/src/connection.C 2013/10/11 07:56:07 1.109 @@ -883,7 +883,7 @@ reset_si (); - bool slow = si.prot & PROT_SLOW; + bool slow = (si.prot & PROT_SLOW) || (conf->low_power || THISNODE->low_power); if (si.prot && !si.host && vpn->can_direct (THISNODE, conf)) { @@ -903,14 +903,17 @@ if (dsi.valid () && auth_rate_limiter.can (dsi)) { - if (retry_cnt < 4) + // use ping after the first few retries + // TODO: on rekeys, the other node might not interpret ping correctly, + // TODO: as it will still have a valid connection + if (retry_cnt < 4 && (!conf->low_power || THISNODE->low_power)) send_auth_request (dsi, true); else send_ping (dsi, 0); } } - retry_int *= slow ? 8. : 0.9; + retry_int *= slow ? 4. : 0.9; if (retry_int < conf->max_retry) retry_cnt++; @@ -995,7 +998,7 @@ connection::post_inject_queue () { // force a connection every now and when when packets are sent (max 1/s) - if (ev_now () - last_establish_attempt >= 0.95) // arbitrary + if (ev_now () - last_establish_attempt >= (conf->low_power || THISNODE->low_power ? 2.95 : 0.95)) // arbitrary establish_connection.stop (); establish_connection ();