From owner-freebsd-current@FreeBSD.ORG Thu Aug 29 16:26:56 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 946EABE7; Thu, 29 Aug 2013 16:26:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64C6525E3; Thu, 29 Aug 2013 16:26:56 +0000 (UTC) Received: from jhbbsd.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 201E6B93B; Thu, 29 Aug 2013 12:26:55 -0400 (EDT) From: John Baldwin To: Davide Italiano Subject: Re: Question about socket timeouts Date: Thu, 29 Aug 2013 12:03:22 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p28; KDE/4.5.5; amd64; ; ) References: <201308261505.06342.jhb@freebsd.org> In-Reply-To: <201308261505.06342.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201308291203.23055.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 29 Aug 2013 12:26:55 -0400 (EDT) Cc: Vitja Makarov , freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2013 16:26:56 -0000 On Monday, August 26, 2013 3:05:06 pm John Baldwin wrote: > On Monday, August 26, 2013 2:23:44 pm Davide Italiano wrote: > > Please consider the following patch: > > http://people.freebsd.org/~davide/review/socket_timeout.diff > > I've tested it and it works OK. I got a timeout which is ~= 25ms using > > the testcase provided by the user. > > The only doubt I have is about the range check, I've changed a bit > > because the 'integer' part of sbintime_t fits in 32-bits, but I'm not > > sure it's the best way of doing this. > > Nice! Bruce actually wants me to adjust the range check a bit (which will > fit in well with your changes I think). Please let me get that fix in > (so it can be part of the future MFC) and then you can commit this. Thanks! > > Actually, I think you still need to patch the sogetopt() case to work correctly > (it is still doing a manual conversion from 'val' to a timeval assuming it is > in 'hz' units). I'm done with my range check changes, please move forward with your change (though make sure you fix the sogetsockopt() case please). -- John Baldwin