From eac4c259b0fd0523716259d316c693df23bd2ce9 Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 27 Oct 2020 19:48:42 +0900 Subject: [PATCH] [Modify] Move it --- websocket-sharp/Net/HttpConnection.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/websocket-sharp/Net/HttpConnection.cs b/websocket-sharp/Net/HttpConnection.cs index 67cd0543..bdcf0028 100644 --- a/websocket-sharp/Net/HttpConnection.cs +++ b/websocket-sharp/Net/HttpConnection.cs @@ -275,6 +275,12 @@ namespace WebSocketSharp.Net nread = conn._stream.EndRead (asyncResult); + if (nread <= 0) { + conn.close (); + + return; + } + conn._requestBuffer.Write (conn._buffer, 0, nread); len = (int) conn._requestBuffer.Length; } @@ -290,12 +296,6 @@ namespace WebSocketSharp.Net return; } - if (nread <= 0) { - conn.close (); - - return; - } - if (conn.processInput (conn._requestBuffer.GetBuffer (), len)) { if (!conn._context.HasError) conn._context.Request.FinishInitialization ();