1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 62953:

webrick: favor .write over << method

	This will make the next change to use IO.copy_stream
	easier-to-read.  When we can drop Ruby 2.4 support in a few
	years, this will allow us to use writev(2) with multiple
	arguments for headers and chunked responses.

	* lib/webrick/cgi.rb (write): new wrapper method
	  lib/webrick/httpresponse.rb: (send_header): use socket.write
	  (send_body_io): ditto
	  (send_body_string): ditto
	  (send_body_proc): ditto
	  (_write_data): ditto
	  (ChunkedWrapper#write): ditto
	  (_send_file): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2018-03-28 09:39:53 +00:00
parent 31d6b6f7d6
commit af30b5b5a8
3 changed files with 16 additions and 11 deletions

View file

@ -265,6 +265,10 @@ module WEBrick
@out_port << data
end
def write(data)
@out_port.write(data)
end
def cert
return nil unless defined?(OpenSSL)
if pem = @env["SSL_SERVER_CERT"]