Sending with interval 0 made explicit

This commit is contained in:
adamdunkels 2008-01-07 14:53:04 +00:00
parent d33871facc
commit 25a5434fb5

View file

@ -33,7 +33,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: ipolite.c,v 1.3 2007/11/26 23:22:41 adamdunkels Exp $ * $Id: ipolite.c,v 1.4 2008/01/07 14:53:04 adamdunkels Exp $
*/ */
/** /**
@ -87,7 +87,7 @@ send(void *ptr)
c->q = NULL; c->q = NULL;
ibc_send(&c->c); ibc_send(&c->c);
if(c->cb->sent) { if(c->cb->sent) {
c->cb->sent(c); c->cb->sent(c);
} }
} }
} }
@ -123,9 +123,13 @@ ipolite_send(struct ipolite_conn *c, clock_time_t interval, u8_t hdrsize)
c->hdrsize = hdrsize; c->hdrsize = hdrsize;
c->q = queuebuf_new_from_rimebuf(); c->q = queuebuf_new_from_rimebuf();
if(c->q != NULL) { if(c->q != NULL) {
ctimer_set(&c->t, if(interval == 0) {
interval / 2 + (random_rand() % (interval / 2)), ctimer_set(&c->t, 0, send, c);
send, c); } else {
ctimer_set(&c->t,
interval / 2 + (random_rand() % (interval / 2)),
send, c);
}
return 1; return 1;
} }
return 0; return 0;