From 465949f4f0160992494e85a846ffe0d9943c708a Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 24 Feb 2018 19:31:27 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpListenerRequest.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/websocket-sharp/Net/HttpListenerRequest.cs b/websocket-sharp/Net/HttpListenerRequest.cs index ee53344d..006882c5 100644 --- a/websocket-sharp/Net/HttpListenerRequest.cs +++ b/websocket-sharp/Net/HttpListenerRequest.cs @@ -740,7 +740,8 @@ namespace WebSocketSharp.Net internal bool FlushInput () { - if (!HasEntityBody) + var input = InputStream; + if (input == Stream.Null) return true; var len = 2048; @@ -751,14 +752,14 @@ namespace WebSocketSharp.Net while (true) { try { - var ares = InputStream.BeginRead (buff, 0, len, null, null); + var ares = input.BeginRead (buff, 0, len, null, null); if (!ares.IsCompleted) { var timeout = 100; if (!ares.AsyncWaitHandle.WaitOne (timeout)) return false; } - if (InputStream.EndRead (ares) <= 0) + if (input.EndRead (ares) <= 0) return true; } catch {