Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44265
b: refs/heads/master
c: 5cc3741
h: refs/heads/master
i:
  44263: 29e4662
v: v3
  • Loading branch information
Ian McDonald authored and David S. Miller committed Dec 11, 2006
1 parent f020a63 commit 93b69b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e37b8d931936f88e4b2af66304eb44e69510b86c
refs/heads/master: 5cc3741d6cc9f07d8ddd9c45cb5088460ce3364f
2 changes: 0 additions & 2 deletions trunk/net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo);

#define DCCP_RTO_MAX ((unsigned)(120 * HZ)) /* FIXME: using TCP value */

#define DCCP_XMIT_TIMEO 30000 /* Time/msecs for blocking transmit per packet */

/* sysctl variables for DCCP */
extern int sysctl_dccp_request_retries;
extern int sysctl_dccp_retries1;
Expand Down
26 changes: 6 additions & 20 deletions trunk/net/dccp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,36 +175,29 @@ void dccp_write_space(struct sock *sk)
/**
* dccp_wait_for_ccid - Wait for ccid to tell us we can send a packet
* @sk: socket to wait for
* @timeo: for how long
*/
static int dccp_wait_for_ccid(struct sock *sk, struct sk_buff *skb,
long *timeo)
static int dccp_wait_for_ccid(struct sock *sk, struct sk_buff *skb)
{
struct dccp_sock *dp = dccp_sk(sk);
DEFINE_WAIT(wait);
long delay;
unsigned long delay;
int rc;

while (1) {
prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);

if (sk->sk_err)
goto do_error;
if (!*timeo)
goto do_nonblock;
if (signal_pending(current))
goto do_interrupted;

rc = ccid_hc_tx_send_packet(dp->dccps_hc_tx_ccid, sk, skb);
if (rc <= 0)
break;
delay = msecs_to_jiffies(rc);
if (delay > *timeo || delay < 0)
goto do_nonblock;

sk->sk_write_pending++;
release_sock(sk);
*timeo -= schedule_timeout(delay);
schedule_timeout(delay);
lock_sock(sk);
sk->sk_write_pending--;
}
Expand All @@ -215,11 +208,8 @@ static int dccp_wait_for_ccid(struct sock *sk, struct sk_buff *skb,
do_error:
rc = -EPIPE;
goto out;
do_nonblock:
rc = -EAGAIN;
goto out;
do_interrupted:
rc = sock_intr_errno(*timeo);
rc = -EINTR;
goto out;
}

Expand All @@ -240,8 +230,6 @@ void dccp_write_xmit(struct sock *sk, int block)
{
struct dccp_sock *dp = dccp_sk(sk);
struct sk_buff *skb;
long timeo = DCCP_XMIT_TIMEO; /* If a packet is taking longer than
this we have other issues */

while ((skb = skb_peek(&sk->sk_write_queue))) {
int err = ccid_hc_tx_send_packet(dp->dccps_hc_tx_ccid, sk, skb);
Expand All @@ -251,10 +239,8 @@ void dccp_write_xmit(struct sock *sk, int block)
sk_reset_timer(sk, &dp->dccps_xmit_timer,
msecs_to_jiffies(err)+jiffies);
break;
} else {
err = dccp_wait_for_ccid(sk, skb, &timeo);
timeo = DCCP_XMIT_TIMEO;
}
} else
err = dccp_wait_for_ccid(sk, skb);
if (err)
DCCP_BUG("err=%d after dccp_wait_for_ccid", err);
}
Expand Down

0 comments on commit 93b69b5

Please sign in to comment.