From 4f79485889bc9c782474c9dd32d5b916376fd0ec Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 7 Jan 2025 11:34:20 +0100 Subject: [PATCH] [ruby/openssl] Refactor buffer usage to only use `append_as_bytes` https://github.com/ruby/openssl/commit/28f2901c48 --- ext/openssl/lib/openssl/buffering.rb | 12 ++++++------ test/openssl/test_buffering.rb | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/openssl/lib/openssl/buffering.rb b/ext/openssl/lib/openssl/buffering.rb index ceb2efb733..1464a4292d 100644 --- a/ext/openssl/lib/openssl/buffering.rb +++ b/ext/openssl/lib/openssl/buffering.rb @@ -37,8 +37,8 @@ module OpenSSL::Buffering end end - alias_method :concat, :append_as_bytes - alias_method :<<, :append_as_bytes + undef_method :concat + undef_method :<< end ## @@ -73,7 +73,7 @@ module OpenSSL::Buffering def fill_rbuff begin - @rbuffer << self.sysread(BLOCK_SIZE) + @rbuffer.append_as_bytes(self.sysread(BLOCK_SIZE)) rescue Errno::EAGAIN retry rescue EOFError @@ -450,10 +450,10 @@ module OpenSSL::Buffering def puts(*args) s = Buffer.new if args.empty? - s << "\n" + s.append_as_bytes("\n") end args.each{|arg| - s << arg.to_s + s.append_as_bytes(arg.to_s) s.sub!(/(?