well this didnt help but still think 64k might be a bit short
This commit is contained in:
Alug committed 2025-03-29 03:10:25 +01:00
1 parent a726646ff3
commit 636feddeb3
1 file changed
+7 -27
+7 -27
View File
@@ -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"));
}
}