Skip to content

Commit

Permalink
Bail if read_nonblock returns nil. Fixes #1502
Browse files Browse the repository at this point in the history
The code to perform the wait checking incorrectly assumed that data
would return a symbol OR a String. It also returns nil if the socket has
been closed. We must therefore deal with that nil by returning nothing.
  • Loading branch information
evanphx committed Jan 19, 2018
1 parent 9369a9f commit acb709b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/puma/minissl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def read_nonblock(size, *_)
else
IO.select(nil, [@socket.to_io])
end
elsif !data
return nil
else
break
end
Expand Down

0 comments on commit acb709b

Please sign in to comment.