Fix error type in QUIC listener

This commit is contained in:
Zoltán Papp 2024-12-03 13:33:14 +01:00
parent 81425872e1
commit e69b8f5788

View File

@ -91,7 +91,7 @@ func (c *Conn) isClosed() bool {
func (c *Conn) ioErrHandling(err error) error {
if c.isClosed() {
return io.EOF
return net.ErrClosed
}
// Handle QUIC-specific errors
@ -102,7 +102,7 @@ func (c *Conn) ioErrHandling(err error) error {
// Check if the connection was closed remotely
var appErr *quic.ApplicationError
if errors.As(err, &appErr) && appErr.ErrorCode == 0 { // 0 is normal closure
return io.EOF
return net.ErrClosed
}
return err