etcp: link_status = remote_keepalive && recv_keepalive (вместо только remote)
- link_status теперь требует двусторонней слышимости: remote && local - recv_keepalive восстанавливается ДО вычисления link_status (избегает заклинивания) - loadbalancer_link_ready по переходу 0→1 с проверкой was_up
This commit is contained in:
1 parent
c5b4ec7a05
commit
b2e72db31b
1 file changed
+13
-11
+13
-11
@@ -1569,21 +1569,23 @@ process_decrypted:
|
||||
pkt->noencrypt_len=0;
|
||||
pkt->link=link;
|
||||
|
||||
link->remote_keepalive=pkt->flag_up;
|
||||
if ( link->remote_keepalive && !link->link_status && link->initialized) loadbalancer_link_ready(link);// up выставляем только если и remote=up и local=up
|
||||
link->link_status=link->remote_keepalive;
|
||||
link->remote_keepalive = pkt->flag_up;
|
||||
|
||||
/* restore recv_keepalive BEFORE computing link_status = remote && local */
|
||||
if (link->recv_keepalive != 1) {
|
||||
link->recv_keepalive = 1;
|
||||
DEBUG_INFO(DEBUG_CATEGORY_CONNECTION, "[%s] Link %p (local_id=%d) status changed to UP - packet received",
|
||||
link->etcp->log_name, link, link->local_link_id);
|
||||
}
|
||||
|
||||
int was_up = link->link_status;
|
||||
link->link_status = link->remote_keepalive && link->recv_keepalive;
|
||||
if (link->link_status && !was_up && link->initialized)
|
||||
loadbalancer_link_ready(link);
|
||||
|
||||
link->last_recv_local_time=get_time_tb();
|
||||
link->last_recv_timestamp=pkt->timestamp;
|
||||
link->last_recv_updated=1;
|
||||
|
||||
// Mark link as up when receiving packets
|
||||
if (link->recv_keepalive != 1) {
|
||||
link->recv_keepalive = 1;
|
||||
// loadbalancer_link_ready(link);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_CONNECTION, "[%s] Link %p (local_id=%d) status changed to UP - packet received",
|
||||
link->etcp->log_name, link, link->local_link_id);
|
||||
}
|
||||
|
||||
// Count decrypted bytes
|
||||
link->total_decrypted += pkt->data_len;
|
||||
|
||||
Reference in new issue
Block a user