From cfae06db65f110bce05ff69f12da4e497851d233 Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Tue, 19 Aug 2014 23:18:28 +0100 Subject: [PATCH] Flush headers before potentially blocking --- cmd/syncthing/gui.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index 698682c9a..598e1e21d 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -459,6 +459,11 @@ func restGetEvents(w http.ResponseWriter, r *http.Request) { since, _ := strconv.Atoi(sinceStr) limit, _ := strconv.Atoi(limitStr) + // Flush before blocking, to indicate that we've received the request + // and that it should not be retried. + f := w.(http.Flusher) + f.Flush() + evs := eventSub.Since(since, nil) if 0 < limit && limit < len(evs) { evs = evs[len(evs)-limit:]