From 3334a53336c10b75d186e921d6e1beaf76804351 Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 11 Feb 2020 22:03:08 +0900 Subject: [PATCH] [Modify] Move it --- websocket-sharp/Net/ResponseStream.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/websocket-sharp/Net/ResponseStream.cs b/websocket-sharp/Net/ResponseStream.cs index ec241f50..1c7fa805 100644 --- a/websocket-sharp/Net/ResponseStream.cs +++ b/websocket-sharp/Net/ResponseStream.cs @@ -138,12 +138,8 @@ namespace WebSocketSharp.Net private bool flush (bool closing) { if (!_response.HeadersSent) { - if (!flushHeaders (closing)) { - if (closing) - _response.CloseConnection = true; - + if (!flushHeaders (closing)) return false; - } _sendChunked = _response.SendChunked; _writeBody = _sendChunked ? _writeChunked : _write; @@ -280,6 +276,8 @@ namespace WebSocketSharp.Net return; } + + _response.CloseConnection = true; } if (_sendChunked)