| 356 | } |
| 357 | |
| 358 | func (rp *http2RespWriter) Write(p []byte) (n int, err error) { |
| 359 | defer func() { |
| 360 | // Implementer of OriginClient should make sure it doesn't write to the connection after Proxy returns |
| 361 | // Register a recover routine just in case. |
| 362 | if r := recover(); r != nil { |
| 363 | rp.log.Debug().Msgf("Recover from http2 response writer panic, error %s", debug.Stack()) |
| 364 | } |
| 365 | }() |
| 366 | n, err = rp.w.Write(p) |
| 367 | if err == nil && rp.shouldFlush { |
| 368 | rp.flusher.Flush() |
| 369 | } |
| 370 | return n, err |
| 371 | } |
| 372 | |
| 373 | func (rp *http2RespWriter) Close() error { |
| 374 | return nil |