From: "Roy J. Milican" Date: 2002-04-19T12:57:28+09:00 Subject: Re: resolv.rb Bug -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Greetings, Thursday, April 18, 2002, 8:30:57 PM, you wrote: nnsn> Hi, nnsn> At Fri, 19 Apr 2002 11:57:18 +0900, nnsn> Tanaka Akira wrote: >> > Sorry, I was wrong completely. Try with following patch. >> >> It causes an error with -d. nnsn> Oops, sender thread must be killed. nnsn> --- resolv.rb~ Fri Apr 19 11:36:35 2002 nnsn> +++ resolv.rb Fri Apr 19 12:29:55 2002 nnsn> @@ -509,6 +509,13 @@ class Resolv nnsn> def close nnsn> - @sock.close if @sock nnsn> - @sock = nil nnsn> + thread, sock, @thread, @sock = @thread, @sock nnsn> + begin nnsn> + if thread nnsn> + thread.kill nnsn> + thread.join nnsn> + end nnsn> + ensure nnsn> + sock.close if sock nnsn> + end nnsn> end Patching the 2 new patches and using the example you gave me I get the following error from ruby 1.6.6. /usr/local/lib/ruby/1.6/resolv.rb:545:in `close': undefined method `value' for {}:Hash (NameError) from /usr/local/lib/ruby/1.6/resolv.rb:394:in `close' from /usr/local/lib/ruby/1.6/resolv.rb:392:in `synchronize' from /usr/local/lib/ruby/1.6/resolv.rb:392:in `close' from /usr/local/lib/ruby/1.6/resolv.rb:355:in `open' from /usr/local/lib/ruby/1.6/email.rb:55:in `valid' from ./check.rb:14 from ./check.rb:11:in `each' from ./check.rb:11 - -- Roy Milican roy@milican.com �v -----BEGIN PGP SIGNATURE----- Version: PGP 6.5i iQA/AwUBPL+VagNBS2G+YzIDEQJEFgCfab+tGYuyWk4Zq/iVLW0G3R/7SAoAnjUW 4dVbt0xeAAhlyFFtDaMtwnrP =5fBx -----END PGP SIGNATURE-----