remove some useless code form http low level; delay normal connection close, to let client do it instead

This commit is contained in:
UbitUmarov
2020-04-21 00:13:02 +01:00
parent c097f148dd
commit 43fdbf87d4
7 changed files with 61 additions and 92 deletions

View File

@@ -277,7 +277,7 @@ namespace OSHttpServer
if (context.TriggerKeepalive)
{
context.TriggerKeepalive = false;
context.MonitorKeepaliveStartMS = nowMS;
context.MonitorKeepaliveStartMS = nowMS + 1;
return false;
}
@@ -285,7 +285,10 @@ namespace OSHttpServer
{
if (EnvironmentTickCountAdd(context.TimeoutKeepAlive, context.MonitorKeepaliveStartMS) < nowMS)
{
disconnectError = SocketError.TimedOut;
if(context.IsClosing)
disconnectError = SocketError.Success;
else
disconnectError = SocketError.TimedOut;
context.MonitorKeepaliveStartMS = 0;
return true;
}