From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6939 64.71.128.0/18 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.raindrops.general Subject: Re: [PATCH] ... Date: Wed, 6 Jun 2012 00:49:11 +0000 Message-ID: <20120606004911.GA31736@dcvr.yhbt.net> References: <20120605175755.GA8749@dcvr.yhbt.net> <20120606001534.GA28607@dcvr.yhbt.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1338943776 16945 80.91.229.3 (6 Jun 2012 00:49:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Jun 2012 00:49:36 +0000 (UTC) To: raindrops@librelist.org Original-X-From: raindrops@librelist.org Wed Jun 06 02:49:35 2012 Return-path: Envelope-to: gclrrg-raindrops@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: raindrops@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.raindrops.general:82 Archived-At: Received: from zedshaw.xen.prgmr.com ([64.71.167.205]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sc4RJ-0006O5-1y for gclrrg-raindrops@m.gmane.org; Wed, 06 Jun 2012 02:49:33 +0200 Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id 60D5A21DDB6 for ; Wed, 6 Jun 2012 00:57:34 +0000 (UTC) Eric Wong wrote: > Brian Corrigan wrote: > > Hey Eric - can you take it for here? Also, thanks for the patience :). > > Fwiw, it's cool to have code in this project. I learned a lot by reviewing > > the source. > > Sure thing. Btw, don't top post and don't send HTML parts. There's a > lot of technical mailing lists that don't welcome these things. > > Actually, did you get the test you added running at all? > > File.symlink returns 0 on success, so using the return value is bogus. > I'll rewrite it an squash a patch on top of it. I'll squash the following on top of your changes. However, I think the way unix_listener_stats behaves can pose some confusing usability problems with symlinks diff --git a/test/test_linux.rb b/test/test_linux.rb index 81463c9..1da86cf 100644 --- a/test/test_linux.rb +++ b/test/test_linux.rb @@ -73,24 +73,24 @@ class TestLinux < Test::Unit::TestCase us = UNIXServer.new(tmp.path) # Create a symlink - destination = Tempfile.new("somethingelse") - destination.unlink # We need an available name, not an actual file - link = File.symlink(tmp, destination) + link = Tempfile.new("somethingelse") + File.unlink(link.path) # We need an available name, not an actual file + File.symlink(tmp.path, link.path) @to_close << UNIXSocket.new(tmp.path) stats = unix_listener_stats - assert_equal 0, stats[link.path].active - assert_equal 1, stats[link.path].queued + assert_equal 0, stats[tmp.path].active + assert_equal 1, stats[tmp.path].queued - @to_close << UNIXSocket.new(tmp.path) + @to_close << UNIXSocket.new(link.path) stats = unix_listener_stats - assert_equal 0, stats[link.path].active - assert_equal 2, stats[link.path].queued + assert_equal 0, stats[tmp.path].active + assert_equal 2, stats[tmp.path].queued @to_close << us.accept stats = unix_listener_stats - assert_equal 1, stats[link.path].active - assert_equal 1, stats[link.path].queued + assert_equal 1, stats[tmp.path].active + assert_equal 1, stats[tmp.path].queued end def test_tcp -- Eric Wong