diff options
| author | Adnan Maolood <[email protected]> | 2021-02-23 09:27:03 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-02-23 09:28:14 -0500 |
| commit | 5ab7617efd91c6aa95a61014354a3dca65bd3af6 (patch) | |
| tree | 5ab6fac4ebc8fda90dc3373c2b046f6d81711da7 | |
| parent | tofu: Update documentation (diff) | |
| download | go-gemini-5ab7617efd91c6aa95a61014354a3dca65bd3af6.tar.xz go-gemini-5ab7617efd91c6aa95a61014354a3dca65bd3af6.zip | |
server: Fix Shutdown with no active listeners
Shutdown and Close will hang if there are no active listeners or
connections. Try to close the done channel to avoid that.
| -rw-r--r-- | server.go | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -150,6 +150,8 @@ func (srv *Server) Shutdown(ctx context.Context) error { srv.closed = true srv.shutdown = true + srv.tryCloseDoneLocked() + // Close all active listeners. for _, cancel := range srv.listeners { cancel() |