mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
aamine
* lib/net/protocol.rb: ignore EOFError for read. * lib/net/http.rb: user specified header was not used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c46cf18e3b
commit
7adcec68b1
3 changed files with 24 additions and 11 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Tue Jan 16 17:00:50 2001 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
|
||||||
|
|
||||||
|
* lib/net/protocol.rb: ignore EOFError for read.
|
||||||
|
|
||||||
|
* lib/net/http.rb: user specified header was not used.
|
||||||
|
|
||||||
Mon Jan 15 16:00:07 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Mon Jan 15 16:00:07 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* pack.c (pack_unpack): should check associated pointer packed by
|
* pack.c (pack_unpack): should check associated pointer packed by
|
||||||
|
|
|
@ -597,8 +597,8 @@ S
|
||||||
key = canonical(k)
|
key = canonical(k)
|
||||||
if tmp.key? key then
|
if tmp.key? key then
|
||||||
$stderr.puts "WARNING: duplicated HTTP header: #{k}" if $VERBOSE
|
$stderr.puts "WARNING: duplicated HTTP header: #{k}" if $VERBOSE
|
||||||
tmp[ key ] = v.strip
|
|
||||||
end
|
end
|
||||||
|
tmp[ key ] = v.strip
|
||||||
end
|
end
|
||||||
@u_header.update tmp
|
@u_header.update tmp
|
||||||
end
|
end
|
||||||
|
|
|
@ -504,10 +504,14 @@ module Net
|
||||||
@pipe << "reading #{len} bytes...\n" if @pipe; pipeoff
|
@pipe << "reading #{len} bytes...\n" if @pipe; pipeoff
|
||||||
|
|
||||||
rsize = 0
|
rsize = 0
|
||||||
|
begin
|
||||||
while rsize + @buffer.size < len do
|
while rsize + @buffer.size < len do
|
||||||
rsize += writeinto( dest, @buffer.size )
|
rsize += writeinto( dest, @buffer.size )
|
||||||
fill_rbuf
|
fill_rbuf
|
||||||
end
|
end
|
||||||
|
rescue EOFError
|
||||||
|
len = rsize
|
||||||
|
end
|
||||||
writeinto( dest, len - rsize )
|
writeinto( dest, len - rsize )
|
||||||
|
|
||||||
@pipe << "read #{len} bytes\n" if pipeon
|
@pipe << "read #{len} bytes\n" if pipeon
|
||||||
|
@ -534,14 +538,17 @@ module Net
|
||||||
|
|
||||||
|
|
||||||
def readuntil( target )
|
def readuntil( target )
|
||||||
|
dest = ''
|
||||||
|
begin
|
||||||
while true do
|
while true do
|
||||||
idx = @buffer.index( target )
|
idx = @buffer.index( target )
|
||||||
break if idx
|
break if idx
|
||||||
fill_rbuf
|
fill_rbuf
|
||||||
end
|
end
|
||||||
|
|
||||||
dest = ''
|
|
||||||
writeinto( dest, idx + target.size )
|
writeinto( dest, idx + target.size )
|
||||||
|
rescue EOFError
|
||||||
|
writeinto( dest, @buffer.size )
|
||||||
|
end
|
||||||
dest
|
dest
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue