(dir, proto string, w io.Writer, r io.Reader)
| 1345 | } |
| 1346 | |
| 1347 | func (p *proxy) copyRawSingle(dir, proto string, w io.Writer, r io.Reader) error { |
| 1348 | n, err := io.Copy(w, r) |
| 1349 | dur := time.Since(p.begin).Nanoseconds() / 1000 |
| 1350 | switch { |
| 1351 | case err == nil: |
| 1352 | case errors.Is(err, net.ErrClosed): |
| 1353 | case errors.Is(err, unix.ECONNRESET): |
| 1354 | case errors.Is(err, unix.EPIPE): |
| 1355 | default: |
| 1356 | slog.Debug(fmt.Sprintf("copied bytes %s", dir), "proxy", p, "proto", proto, "bytes", n, "duration", dur, "err", err) |
| 1357 | return err |
| 1358 | } |
| 1359 | slog.Debug(fmt.Sprintf("copied bytes %s", dir), "proxy", p, "proto", proto, "bytes", n, "duration", dur) |
| 1360 | return nil |
| 1361 | } |
| 1362 | |
| 1363 | // bufConn is a net.Conn wrapper that supports peeking on the read side. |
| 1364 | type bufConn struct { |
no test coverage detected