From 8f0943621ee6d3d6923049ac43f3a983292e94c9 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Mon, 22 Jun 2009 21:13:41 +0200 Subject: [PATCH] Dont set socket buffers. --- src/netevent.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/netevent.c b/src/netevent.c index e0ef33b..4066f72 100644 --- a/src/netevent.c +++ b/src/netevent.c @@ -258,11 +258,10 @@ static void prepare_user_net(struct hub_info* hub, struct user* user) { int fd = user->net.sd; struct timeval timeout = { TIMEOUT_CONNECTED, 0 }; + +#ifdef SET_SENDBUG size_t sendbuf = 0; size_t recvbuf = 0; - - net_set_nonblocking(fd, 1); - net_set_nosigpipe(fd, 1); if (net_get_recvbuf_size(fd, &recvbuf) != -1) { @@ -275,6 +274,10 @@ static void prepare_user_net(struct hub_info* hub, struct user* user) if (sendbuf > MAX_SEND_BUF || !sendbuf) sendbuf = MAX_SEND_BUF; net_set_sendbuf_size(fd, sendbuf); } +#endif + + net_set_nonblocking(fd, 1); + net_set_nosigpipe(fd, 1); event_set(user->net.ev_read, fd, EV_READ | EV_PERSIST, net_on_read, user); event_set(user->net.ev_write, fd, EV_WRITE, net_on_write, user);