Skip to content

Commit

Permalink
fix(sdk): http sse EOF (#3446)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsamin authored and bnjjj committed Oct 11, 2018
1 parent 826e713 commit 45c3c5f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sdk/cdsclient/http_sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit 45c3c5f

Please sign in to comment.