From c905a41e2aa1310620582cbcd4b6bf8c75a0732f Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 20 Apr 2015 14:29:38 +0900 Subject: [PATCH] Reminder in debug output to explain high CPU usage --- cmd/syncthing/gui_auth.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/syncthing/gui_auth.go b/cmd/syncthing/gui_auth.go index b0391a782..1fe62b587 100644 --- a/cmd/syncthing/gui_auth.go +++ b/cmd/syncthing/gui_auth.go @@ -42,6 +42,10 @@ func basicAuthAndSessionMiddleware(cfg config.GUIConfiguration, next http.Handle } } + if debugHTTP { + l.Debugln("Sessionless HTTP request with authentication; this is expensive.") + } + error := func() { time.Sleep(time.Duration(rand.Intn(100)+100) * time.Millisecond) w.Header().Set("WWW-Authenticate", "Basic realm=\"Authorization Required\"")