Skip to content

Commit

Permalink
tcp: move some parts from tcp_write_xmit
Browse files Browse the repository at this point in the history
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Dec 6, 2008
1 parent 41834b7 commit 726e07a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1530,13 +1530,6 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)
int cwnd_quota;
int result;

/* If we are closed, the bytes will have to remain here.
* In time closedown will finish, we empty the write queue and all
* will be happy.
*/
if (unlikely(sk->sk_state == TCP_CLOSE))
return 0;

sent_pkts = 0;

/* Do MTU probing. */
Expand Down Expand Up @@ -1608,10 +1601,18 @@ void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
{
struct sk_buff *skb = tcp_send_head(sk);

if (skb) {
if (tcp_write_xmit(sk, cur_mss, nonagle))
tcp_check_probe_timer(sk);
}
if (!skb)
return;

/* If we are closed, the bytes will have to remain here.
* In time closedown will finish, we empty the write queue and
* all will be happy.
*/
if (unlikely(sk->sk_state == TCP_CLOSE))
return;

if (tcp_write_xmit(sk, cur_mss, nonagle))
tcp_check_probe_timer(sk);
}

/* Send _single_ skb sitting at the send head. This function requires
Expand Down

0 comments on commit 726e07a

Please sign in to comment.