From: nobu.nokada@... Date: 2002-04-19T14:46:01+09:00 Subject: Re: resolv.rb Bug Hi, At Fri, 19 Apr 2002 12:57:28 +0900, Roy J. Milican wrote: > > -----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) It was a typo, but ignore older patches in [ruby-talk:38537], [ruby-talk:38545] and apply only newer 2 in [ruby-talk:38613], [ruby-talk:38620]. Sorry. -- Nobu Nakada