diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-11 11:01:22 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-11 11:01:22 +0000 |
commit | a500aec8d6c8448b20f2e7d874f96e2c94425ec4 (patch) | |
tree | 2c91cbdf424cd7a3546c1d66c0948be84f09c11b | |
parent | 08ddad2a3afb352dd662123a3b8707d424a523c5 (diff) | |
download | ruby-a500aec8d6c8448b20f2e7d874f96e2c94425ec4.tar.gz ruby-a500aec8d6c8448b20f2e7d874f96e2c94425ec4.tar.xz ruby-a500aec8d6c8448b20f2e7d874f96e2c94425ec4.zip |
* lib/net/http.rb: speeding up by avoiding extra flush. (suggested by Brian Candler <B.Candler@pobox.com>)
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/net/http.rb | 10 |
2 files changed, 11 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Tue Mar 11 20:07:01 2003 Minero Aoki <aamine@loveruby.net> + + * lib/net/http.rb: speeding up by avoiding extra flush. + (suggested by Brian Candler <B.Candler@pobox.com> [ruby-talk:66516]) + Tue Mar 11 04:30:12 2003 Yukihiro Matsumoto <matz@ruby-lang.org> * eval.c (massign): remove unnecessary array unpacking; it should diff --git a/lib/net/http.rb b/lib/net/http.rb index f5b70188d..590b80ad9 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 <aamine@loveruby.net>. 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 |