Skip to content

Commit

Permalink
fix: return ErrConnClosed if write frame failed (yomorun#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
woorui authored Nov 17, 2023
1 parent 04ecc45 commit ccfcc5a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/listener/quic/quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ func (p *FrameConn) WriteFrame(f frame.Frame) error {
default:
b, err := p.codec.Encode(f)
if err != nil {
return err
return &ErrConnClosed{err.Error()}
}

return p.prw.WritePacket(p.stream, f.Type(), b)
if err := p.prw.WritePacket(p.stream, f.Type(), b); err != nil {
return &ErrConnClosed{err.Error()}
}
return nil
}
}

Expand Down

0 comments on commit ccfcc5a

Please sign in to comment.