Skip to content

Commit 79c0a02

Browse files
hsbtclaude
authored andcommitted
[ruby/rubygems] Use IO.copy_stream to drain remaining gzip data instead of read
Replace gzio.read with IO.copy_stream(gzio, IO::NULL) to avoid allocating a potentially large string when discarding unconsumed compressed data. ruby/rubygems@e4d0196887 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9233eae commit 79c0a02

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/rubygems/package.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ def open_tar_gz(io) # :nodoc:
561561
# "attempt to close unfinished zstream; reset forced" warning
562562
# when the GzipReader is closed with unconsumed compressed data.
563563
begin
564-
gzio.read
564+
IO.copy_stream(gzio, IO::NULL)
565565
rescue Zlib::GzipFile::Error, IOError
566566
nil
567567
end

0 commit comments

Comments
 (0)