From 12f85902289f5daf57982efaed5d047dcdacf251 Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Thu, 21 Feb 2019 19:01:20 +0300 Subject: [PATCH] /tls/configure -- don't close https connection mid-request when configuration removes ports and certificates --- control.go | 1 + 1 file changed, 1 insertion(+) diff --git a/control.go b/control.go index a87bd2cd..8c2fa789 100644 --- a/control.go +++ b/control.go @@ -1104,6 +1104,7 @@ func handleTLSConfigure(w http.ResponseWriter, r *http.Request) { // until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely if restartHTTPS { go func() { + time.Sleep(time.Second) // TODO: could not find a way to reliably know that data was fully sent to client by https server, so we wait a bit to let response through before closing the server httpsServer.cond.Broadcast() if httpsServer.server != nil { httpsServer.server.Shutdown(context.TODO())