diff --git a/ChangeLog b/ChangeLog index f61a1f5010..87a809afa9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Mar 11 20:07:01 2003 Minero Aoki + + * lib/net/http.rb: speeding up by avoiding extra flush. + (suggested by Brian Candler [ruby-talk:66516]) + Tue Mar 11 04:30:12 2003 Yukihiro Matsumoto * eval.c (massign): remove unnecessary array unpacking; it should diff --git a/lib/net/http.rb b/lib/net/http.rb index f5b70188db..590b80ad9a 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -2,7 +2,8 @@ = net/http.rb -Copyright (c) 1999-2002 Yukihiro Matsumoto +Copyright (c) 1999-2003 Yukihiro Matsumoto +Copyright (c) 1999-2003 Minero Aoki written & maintained by Minero Aoki . This file is derived from "http-access.rb". @@ -1170,11 +1171,12 @@ module Net end def request( sock, ver, path ) - sock.writeline sprintf('%s %s HTTP/%s', @method, path, ver) + buf = "#{@method} #{path} HTTP/#{ver}\r\n" canonical_each do |k,v| - sock.writeline k + ': ' + v + buf << k + ': ' + v + "\r\n" end - sock.writeline '' + buf << "\r\n" + sock.write buf end end