From: Mark Wooding Date: Mon, 25 May 2020 15:21:14 +0000 (+0100) Subject: server/peer.c: Always send `BYE' packets on peer death. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/commitdiff_plain/136f3f44e25317d5423b4bc0b075b297e6d00c93?ds=sidebyside server/peer.c: Always send `BYE' packets on peer death. The peer can ignore them if it likes. The point really is that different ends of a connection can have different ideas about its ephemeral-ness without any logical problems. --- diff --git a/server/peer.c b/server/peer.c index 95306836..dab3bfcf 100644 --- a/server/peer.c +++ b/server/peer.c @@ -1237,7 +1237,7 @@ void p_destroy(peer *p, int bye) T( trace(T_PEER, "peer: destroying peer `%s'", p->spec.name); ) - if (bye && (p->spec.f&PSF_EPHEM)) { + if (bye) { b = p_txstart(p, MSG_MISC | MISC_BYE); buf_init(&bb, buf_t, sizeof(buf_t)); assert(BOK(&bb)); buf_flip(&bb); diff --git a/server/tripe-admin.5.in b/server/tripe-admin.5.in index 2055c9ab..50933a8a 100644 --- a/server/tripe-admin.5.in +++ b/server/tripe-admin.5.in @@ -363,18 +363,18 @@ sends us something before responding. .TP .B "\-ephemeral" The association with the peer is not intended to persist indefinitely. -If a peer marked as ephemeral is killed, or the +When a peer is killed, or the .BR tripe (8) -daemon is shut down, send a +daemon is shut down, a .B bye -packet to the peer so that it forgets about us; if a peer marked as -ephemeral sends us a +packet is to the peer(s). If a peer marked as ephemeral sends us a .B bye packet then it is killed (but in this case no further .B bye -packet is sent). Peers not marked as ephemeral exhibit neither of these -behaviours; each peer must have the other marked as ephemeral for the -association to be fully torn down if either end kills the other. +packet is sent). A +.B bye +packet from a peer which isn't marked as ephemeral leaves the peer alone +in the hope that the connection can be reestablished. .TP .BI "\-keepalive " time Send a no-op packet if we've not sent a packet to the peer in the last