summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-02 03:27:45 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-02 03:27:45 +0000
commit2ce5dfbd9dfddf98b00d7a5c025dfb7b5e221500 (patch)
treee4fcf9b8cd00b93fa25a406d4a4dae3b9cb0264d /lib
parent9de95a9985ca8cc905b291301b1b12545694e9bd (diff)
merge revision(s) 26131:
* lib/net/http.rb (HTTPGenericRequest#send_request_with_body_stream): increased encoding chunk size for POST request with body_stream (1K -> 16K). patched by Brian Candler. #1284. * test/net/http/test_post_io.rb: added for the patch. It's good if a patch comes with a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@27172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 869773bc92..59e9c0c7f0 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -1467,6 +1467,8 @@ module Net #:nodoc:
include HTTPHeader
+ BUFSIZE = 16*1024
+
def initialize(m, reqbody, resbody, path, initheader = nil)
@method = m
@request_has_body = reqbody
@@ -1552,12 +1554,12 @@ module Net #:nodoc:
supply_default_content_type
write_header sock, ver, path
if chunked?
- while s = f.read(1024)
+ while s = f.read(BUFSIZE)
sock.write(sprintf("%x\r\n", s.length) << s << "\r\n")
end
sock.write "0\r\n\r\n"
else
- while s = f.read(1024)
+ while s = f.read(BUFSIZE)
sock.write s
end
end