From 45c3c5ffc61b2005e0c0fd93c9d480c5e5f6bb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Samin?= Date: Thu, 11 Oct 2018 14:51:48 +0200 Subject: [PATCH] fix(sdk): http sse EOF (#3446) --- sdk/cdsclient/http_sse.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/cdsclient/http_sse.go b/sdk/cdsclient/http_sse.go index a69e1cb451..2a5392dfc0 100644 --- a/sdk/cdsclient/http_sse.go +++ b/sdk/cdsclient/http_sse.go @@ -91,6 +91,10 @@ func (c *client) RequestSSEGet(ctx context.Context, path string, evCh chan<- SSE return err } + if err == io.EOF { + EOF = true + } + if len(bs) < 2 { continue } @@ -109,9 +113,7 @@ func (c *client) RequestSSEGet(ctx context.Context, path string, evCh chan<- SSE currEvent.Data = bytes.NewBuffer(bytes.TrimSpace(spl[1])) evCh <- *currEvent } - if err == io.EOF { - EOF = true - } + } return nil