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 $
*/ */
/** /**
@ -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) {
if(interval == 0) {
ctimer_set(&c->t, 0, send, c);
} else {
ctimer_set(&c->t, ctimer_set(&c->t,
interval / 2 + (random_rand() % (interval / 2)), interval / 2 + (random_rand() % (interval / 2)),
send, c); send, c);
}
return 1; return 1;
} }
return 0; return 0;