chiark / gitweb /
server/peer.c: Always send `BYE' packets on peer death.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 25 May 2020 15:21:14 +0000 (16:21 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 25 May 2020 15:21:14 +0000 (16:21 +0100)
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.

server/peer.c
server/tripe-admin.5.in

index 95306836d3211519bb1e8a76a62bbbc38352bd01..dab3bfcf08e1a409be0e7f7dd1198caa6cd635bb 100644 (file)
@@ -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);
index 2055c9ab9f46bf685018ad7a28038b6344208608..50933a8a8efc1248c39a060f0b171390ffd6f732 100644 (file)
@@ -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