This project is closed and read-only.
Backport #1284 ยป net-http-bufsize.patch
| net/http.rb 2009-03-13 08:11:47.000000000 +0000 | ||
|---|---|---|
|
include HTTPHeader
|
||
|
BUFSIZE = 16*1024
|
||
|
def initialize(m, reqbody, resbody, path, initheader = nil)
|
||
|
@method = m
|
||
|
@request_has_body = reqbody
|
||
| ... | ... | |
|
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
|
||