1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Bail if read_nonblock returns nil. Fixes #1502

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.
This commit is contained in:
Evan Phoenix 2018-01-18 20:18:14 -08:00
parent 9369a9fee0
commit acb709b7b7

View file

@ -58,6 +58,8 @@ module Puma
else
IO.select(nil, [@socket.to_io])
end
elsif !data
return nil
else
break
end