Browse Source

Flush headers before potentially blocking

Audrius Butkevicius 11 years ago
parent
commit
cfae06db65
1 changed files with 5 additions and 0 deletions
  1. 5 0
      cmd/syncthing/gui.go

+ 5 - 0
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:]