From e587402c2649257a302077f97f07928439c915d5 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Sun, 3 Aug 2014 14:02:56 -0700 Subject: [PATCH] server: Flush headers when using wait=true and stream=true MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many http clients will missbehave unless they get an initial http- response, even when long-polling. It also saves the user/client from having to handle headers on the first action of the watch, but rather handle the response immediately. Original commit: 2338481bb1d5ab3af95188d21db70512b03ccf38 From: Christoffer Vikström --- etcd/v2_http_get.go | 1 + 1 file changed, 1 insertion(+) diff --git a/etcd/v2_http_get.go b/etcd/v2_http_get.go index e7c79a16e..8e0deb529 100644 --- a/etcd/v2_http_get.go +++ b/etcd/v2_http_get.go @@ -59,6 +59,7 @@ func (p *participant) handleWatch(key string, recursive, stream bool, waitIndex closeChan := cn.CloseNotify() p.writeHeaders(w) + w.(http.Flusher).Flush() if stream { // watcher hub will not help to remove stream watcher