[#26966] Time & Date — " たけ (tk)" <ggb03124@...>
Time と Date についていくつか質問させてください。
ふなばです。
たけ(tk)です。
ふなばです。
たけ(tk)です。
まつもと ゆきひろです
たけ(tk)です。
まつもと ゆきひろです
とみたです。
[#26972] RTtool& コンバータ — rubikitch <rubikitch@...>
るびきちです。
[#26988] where's racc binary package — Minero Aoki <aamine@...>
あおきです。
[#26996] cgi.rb で繰り返しができない — Fujikawa Norihide <tensyuu@...>
てんしゅう@Ruby歴1ヶ月です。
[#27006] $= — "TAKAGI, Hiromitsu" <takagi@...>
ごぶさたです。
新井です。
新井です。
わたなべです.
新井です。
From: Koji Arai <JCA02266@nifty.ne.jp>
新井です。
なひです。
新井です。
まつもと ゆきひろです
なひです。
新井です。
前田です。
なひです。
[#27012] load method — Masaki Suketa <CQN02273@...>
助田です。
まつもと ゆきひろです
[#27023] Array#sum — " たけ (tk)" <ggb03124@...>
Array#sum ってあっても良さそうではありませんか?。
[#27050] BigNum#modulo problem? — Ogino Junya <ogino@...>
荻野です。
[#27056] タイムゾーンの設定について教えて下さい。 — 関口久之 <sekiguci@...>
関口と申します。いつもお世話になっております。
In the message <200101091140.1316718489@u250120.cmg.ts.fujitsu.co.jp>,
[#27061] Ruby/Python with ruby 1.6.2 — akira yamada / やまだあきら <akira@...>
わたなべです.
わたなべです.
[#27079] make mod_ruby failed — h-isikaw@...
いしかわ@NIMSと申します
[#27144] RWiki + CVS — "Akinori MUSHA" <knu@...>
ruby-dev に振り直します。フォローはこちらにお願いします。
[#27146] filename transfer. — Katsuya Tanaka <tanaka@...>
わたなべです.
わたなべです.
[#27179] [PATCH] net/http 1.2.0 — OHSHIMA Ryunosuke <ryu@...>
大島です。
[#27180] — "yoppei" <t98526ys@...>
初めまして。慶応大の鈴木と申します。
[#27184] HP-UX で configure 失敗( ruby-1.6.2) — tkadowak@...
門脇と申します。
[#27210] 検索パターンが更新されない。 — Katsuya Tanaka <tanaka@...>
[#27219] do ... end & { ... } — "K.Kosako" <kosako@...>
ブロックを構成するdo ... end と{ ... } の違いについて、
At Thu, 18 Jan 2001 13:32:24 +0900,
まつもと ゆきひろです
Yukihiro Matsumotoさんの<979801790.788262.21748.nullmailer@ev.netlab.zetabits.com>から
新井です。
まつもと ゆきひろです
新井です。
まつもと ゆきひろです
まつもと ゆきひろです
[#27238] Thread.new { sleep } — TAKEUCHI Hideki <take@...>
TAKEUCHI Hidekiさんの<200101190714.QAA19344@deirdre.krc.sony.co.jp>から
[#27253] break from proc-closure — Masatoshi SEKI <m_seki@...>
まつもと ゆきひろです
[#27258] Array#sort! — Masaki Suketa <CQN02273@...>
助田です。
[#27271] media watch 2001.01.18 — Noritsugu Nakamura <nnakamur@...>
渡辺哲也です。
こんにちは
From: WATANABE Tetsuya <tetsu@jpn.hp.com>
助田です。
ひがきです。
From: HIGAKI Masaru (ひがき まさる) <mash@as.airnet.ne.jp>
At Sun, 28 Jan 2001 02:25:15 +0900,
[#27272] 掲示版を作ってみた — Fujikawa Norihide <tensyuu@...>
てんしゅう@Vine Linux2.1です。
[#27286] Ruby -e "puts '["]' " — "たけ(tk)" <ggb03124@...>
Ruby -e "puts '["]' "
こんにちは、なかむら(う)です。
たけ(tk)です。
まつもと ゆきひろです
こんにちは、なかむら(う)です。
[#27323] drb as research subject — YANAGAWA Kazuhisa <kjana@...>
drb 関連のあれこれをちょっとながめていて,「スクリプト言語における分散
From: YANAGAWA Kazuhisa <kjana@os.xaxon.ne.jp>
[#27327] Haiku — TAKAI Naoto <takai@...>
こんばんは、高井といいます。
[#27349] NHK 放映 — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
Yukihiro Matsumotoさんの
At Mon, 29 Jan 2001 10:27:37 +0900,
In the message <86snm2obtz.wl@archon.local.idaemons.org>,
原です。
原さん wrote:
原です。
渡辺哲也です。
松永です。
[#27424] Cygwin + Oracle モジュールで dlopen() エラー — "IKAGAWA, Kauztomo" <k_ikagawa@...>
いかがわと申します。
[ruby-list:27179] [PATCH] net/http 1.2.0
大島です。
net/http version 1.2.0 でいくつかの不具合を発見しました。その報告と
パッチです。
1. Net::HTTP#get() で u_header が有効になりません。以下が例です。
% ruby -v -r net/http -e 'http = Net::HTTP.new("macky.nifty.com", 80); http.set_pipe($stdout); http.get("/i/", {"User-Agent" => "rubot/0.3"});'
ruby 1.7.0 (2001-01-15) [sparc-solaris2.7]
write "GET /i/ HTTP/1.1\r\n"
write "Accept: */*\r\n"
write "Host: macky.nifty.com\r\n"
write "Connection: Keep-Alive\r\n"
write "\r\n"
read "HTTP/1.1 200 OK\r\n"
read "Server: Netscape-Enterprise/3.6 SP3\r\n"
read "Date: Mon, 15 Jan 2001 22:20:25 GMT\r\n"
read "Content-type: text/html\r\n"
read "Etag: "2465a-241-3a2edc4d"\r\n"
read "Last-modified: Thu, 07 Dec 2000 00:39:41 GMT\r\n"
read "Content-length: 577\r\n"
read "Accept-ranges: bytes\r\n"
read "Connection: close\r\n"
read "\r\n"
reading 577 bytes...
read 577 bytes
state: 0(0)
2. サーバの応答に header と body の区切りである CRLF が含まれない場
合、 Net::HTTP#get() で失敗します。 RFC2616 からするとサーバが悪
いのですが、対応しておいた方が良いと思われます。以下が失敗例です。
(1. の不具合を修正後の例です。)
% ruby -v -r net/http -e 'http = Net::HTTP.new("macky.nifty.com", 80); http.set_pipe($stdout); http.get("/i/", {"User-Agent" => "rubot/0.3"});'
ruby 1.7.0 (2001-01-15) [sparc-solaris2.7]
write "GET /i/ HTTP/1.1\r\n"
write "User-Agent: rubot/0.3\r\n"
write "Accept: */*\r\n"
write "Host: macky.nifty.com\r\n"
write "Connection: Keep-Alive\r\n"
write "\r\n"
read "HTTP/1.0 302 Found\r\n"
read "Location: http://macky.nifty.com/\r\n"
state: 6(0)
lib/net/protocol.rb:593:in `sysread': End of file reached (EOFError)
from lib/net/protocol.rb:593:in `fill_rbuf'
from lib/net/protocol.rb:540:in `readuntil'
from lib/net/protocol.rb:550:in `readline'
from lib/net/http.rb:686:in `rdresp0'
from lib/net/http.rb:677:in `read_response'
from lib/net/http.rb:663:in `do_dispatch'
from lib/net/http.rb:726:in `dispatch'
from lib/net/http.rb:331:in `get2'
from lib/net/http.rb:330:in `common_oper'
from lib/net/http.rb:337:in `new_get'
from lib/net/http.rb:330:in `get2'
from lib/net/http.rb:315:in `get'
from -e:1
3. サーバの応答の Content-length ヘッダの値が、実際に読み出せた値よ
り大きい場合、 Net::HTTP#get() で、失敗します。 RFC2616 の 4.4
Message Length の最後には、ヘッダの値と実際の大きさが異なる場合は、
ユーザに知らせるようにとありますが、エラーにまでする必要はないと
思います。以下が失敗例です。
% ruby -v -r net/http -e 'http = Net::HTTP.new("copa.org", 80); http.set_pipe($stdout); http.get("/robots.txt");'
ruby 1.7.0 (2001-01-15) [sparc-solaris2.7]
write "GET /robots.txt HTTP/1.1\r\n"
write "Accept: */*\r\n"
write "Host: copa.org\r\n"
write "Connection: Keep-Alive\r\n"
write "\r\n"
read "HTTP/1.0 200 OK\r\n"
read "MIME-Version: 1.0\r\n"
read "Server: Web_Server_4D/2.0.2/001403/Macintosh\r\n"
read "Date: Monday, 15-Jan-01 11:51:47 GMT\r\n"
read "Last-Modified: Monday, 03-Aug-98 09:16:25 GMT\r\n"
read "Accept-Ranges: bytes\r\n"
read "Content-type: text/plain\r\n"
read "Content-length: 1513\r\n"
read "\r\n"
reading 1513 bytes...
state: 6(0)
lib/net/protocol.rb:593:in `sysread': End of file reached (EOFError)
from lib/net/protocol.rb:593:in `fill_rbuf'
from lib/net/protocol.rb:509:in `read'
from lib/net/http.rb:981:in `read_body_0'
from lib/net/http.rb:951:in `read_body'
from lib/net/http.rb:318:in `get'
from lib/net/http.rb:315:in `get2'
from lib/net/http.rb:330:in `common_oper'
from lib/net/http.rb:337:in `new_get'
from lib/net/http.rb:330:in `get2'
from lib/net/http.rb:315:in `get'
from -e:1
上記の 1, 2, 3 の不具合にとりあえず対応したパッチが以下です。
Index: lib/net/http.rb
===================================================================
RCS file: /ruby/ruby/lib/net/http.rb,v
retrieving revision 1.42
diff -p -u -r1.42 http.rb
--- lib/net/http.rb 2001/01/13 19:07:15 1.42
+++ lib/net/http.rb 2001/01/15 23:15:53
@@ -597,8 +597,8 @@ S
key = canonical(k)
if tmp.key? key then
$stderr.puts "WARNING: duplicated HTTP header: #{k}" if $VERBOSE
- tmp[ key ] = v.strip
end
+ tmp[ key ] = v.strip
end
@u_header.update tmp
end
Index: lib/net/protocol.rb
===================================================================
RCS file: /ruby/ruby/lib/net/protocol.rb,v
retrieving revision 1.38
diff -p -u -r1.38 protocol.rb
--- lib/net/protocol.rb 2001/01/13 19:07:15 1.38
+++ lib/net/protocol.rb 2001/01/15 23:15:53
@@ -504,9 +504,13 @@ module Net
@pipe << "reading #{len} bytes...\n" if @pipe; pipeoff
rsize = 0
- while rsize + @buffer.size < len do
- rsize += writeinto( dest, @buffer.size )
- fill_rbuf
+ begin
+ while rsize + @buffer.size < len do
+ rsize += writeinto( dest, @buffer.size )
+ fill_rbuf
+ end
+ rescue EOFError
+ len = rsize
end
writeinto( dest, len - rsize )
@@ -534,14 +538,17 @@ module Net
def readuntil( target )
- while true do
- idx = @buffer.index( target )
- break if idx
- fill_rbuf
- end
-
dest = ''
- writeinto( dest, idx + target.size )
+ begin
+ while true do
+ idx = @buffer.index( target )
+ break if idx
+ fill_rbuf
+ end
+ writeinto( dest, idx + target.size )
+ rescue EOFError
+ writeinto( dest, @buffer.size )
+ end
dest
end
以上です。
大島 龍之介 ryu@jaist.ac.jp