From: Okada Jun Date: 2000-11-16T22:04:04+09:00 Subject: [ruby-dev:11568] Re: net/http BUG …じゃないんだけど 岡田です。 自己フォロー。 あのパッチだと別の局面でコケるし、\r\nの検出に失敗するし、全然ダメですね。 パッチ作り直しました。 # でも場当たり的な対応には変わりないか $ diff -ru2p old/protocol.rb protocol.rb --- old/protocol.rb Thu Nov 16 21:41:15 2000 +++ protocol.rb Thu Nov 16 22:01:36 2000 @@ -529,5 +529,5 @@ module Net dest = '' - writeinto( dest, idx + target.size ) + writeinto( dest, idx + $&.size ) dest end @@ -535,5 +535,5 @@ module Net def readline - ret = readuntil( "\r\n" ) + ret = readuntil( /\n|\r\n|\r/ ) ret.chop! ret @@ -546,5 +546,5 @@ module Net rsize = 0 - while (str = readuntil( "\r\n" )) != ".\r\n" do + while (str = readuntil( /\r\n/ )) != ".\r\n" do rsize += str.size str.gsub!( /\A\./, '' ) @@ -563,5 +563,5 @@ module Net str = nil - while (str = readuntil( "\r\n" )) != ".\r\n" do + while (str = readuntil( /\r\n/ )) != ".\r\n" do str.chop! arr.push str -- ゆん(岡田 潤) yun@be-in.org http://www.be-in.org/~yun/