util: Expose IOErrorIsPermanent in sock header
What changed, and why it matters
This commit simply moves a small helper function from one internal source file to a header file so it can be reused elsewhere. There is no change to what the function does, no bug fix, and no security-relevant behavior change.
No action required. This is a non-security refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit relocates IOErrorIsPermanent() from src/util/sock.cpp to src/util/sock.h, changing its linkage from static internal to inline. The function body and logic are identical. This is a pure refactoring/visibility change with no functional or security impact.
Changed components
src/util/sock.cppsrc/util/sock.hInspect captured patch +5 / −5
diff --git a/src/util/sock.cpp b/src/util/sock.cpp
index 8e0c0f47..db3f5fc9 100644
--- a/src/util/sock.cpp
+++ b/src/util/sock.cpp
@@ -26,11 +26,6 @@
#include <poll.h>
#endif
-static inline bool IOErrorIsPermanent(int err)
-{
- return err != WSAEAGAIN && err != WSAEINTR && err != WSAEWOULDBLOCK && err != WSAEINPROGRESS;
-}
-
Sock::Sock(SOCKET s) : m_socket(s) {}
Sock::Sock(Sock&& other)
diff --git a/src/util/sock.h b/src/util/sock.h
index e20b31e1..50c1ab00 100644
--- a/src/util/sock.h
+++ b/src/util/sock.h
@@ -23,6 +23,11 @@ class CThreadInterrupt;
*/
static constexpr auto MAX_WAIT_FOR_IO = 1s;
+inline bool IOErrorIsPermanent(int err)
+{
+ return err != WSAEAGAIN && err != WSAEINTR && err != WSAEWOULDBLOCK && err != WSAEINPROGRESS;
+}
+
/**
* RAII helper class that manages a socket and closes it automatically when it goes out of scope.
*/
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.