diff -rNu linux-2.4.9-ac10/include/net/tcp.h linux/include/net/tcp.h --- linux-2.4.9-ac10/include/net/tcp.h Thu Sep 27 23:25:39 2001 +++ linux/include/net/tcp.h Sun Sep 30 10:41:45 2001 @@ -1162,8 +1163,9 @@ /* Return 0, if packet can be sent now without violation Nagle's rules: 1. It is full sized. 2. Or it contains FIN. - 3. Or TCP_NODELAY was set. - 4. Or TCP_CORK is not set, and all sent packets are ACKed. + 3. Or higher layers meant to force a packet boundary, hence the PSH bit. + 4. Or TCP_NODELAY was set. + 5. Or TCP_CORK is not set, and all sent packets are ACKed. With Minshall's modification: all sent small packets are ACKed. */ @@ -1171,7 +1173,7 @@ tcp_nagle_check(struct tcp_opt *tp, struct sk_buff *skb, unsigned mss_now, int nonagle) { return (skb->len < mss_now && - !(TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) && + !(TCP_SKB_CB(skb)->flags & (TCPCB_FLAG_FIN|TCPCB_FLAG_PSH)) && (nonagle == 2 || (!nonagle && tp->packets_out && @@ -1238,9 +1243,12 @@ struct sk_buff *skb = tp->send_head; if (skb) { + int snd_test; + if (!tcp_skb_is_last(sk, skb)) nonagle = 1; - if (!tcp_snd_test(tp, skb, cur_mss, nonagle) || + snd_test = tcp_snd_test(tp, skb, cur_mss, nonagle); + if (!snd_test || tcp_write_xmit(sk, nonagle)) tcp_check_probe_timer(sk, tp); }