(r ...io.Reader)
| 348 | } |
| 349 | |
| 350 | func (p *proxy) discardMulti(r ...io.Reader) error { |
| 351 | var wg sync.WaitGroup |
| 352 | errs := make([]error, len(r), len(r)) |
| 353 | for i := 0; i < len(r); i++ { |
| 354 | wg.Add(1) |
| 355 | go func(i int) { |
| 356 | defer wg.Done() |
| 357 | if _, err := io.Copy(io.Discard, r[i]); err != nil { |
| 358 | errs[i] = fmt.Errorf("discard r[%d]: %w", i, err) |
| 359 | } |
| 360 | }(i) |
| 361 | } |
| 362 | wg.Wait() |
| 363 | return errors.Join(errs...) |
| 364 | } |
| 365 | |
| 366 | // proxyHTTP1 proxies an HTTP connection between the client and server. |
| 367 | func (p *proxy) proxyHTTP1(cli, srv *bufConn) error { |
no test coverage detected