From 88b182083c7283a3cc370a5cf7fae3ea7c182155 Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 20 Feb 2016 15:41:27 +0900 Subject: [PATCH] [Modify] Don't throw --- websocket-sharp/WebSocket.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 13d04d8d..b455fea2 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -671,12 +671,20 @@ namespace WebSocketSharp string msg; if (!checkHandshakeRequest (_context, out msg)) { sendHttpResponse (createHandshakeFailureResponse (HttpStatusCode.BadRequest)); - throw new WebSocketException (CloseStatusCode.ProtocolError, msg); + + _logger.Fatal (msg); + fatal ("An error has occurred while accepting.", CloseStatusCode.ProtocolError); + + return false; } if (!customCheckHandshakeRequest (_context, out msg)) { sendHttpResponse (createHandshakeFailureResponse (HttpStatusCode.BadRequest)); - throw new WebSocketException (CloseStatusCode.PolicyViolation, msg); + + _logger.Fatal (msg); + fatal ("An error has occurred while accepting.", CloseStatusCode.PolicyViolation); + + return false; } _base64Key = _context.Headers["Sec-WebSocket-Key"];