Defer automatic retries until Android standby wakes
This commit is contained in:
1 parent
f12bab8676
commit
7ec5f931bb
3 files changed
+51
-3
No files matched your search
@@ -179,7 +179,7 @@ static void tgc_resume(void* arg) {
|
||||
|
||||
static int tgc_pause(struct TOPO_GROUP_CONNECT* gc) {
|
||||
#ifdef UTUN_HAVE_STANDBY
|
||||
if (standby_is_enabled()) {
|
||||
if (standby_get_sleep_tb() > 0) {
|
||||
gc->pause_wait = standby_wait(gc, tgc_resume);
|
||||
if (gc->pause_wait) { gc->paused = 1; return 1; }
|
||||
DEBUG_WARN(DEBUG_CATEGORY_BGP, "cannot wait for standby; using group retry timer");
|
||||
@@ -265,6 +265,9 @@ static void tgc_step(void* arg) {
|
||||
topo_group_peer_close(request); pending[c->kind]--; c->retry_at = now; changed = 1;
|
||||
}
|
||||
}
|
||||
#ifdef UTUN_HAVE_STANDBY
|
||||
if (!gc->paused && standby_get_sleep_tb() > 0) tgc_pause(gc);
|
||||
#endif
|
||||
for (int kind = TGC_SUPER; !gc->paused && kind < TGC_CLASSES; kind++) {
|
||||
if (!allowed[kind]) continue;
|
||||
int limit = gc->self_super && kind == TGC_SUPER ? TGC_PARALLEL : TGC_TARGET - up[kind];
|
||||
|
||||
Reference in new issue
Block a user