From aaf8ea5dab33b9f555614cf4531cf8e02e2f3021 Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 5 Dec 2019 22:02:46 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpListenerResponse.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/websocket-sharp/Net/HttpListenerResponse.cs b/websocket-sharp/Net/HttpListenerResponse.cs index 88342fd2..5061e63c 100644 --- a/websocket-sharp/Net/HttpListenerResponse.cs +++ b/websocket-sharp/Net/HttpListenerResponse.cs @@ -715,12 +715,16 @@ namespace WebSocketSharp.Net || _statusCode == 503; var reuses = _context.Connection.Reuses; + if (closeConn || reuses >= 100) { headers.InternalSet ("Connection", "close", true); } else { headers.InternalSet ( - "Keep-Alive", String.Format ("timeout=15,max={0}", 100 - reuses), true); + "Keep-Alive", + String.Format ("timeout=15,max={0}", 100 - reuses), + true + ); if (_context.Request.ProtocolVersion < HttpVersion.Version11) headers.InternalSet ("Connection", "keep-alive", true);