Date: Thu, 1 Feb 2001 23:06:44 +0000 From: Tony Finch <dot@dotat.at> To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> Cc: freebsd-net@FreeBSD.ORG Subject: Re: sendfile() Message-ID: <20010201230644.W70673@hand.dotat.at> In-Reply-To: <200102012010.PAA79234@khavrinen.lcs.mit.edu> References: <1217774688.20010201133139@163.net> <20010201023825.A71975@xor.obsecurity.org> <20010201180010.Q70673@hand.dotat.at> <200102012010.PAA79234@khavrinen.lcs.mit.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman <wollman@khavrinen.lcs.mit.edu> wrote: >Tony Finch <dot@dotat.at> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010201230644.W70673>