diff --git a/src/i_tcp.c b/src/i_tcp.c index 0edeaaa3e..8ce42cb41 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -1015,9 +1015,9 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen } CONS_Printf(M_GetText("Network system buffer: %dKb\n"), opt>>10); - if (opt < 208<<10) // 208k this is what i have on my arch system + if (opt < 128<<10) // 128k should be good? { - opt = 208<<10; + opt = 128<<10; opts = (socklen_t)sizeof(opt); rc = setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, opts); if (rc <= -1) @@ -1033,10 +1033,10 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen I_OutputMsg("getting SO_RCVBUF failed: #%u, %s\n", e, strerror(e)); } - if (opt < 208<<10) + if (opt < 128<<10) { - CONS_Alert(CONS_WARNING, M_GetText("Can't set buffer length to 208k, retrying with 128k\n")); - opt = 128<<10; + CONS_Alert(CONS_WARNING, M_GetText("Can't set buffer length to 128k, retrying with 64k\n")); + opt = 64<<10; opts = (socklen_t)sizeof(opt); rc = setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, opts); if (rc <= -1) @@ -1052,28 +1052,8 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen I_OutputMsg("getting SO_RCVBUF failed: #%u, %s\n", e, strerror(e)); } - if (opt < 128<<10) - { - CONS_Alert(CONS_WARNING, M_GetText("Can't set buffer length to 128k, retrying with 64k\n")); - opt = 64<<10; - opts = (socklen_t)sizeof(opt); - rc = setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, opts); - if (rc <= -1) - { - e = errno; - I_OutputMsg("setting SO_RCVBUF failed: #%u, %s\n", e, strerror(e)); - } - opt = 0; - rc = getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, &opts); - if (rc <= -1) - { - e = errno; - I_OutputMsg("getting SO_RCVBUF failed: #%u, %s\n", e, strerror(e)); - } - - if (opt < 64<<10) - CONS_Alert(CONS_WARNING, M_GetText("Can't set buffer length to 64k, file transfer will be bad\n")); - } + if (opt < 64<<10) + CONS_Alert(CONS_WARNING, M_GetText("Can't set buffer length to 64k, file transfer will be bad\n")); } }