diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2007-03-09 16:47:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-03-09 16:47:58 -0500 |
commit | aabb601b0f08b909b650f1a7bfa1e8d9b5a8d999 (patch) | |
tree | c3060d0005f6b035b43fe4e5855a1d514b43e589 /net/dccp/output.c | |
parent | c4e38f41e34ad853651d66227aae23e48457dce0 (diff) |
[DCCP]: Initialise write_xmit_timer also on passive sockets
The TX CCID needs the write_xmit_timer for delaying packet sends. Previously
this timer was only activated on active (connecting) sockets.
This patch initialises the write_xmit_timer in sync with the other timers, i.e.
the timer will be ready on any socket. This is used by applications with a
listening socket which start to stream after receiving an initiation by the
client. The write_xmit_timer is stopped when the application closes, as before.
Was tested to work and to remove the timer bug reported on dccp@vger.
Also moved timer initialisation into timer.c (static).
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/output.c')
-rw-r--r-- | net/dccp/output.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c index 3282f2f2291b..aa21cc4de37f 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -213,19 +213,6 @@ do_interrupted: | |||
213 | goto out; | 213 | goto out; |
214 | } | 214 | } |
215 | 215 | ||
216 | static void dccp_write_xmit_timer(unsigned long data) { | ||
217 | struct sock *sk = (struct sock *)data; | ||
218 | struct dccp_sock *dp = dccp_sk(sk); | ||
219 | |||
220 | bh_lock_sock(sk); | ||
221 | if (sock_owned_by_user(sk)) | ||
222 | sk_reset_timer(sk, &dp->dccps_xmit_timer, jiffies+1); | ||
223 | else | ||
224 | dccp_write_xmit(sk, 0); | ||
225 | bh_unlock_sock(sk); | ||
226 | sock_put(sk); | ||
227 | } | ||
228 | |||
229 | void dccp_write_xmit(struct sock *sk, int block) | 216 | void dccp_write_xmit(struct sock *sk, int block) |
230 | { | 217 | { |
231 | struct dccp_sock *dp = dccp_sk(sk); | 218 | struct dccp_sock *dp = dccp_sk(sk); |
@@ -434,9 +421,6 @@ static inline void dccp_connect_init(struct sock *sk) | |||
434 | dp->dccps_gar = dp->dccps_iss; | 421 | dp->dccps_gar = dp->dccps_iss; |
435 | 422 | ||
436 | icsk->icsk_retransmits = 0; | 423 | icsk->icsk_retransmits = 0; |
437 | init_timer(&dp->dccps_xmit_timer); | ||
438 | dp->dccps_xmit_timer.data = (unsigned long)sk; | ||
439 | dp->dccps_xmit_timer.function = dccp_write_xmit_timer; | ||
440 | } | 424 | } |
441 | 425 | ||
442 | int dccp_connect(struct sock *sk) | 426 | int dccp_connect(struct sock *sk) |