From 6f818346ce5ca99594aed67c530ca940d9f479cd Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Fri, 13 Sep 2024 11:30:24 +0900 Subject: [PATCH] Prevent warnings ``` /home/chkbuild/chkbuild/tmp/build/20240913T003003Z/ruby/test/net/http/utils.rb:32: warning: assigned but unused variable - e /home/chkbuild/chkbuild/tmp/build/20240913T003003Z/ruby/test/net/http/utils.rb:61: warning: assigned but unused variable - version /home/chkbuild/chkbuild/tmp/build/20240913T003003Z/ruby/test/net/http/utils.rb:124: warning: method redefined; discarding old query ``` --- test/net/http/utils.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb index cb621da..1d43497 100644 --- a/test/net/http/utils.rb +++ b/test/net/http/utils.rb @@ -29,7 +29,7 @@ def start loop do socket = @ssl_server ? @ssl_server.accept : @server.accept run(socket) - rescue => e + rescue ensure socket.close if socket end @@ -58,7 +58,7 @@ def handle_request(socket) request_line = socket.gets return if request_line.nil? || request_line.strip.empty? - method, path, version = request_line.split + method, path, _version = request_line.split headers = {} while (line = socket.gets) break if line.strip.empty? @@ -121,10 +121,6 @@ def continue @socket.write "HTTP\/1.1 100 continue\r\n\r\n" end - def query - @query - end - def remote_ip @socket.peeraddr[3] end