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

@@ -281,6 +281,9 @@ namespace OSHttpServer
public void Send()
{
if(m_context.IsClosing)
return;
if (Sent)
throw new InvalidOperationException("Everything have already been sent.");
@@ -446,7 +449,7 @@ namespace OSHttpServer
if (m_body != null)
m_body.Dispose();
Sent = true;
m_context.EndSendResponse(requestID, Connection);
await m_context.EndSendResponse(requestID, Connection).ConfigureAwait(false);
}
private int CheckBandwidth(int request, int bytesLimit)