fix: tgc_phase1_timeout closing all handles including connected ones
This commit is contained in:
1 parent
513ec75c28
commit
a0ba6dee21
1 file changed
+10
-2
@@ -260,8 +260,16 @@ static void tgc_phase1_timeout(void* arg) {
|
||||
}
|
||||
u_free(ids);
|
||||
|
||||
for (int i = 0; i < gc->handle_count; i++) { conn_mgr_close(gc->handles[i]); gc->handles[i] = NULL; }
|
||||
gc->handle_count = 0;
|
||||
int remaining = 0;
|
||||
for (int i = 0; i < gc->handle_count; i++) {
|
||||
struct CONN_MGR_HANDLE* h = gc->handles[i];
|
||||
if (h && conn_mgr_get_conn(h) != NULL) {
|
||||
gc->handles[remaining++] = h;
|
||||
} else {
|
||||
if (h) conn_mgr_close(h);
|
||||
}
|
||||
}
|
||||
gc->handle_count = remaining;
|
||||
|
||||
if (gc->connected_count > 0) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_BGP, "%s: Phase1 done — %d connected, skipping Phase 2", TGC_ID, gc->connected_count);
|
||||
|
||||
Reference in new issue
Block a user