From: Katsuyuki Komatsu Date: 2000-09-20T19:36:53+09:00 Subject: [ruby-dev:10985] httphead.rb proxy version problem 小松です. テストセットに使っている,[ruby-list:22001]のproxy対応の httphead.rbですが,Ruby 1.6.0でハングするようになってしまいました. netとrubyのどちらの問題でしょうか? 以下の例では,^Cで止めています. % ruby -v httphead.rb http://www.ruby-lang.org/ja/index.html ruby 1.6.0 (2000-09-19) [sparc-solaris2.5.1] ^C/usr/local/lib/ruby/1.6/net/protocol.rb:578:in `sysread': End of file reached (EOFError) from /usr/local/lib/ruby/1.6/net/protocol.rb:578:in `fill_rbuf' from /usr/local/lib/ruby/1.6/net/protocol.rb:523:in `readuntil' from /usr/local/lib/ruby/1.6/net/protocol.rb:533:in `readline' from /usr/local/lib/ruby/1.6/net/http.rb:751:in `get_reply' from /usr/local/lib/ruby/1.6/net/http.rb:626:in `get_response' from /usr/local/lib/ruby/1.6/net/http.rb:359:in `connecting' from /usr/local/lib/ruby/1.6/net/http.rb:299:in `head2' from /usr/local/lib/ruby/1.6/net/http.rb:340:in `do_finish' from /usr/local/lib/ruby/1.6/net/protocol.rb:179:in `finish' from /usr/local/lib/ruby/1.6/net/protocol.rb:172:in `start' from /usr/local/lib/ruby/1.6/net/http.rb:236:in `start' from httphead.rb:14 % 1.4.6ではこんな感じでした. % ruby-1.4.6 -v httphead.rb http://www.ruby-lang.org/ja/index.html ruby 1.4.6 (2000-08-30) [sparc-solaris2.5.1] headers: proxy-connection: keep-alive accept-ranges: bytes etag: "a680a-1c27-39c72ebc" last-modified: Tue, 19 Sep 2000 09:15:40 GMT age: 66227 server: Apache/1.3.12 (Unix) Debian/GNU mod_ruby/0.2.0 Ruby/1.4.6(2000-08-24) x-cache: HIT from …… content-length: 7207 date: Tue, 19 Sep 2000 09:23:01 GMT content-type: text/html; charset=iso-2022-jp % [ruby-list:22045]のデバッグ出力版で動かすと,ヘッダが返ってきた ところで待ちに入っているようです. ruby -v httphead.rb-22045 http://www.ruby-lang.org/ja/index.html ruby 1.6.0 (2000-09-19) [sparc-solaris2.5.1] write "HEAD http://www.ruby-lang.org/ja/index.html HTTP/1.1\r\n" write "Accept: */*\r\n" write "Host: ……\r\n" write "Connection: Keep-Alive\r\n" write "\r\n" read "HTTP/1.0 200 OK\r\n" read "Date: Tue, 19 Sep 2000 09:23:01 GMT\r\n" read "Server: Apache/1.3.12 (Unix) Debian/GNU mod_ruby/0.2.0 Ruby/1.4.6(2000-08 -24)\r\n" read "Last-Modified: Tue, 19 Sep 2000 09:15:40 GMT\r\n" read "ETag: "a680a-1c27-39c72ebc"\r\n" read "Accept-Ranges: bytes\r\n" read "Content-Length: 7207\r\n" read "Content-Type: text/html; charset=iso-2022-jp\r\n" read "Age: 66684\r\n" read "X-Cache: HIT from ……\r\n" read "Proxy-Connection: keep-alive\r\n" read "\r\n" ← ここまで出力されてハングするので^Cを押した. ^Cwrite "HEAD http://www.ruby-lang.org/ HTTP/1.1\r\n" write "Accept: */*\r\n" write "Host: ……\r\n" write "Connection: close\r\n" write "\r\n" read "HTTP/1.0 301 Moved Permanently\r\n" read "Date: Wed, 20 Sep 2000 10:20:03 GMT\r\n" read "Server: Apache/1.3.12 (Unix) Debian/GNU mod_ruby/0.2.0 Ruby/1.4.6(2000-08 -24)\r\n" read "Location: http://www.ruby-lang.org/en/index.html\r\n" read "Content-Type: text/html; charset=iso-8859-1\r\n" read "X-Cache: MISS from ……\r\n" read "Proxy-Connection: close\r\n" read "\r\n" /usr/local/lib/ruby/1.6/net/protocol.rb:578:in `sysread': End of file reached (EOFError) from /usr/local/lib/ruby/1.6/net/protocol.rb:578:in `fill_rbuf' from /usr/local/lib/ruby/1.6/net/protocol.rb:523:in `readuntil' from /usr/local/lib/ruby/1.6/net/protocol.rb:533:in `readline' from /usr/local/lib/ruby/1.6/net/http.rb:751:in `get_reply' from /usr/local/lib/ruby/1.6/net/http.rb:626:in `get_response' from /usr/local/lib/ruby/1.6/net/http.rb:359:in `connecting' from /usr/local/lib/ruby/1.6/net/http.rb:299:in `head2' from /usr/local/lib/ruby/1.6/net/http.rb:340:in `do_finish' from /usr/local/lib/ruby/1.6/net/protocol.rb:179:in `finish' from /usr/local/lib/ruby/1.6/net/protocol.rb:172:in `start' from httphead.rb-22045:16 % -- 小松克行 / Katsuyuki Komatsu