summaryrefslogtreecommitdiff
path: root/src/socketengine.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-16 00:20:01 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-16 00:20:01 +0200
commitdbc6dc90283220c06b4f4946cf0a131d2f965884 (patch)
tree9caed28406ea857bd8c55cdefe8f584c661d6005 /src/socketengine.cpp
parentc66ce555ba09e930eb94388b9f874ce617055835 (diff)
Do not enable SO_LINGER on our sockets
Using this option allowed close() to block for up to a second Thanks to Shamsdeen and Rix for their assistance that made this fix possible Fixes issue #445 reported by @shaggie76 Fixes issue #494 reported by @Rixcho
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r--src/socketengine.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp
index 27abd0ad6..6c99edc95 100644
--- a/src/socketengine.cpp
+++ b/src/socketengine.cpp
@@ -166,12 +166,7 @@ int SocketEngine::NonBlocking(int fd)
void SocketEngine::SetReuse(int fd)
{
int on = 1;
- struct linger linger = { 0, 0 };
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof(on));
- /* This is BSD compatible, setting l_onoff to 0 is *NOT* http://web.irc.org/mla/ircd-dev/msg02259.html */
- linger.l_onoff = 1;
- linger.l_linger = 1;
- setsockopt(fd, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(linger));
}
int SocketEngine::RecvFrom(EventHandler* fd, void *buf, size_t len, int flags, sockaddr *from, socklen_t *fromlen)