[ruby-cvs:70070] normal:r62953 (trunk): webrick: favor .write over << method

normal at ruby-lang.org normal at ruby-lang.org
Wed Mar 28 17:05:47 JST 2018


normal	2018-03-28 17:05:46 +0900 (Wed, 28 Mar 2018)

  New Revision: 62953

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62953

  Log:
    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

  Modified files:
    trunk/lib/webrick/cgi.rb
    trunk/lib/webrick/httpresponse.rb


More information about the ruby-cvs mailing list