diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/message.cpp | 12 | ||||
-rw-r--r-- | src/socket.cpp | 13 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/message.cpp b/src/message.cpp index 9b56cc8ca..e69ce94ab 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -48,18 +48,6 @@ extern std::vector<ircd_module*> factory; extern time_t TIME; extern ServerConfig* Config; -void Blocking(int s) -{ - int flags = fcntl(s, F_GETFL, 0); - fcntl(s, F_SETFL, flags ^ O_NONBLOCK); -} - -void NonBlocking(int s) -{ - int flags = fcntl(s, F_GETFL, 0); - fcntl(s, F_SETFL, flags | O_NONBLOCK); -} - int c_count(userrec* u) { int z = 0; diff --git a/src/socket.cpp b/src/socket.cpp index 1916bb555..58e2c5bad 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -209,6 +209,19 @@ bool MatchCIDR(const char* address, const char* cidr_mask, bool match_with_usern return MatchCIDRBits(addr_raw, mask_raw, bits); } +inline void Blocking(int s) +{ + int flags = fcntl(s, F_GETFL, 0); + fcntl(s, F_SETFL, flags ^ O_NONBLOCK); +} + +inline void NonBlocking(int s) +{ + int flags = fcntl(s, F_GETFL, 0); + fcntl(s, F_SETFL, flags | O_NONBLOCK); +} + + /** This will bind a socket to a port. It works for UDP/TCP. * It can only bind to IP addresses, if you wish to bind to hostnames * you should first resolve them using class 'Resolver'. |