os: return error.SocketNotListening for EINVAL on accept (#6226)
parent
969547902b
commit
50e3906951
|
@ -1641,6 +1641,9 @@ pub const StreamServer = struct {
|
||||||
/// by the socket buffer limits, not by the system memory.
|
/// by the socket buffer limits, not by the system memory.
|
||||||
SystemResources,
|
SystemResources,
|
||||||
|
|
||||||
|
/// Socket is not listening for new connections.
|
||||||
|
SocketNotListening,
|
||||||
|
|
||||||
ProtocolFailure,
|
ProtocolFailure,
|
||||||
|
|
||||||
/// Firewall rules forbid connection.
|
/// Firewall rules forbid connection.
|
||||||
|
|
|
@ -2802,6 +2802,9 @@ pub const AcceptError = error{
|
||||||
/// by the socket buffer limits, not by the system memory.
|
/// by the socket buffer limits, not by the system memory.
|
||||||
SystemResources,
|
SystemResources,
|
||||||
|
|
||||||
|
/// Socket is not listening for new connections.
|
||||||
|
SocketNotListening,
|
||||||
|
|
||||||
ProtocolFailure,
|
ProtocolFailure,
|
||||||
|
|
||||||
/// Firewall rules forbid connection.
|
/// Firewall rules forbid connection.
|
||||||
|
@ -2870,7 +2873,7 @@ pub fn accept(
|
||||||
EBADF => unreachable, // always a race condition
|
EBADF => unreachable, // always a race condition
|
||||||
ECONNABORTED => return error.ConnectionAborted,
|
ECONNABORTED => return error.ConnectionAborted,
|
||||||
EFAULT => unreachable,
|
EFAULT => unreachable,
|
||||||
EINVAL => unreachable,
|
EINVAL => return error.SocketNotListening,
|
||||||
ENOTSOCK => unreachable,
|
ENOTSOCK => unreachable,
|
||||||
EMFILE => return error.ProcessFdQuotaExceeded,
|
EMFILE => return error.ProcessFdQuotaExceeded,
|
||||||
ENFILE => return error.SystemFdQuotaExceeded,
|
ENFILE => return error.SystemFdQuotaExceeded,
|
||||||
|
|
Loading…
Reference in New Issue