Skip to content

Commit

Permalink
lib\puma\accept_nonblock.rb - fix socket closing on error (#1941)
Browse files Browse the repository at this point in the history
* lib\puma\accept_nonblock.rb - fix socket closing on error

See:
ruby/ruby@68ac33a

* test/test_integration.rb - fix my typo that causes a warning
  • Loading branch information
MSP-Greg authored and nateberkopec committed Sep 5, 2019
1 parent c9a584c commit 7e82738
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/puma/accept_nonblock.rb
Expand Up @@ -15,7 +15,11 @@ def accept_nonblock
ssl.accept if @start_immediately
ssl
rescue SSLError => ex
sock.close
if ssl
ssl.close
else
sock.close
end
raise ex
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_integration.rb
Expand Up @@ -517,5 +517,5 @@ def run_launcher(conf)
@wait.sysread 1

[thr, launcher, @events]
end
end
end

0 comments on commit 7e82738

Please sign in to comment.