serveStream copies a cached body from r back to the client, reconstructing 206 Partial Content semantics when the original request had a Range header. size is the on-disk length (known up front), so Content-Length and the Content-Range total are set before any body bytes flow — same response shape t
(w http.ResponseWriter, r io.Reader, size int64, rangeHeader, contentType string)
| 664 | return strings.Contains(msg, "connection reset by peer") || |
| 665 | strings.Contains(msg, "connection refused") || |
| 666 | strings.Contains(msg, "unexpected eof") || |
| 667 | strings.Contains(msg, "timeout") |
| 668 | } |
| 669 | |
| 670 | func originFetchOutcome(err error) string { |
| 671 | if err == nil { |
| 672 | return "success" |
| 673 | } |
| 674 | var oe *originStatusError |
| 675 | if errors.As(err, &oe) { |
| 676 | return "http_error" |
| 677 | } |
| 678 | if errors.Is(err, context.Canceled) { |
| 679 | return "canceled" |