reduce default http keepalive to just 30s because to viewers connections flood.

This commit is contained in:
UbitUmarov
2020-07-24 19:19:16 +01:00
parent d9a680703f
commit e08ca7402c
2 changed files with 16 additions and 24 deletions

View File

@@ -276,22 +276,24 @@ namespace OSHttpServer
if (context.TriggerKeepalive)
{
context.TriggerKeepalive = false;
context.MonitorKeepaliveStartMS = nowMS + 1;
context.MonitorKeepaliveStartMS = nowMS + 500;
return false;
}
if (context.MonitorKeepaliveStartMS != 0)
{
if (context.IsClosing)
{
disconnectError = SocketError.Success;
return true;
}
if (EnvironmentTickCountAdd(context.TimeoutKeepAlive, context.MonitorKeepaliveStartMS) < nowMS)
{
if(context.IsClosing)
disconnectError = SocketError.Success;
else
disconnectError = SocketError.TimedOut;
disconnectError = SocketError.TimedOut;
context.MonitorKeepaliveStartMS = 0;
return true;
}
return false;
}
if (EnvironmentTickCountAdd(context.TimeoutMaxIdle, context.LastActivityTimeMS) < nowMS)