framer: fix early exit/truncation in framer

This commit is contained in:
Michael Schurter
2018-05-02 09:47:08 -07:00
parent 361db269c2
commit 6858c520b2
4 changed files with 32 additions and 18 deletions

View File

@@ -363,7 +363,6 @@ func (s *HTTPServer) fsStreamImpl(resp http.ResponseWriter,
errCh <- CodedError(500, err.Error())
return
}
encoder.Reset(httpPipe)
for {
select {
@@ -397,6 +396,8 @@ func (s *HTTPServer) fsStreamImpl(resp http.ResponseWriter,
handler(handlerPipe)
cancel()
codedErr := <-errCh
// Ignore EOF and ErrClosedPipe errors.
if codedErr != nil &&
(codedErr == io.EOF ||
strings.Contains(codedErr.Error(), "closed") ||