Skip to content

Commit

Permalink
fix: socket#recv may return nil on closed connections
Browse files Browse the repository at this point in the history
Fixes #74
  • Loading branch information
palkan committed Apr 26, 2024
1 parent e1f61be commit 0ecc9f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lite_cable/server/client_socket/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def each_frame

while socket.wait_readable
data = socket.respond_to?(:recv) ? socket.recv(2000) : socket.readpartial(2000)
break if data.empty?
break if data.nil? || data.empty?

framebuffer << data
while frame = framebuffer.next # rubocop:disable Lint/AssignmentInCondition
Expand Down

0 comments on commit 0ecc9f0

Please sign in to comment.