Let the server terminate if any of its main loops exits.noise-per-packetv0.20220703.0
commit33bc7d18a2f2b1d190b6182f402733837727328c
authorDavid Fifield <david@bamsoftware.com>
Wed, 16 Feb 2022 19:29:13 +0000 (16 12:29 -0700)
committerDavid Fifield <david@bamsoftware.com>
Wed, 16 Feb 2022 19:29:13 +0000 (16 12:29 -0700)
tree4bb957c123afe6dc6e9e8e451669fb89229e3377
parenteb02a9b657437fad61849466f25f216d41fb9a92
Let the server terminate if any of its main loops exits.

Before this, it was possible for the noiseLoop or acceptSessions
goroutine to return, and the other goroutine and the main ListenAndServe
would continue running uselessly. It's better for the whole process to
die, so that e.g. an external monitor can restart it.
champa-server/main.go