From f2e995dcc0a8a3c8c81fd4ebb9306d8cc293cee4 Mon Sep 17 00:00:00 2001 From: Yessiest Date: Tue, 9 Jul 2024 17:26:08 +0400 Subject: [PATCH] fixed double socket close in rescue --- lib/landline/extensions/websocket.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/landline/extensions/websocket.rb b/lib/landline/extensions/websocket.rb index 1082328..0d15576 100644 --- a/lib/landline/extensions/websocket.rb +++ b/lib/landline/extensions/websocket.rb @@ -93,7 +93,7 @@ module Landline rescue Errno::EPIPE => e @writable = false _emit :error, e - close + close if @readable nil end @@ -210,7 +210,7 @@ module Landline end rescue Errno::ECONNRESET => e _emit :error, e - close + close if @readable or @writable nil end @@ -224,7 +224,7 @@ module Landline end rescue Errno::ECONNRESET => e _emit :error, e - close + close if @readable or @writable nil end end