Skip to content

Commit

Permalink
fix(sdk): http sse ctx error (#3445)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsamin authored and yesnault committed Oct 11, 2018
1 parent 82d6c28 commit 826e713
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions sdk/cdsclient/http_sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,11 @@ func (c *client) RequestSSEGet(ctx context.Context, path string, evCh chan<- SSE
var currEvent *SSEvent
var EOF bool

go func(stop *bool) {
<-ctx.Done()
*stop = true
}(&EOF)

for !EOF {
if ctx.Err() != nil {
return ctx.Err()
}

bs, err := br.ReadBytes('\n')
if err != nil && err != io.EOF {
return err
Expand Down

0 comments on commit 826e713

Please sign in to comment.