diff options
Diffstat (limited to 'net/dccp/proto.c')
| -rw-r--r-- | net/dccp/proto.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 7e5fc04eb6d1..ef343d53fcea 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
| @@ -726,7 +726,13 @@ int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 726 | goto out_discard; | 726 | goto out_discard; |
| 727 | 727 | ||
| 728 | skb_queue_tail(&sk->sk_write_queue, skb); | 728 | skb_queue_tail(&sk->sk_write_queue, skb); |
| 729 | dccp_write_xmit(sk,0); | 729 | /* |
| 730 | * The xmit_timer is set if the TX CCID is rate-based and will expire | ||
| 731 | * when congestion control permits to release further packets into the | ||
| 732 | * network. Window-based CCIDs do not use this timer. | ||
| 733 | */ | ||
| 734 | if (!timer_pending(&dp->dccps_xmit_timer)) | ||
| 735 | dccp_write_xmit(sk); | ||
| 730 | out_release: | 736 | out_release: |
| 731 | release_sock(sk); | 737 | release_sock(sk); |
| 732 | return rc ? : len; | 738 | return rc ? : len; |
| @@ -951,9 +957,22 @@ void dccp_close(struct sock *sk, long timeout) | |||
| 951 | /* Check zero linger _after_ checking for unread data. */ | 957 | /* Check zero linger _after_ checking for unread data. */ |
| 952 | sk->sk_prot->disconnect(sk, 0); | 958 | sk->sk_prot->disconnect(sk, 0); |
| 953 | } else if (sk->sk_state != DCCP_CLOSED) { | 959 | } else if (sk->sk_state != DCCP_CLOSED) { |
| 960 | /* | ||
| 961 | * Normal connection termination. May need to wait if there are | ||
| 962 | * still packets in the TX queue that are delayed by the CCID. | ||
| 963 | */ | ||
| 964 | dccp_flush_write_queue(sk, &timeout); | ||
| 954 | dccp_terminate_connection(sk); | 965 | dccp_terminate_connection(sk); |
| 955 | } | 966 | } |
| 956 | 967 | ||
| 968 | /* | ||
| 969 | * Flush write queue. This may be necessary in several cases: | ||
| 970 | * - we have been closed by the peer but still have application data; | ||
| 971 | * - abortive termination (unread data or zero linger time), | ||
| 972 | * - normal termination but queue could not be flushed within time limit | ||
| 973 | */ | ||
| 974 | __skb_queue_purge(&sk->sk_write_queue); | ||
| 975 | |||
| 957 | sk_stream_wait_close(sk, timeout); | 976 | sk_stream_wait_close(sk, timeout); |
| 958 | 977 | ||
| 959 | adjudge_to_death: | 978 | adjudge_to_death: |
