diff --git a/src/net/SocketError.hxx b/src/net/SocketError.hxx index 4c4ab9d81..682a8911f 100644 --- a/src/net/SocketError.hxx +++ b/src/net/SocketError.hxx @@ -165,11 +165,18 @@ SocketErrorCategory() noexcept #endif } +[[gnu::pure]] +static inline bool +IsSocketError(const std::system_error &e) noexcept +{ + return e.code().category() == SocketErrorCategory(); +} + [[gnu::pure]] static inline bool IsSocketErrorReceiveWouldBlock(const std::system_error &e) noexcept { - return e.code().category() == SocketErrorCategory() && + return IsSocketError(e) && IsSocketErrorReceiveWouldBlock(e.code().value()); }