From owner-freebsd-net@FreeBSD.ORG Tue Feb 22 10:03:28 2005 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D25416A4CE for ; Tue, 22 Feb 2005 10:03:28 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DE9643D48 for ; Tue, 22 Feb 2005 10:03:28 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id EAB19530D; Tue, 22 Feb 2005 11:03:26 +0100 (CET) Received: from xps.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 382555308; Tue, 22 Feb 2005 11:02:58 +0100 (CET) Received: by xps.des.no (Postfix, from userid 1001) id F2D9533C3E; Tue, 22 Feb 2005 11:02:57 +0100 (CET) To: Kelly Yancey References: <20050221153304.J2022@gateway.posi.net> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Tue, 22 Feb 2005 11:02:57 +0100 In-Reply-To: <20050221153304.J2022@gateway.posi.net> (Kelly Yancey's message of "Mon, 21 Feb 2005 15:39:48 -0800 (PST)") Message-ID: <867jl0c3ou.fsf@xps.des.no> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on flood.des.no X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL,FORGED_RCVD_HELO autolearn=disabled version=3.0.1 cc: freebsd-net@FreeBSD.org cc: Pawel Worach Subject: Re: [patch] Update to libfetch X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Feb 2005 10:03:28 -0000 Kelly Yancey writes: > Attached is a patch to address concerns raised by Pawel Worach with > regards to the recent change to set TCP_NOPUSH when sending HTTP > requests from libfetch. The previous revision also introduced a call > to shutdown(2) to close the write half of the socket in order to force > the queued request to be sent. While this should be perfectly > acceptable behavior for a TCP client, it appears that squid provides a > configuration option to disallow half-closed clients (which Pawel is > currently using). As such, after introducing the shutdown(2) call, > fetch(1) can no longer fetch files via HTTP through such proxies. > To address this issue, the attached patch replaces the call to > shutdown(2) with some socket option fiddling (clearing TCP_NOPUSH and > setting TCP_NODELAY) which does the same job of forcing the client to > write the queued request to the network without closing the write half > of the socket. This feels a bit hackish to me, but gets the job done. > Anyway, I would appreciate any feedback. Thanks, Doesn't simply reading from the socket or selecting it for reading flush the output queue? DES --=20 Dag-Erling Sm=F8rgrav - des@des.no