From owner-freebsd-net Thu Feb 1 15: 7:54 2001 Delivered-To: freebsd-net@freebsd.org Received: from hand.dotat.at (sfo-gw.covalent.net [207.44.198.62]) by hub.freebsd.org (Postfix) with ESMTP id BA7FD37B491 for ; Thu, 1 Feb 2001 15:07:34 -0800 (PST) Received: from fanf by hand.dotat.at with local (Exim 3.20 #3) id 14OSoO-000BWr-00; Thu, 01 Feb 2001 23:06:44 +0000 Date: Thu, 1 Feb 2001 23:06:44 +0000 From: Tony Finch To: Garrett Wollman Cc: freebsd-net@FreeBSD.ORG Subject: Re: sendfile() Message-ID: <20010201230644.W70673@hand.dotat.at> References: <1217774688.20010201133139@163.net> <20010201023825.A71975@xor.obsecurity.org> <20010201180010.Q70673@hand.dotat.at> <200102012010.PAA79234@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200102012010.PAA79234@khavrinen.lcs.mit.edu> Organization: Covalent Technologies, Inc Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Garrett Wollman wrote: >Tony Finch wrote: >> >> For this reason turning off TCP_CORK pushes out queued data, but >> this isn't the case for TCP_NOPUSH. > >This is a long-standing bug. You are welcome to fix it. I've been looking at this and it seems to me to be simply a case of calling tcp_output() from tcp_ctloutput() if TF_NOPUSH is cleared. But I'm not certain I have my head properly around the code... Index: tcp_usrreq.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/tcp_usrreq.c,v retrieving revision 1.51 diff -u -r1.51 tcp_usrreq.c --- tcp_usrreq.c 2000/01/09 19:17:28 1.51 +++ tcp_usrreq.c 2001/02/01 23:03:35 @@ -896,7 +896,6 @@ switch (sopt->sopt_name) { case TCP_NODELAY: case TCP_NOOPT: - case TCP_NOPUSH: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); if (error) @@ -921,6 +920,20 @@ tp->t_flags |= opt; else tp->t_flags &= ~opt; + break; + + case TCP_NOPUSH: + error = sooptcopyin(sopt, &optval, sizeof optval, + sizeof optval); + if (error) + break; + + if (optval) + tp->t_flags |= opt; + else { + tp->t_flags &= ~opt; + error = tcp_output(tp); + } break; case TCP_MAXSEG: Tony. -- f.a.n.finch fanf@covalent.net dot@dotat.at "Well, as long as they can think we'll have our problems. But those whom we're using cannot think." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message