diff --git a/examples/client.c b/examples/client.c index c589ae21..bb13ded9 100644 --- a/examples/client.c +++ b/examples/client.c @@ -1112,8 +1112,7 @@ main(int argc, char **argv) { nextpdu = coap_peek_next( ctx ); coap_ticks(&now); - while (nextpdu && - coap_time_le(nextpdu->t, now - ctx->sendqueue_basetime)) { + while (nextpdu && nextpdu->t <= now - ctx->sendqueue_basetime) { coap_retransmit( ctx, coap_pop_next( ctx )); nextpdu = coap_peek_next( ctx ); } diff --git a/examples/server.c b/examples/server.c index 17158737..9c633911 100644 --- a/examples/server.c +++ b/examples/server.c @@ -398,12 +398,12 @@ main(int argc, char **argv) { nextpdu = coap_peek_next( ctx ); coap_ticks(&now); - while (nextpdu && coap_time_le(nextpdu->t, now - ctx->sendqueue_basetime)) { + while (nextpdu && nextpdu->t <= now - ctx->sendqueue_basetime) { coap_retransmit( ctx, coap_pop_next( ctx ) ); nextpdu = coap_peek_next( ctx ); } - if (nextpdu && coap_time_le(nextpdu->t, COAP_RESOURCE_CHECK_TIME)) { + if ( nextpdu && nextpdu->t <= COAP_RESOURCE_CHECK_TIME ) { /* set timeout if there is a pdu to send before our automatic timeout occurs */ tv.tv_usec = ((nextpdu->t) % COAP_TICKS_PER_SECOND) * 1000000 / COAP_TICKS_PER_SECOND; tv.tv_sec = (nextpdu->t) / COAP_TICKS_PER_SECOND; diff --git a/net.c b/net.c index 3fa75e40..d9854ec2 100644 --- a/net.c +++ b/net.c @@ -101,7 +101,7 @@ coap_insert_node(coap_queue_t **queue, coap_queue_t *node) { /* replace queue head if PDU's time is less than head's time */ q = *queue; - if (coap_time_lt(node->t, q->t)) { + if (node->t < q->t) { node->next = q; *queue = node; q->t -= node->t; /* make q->t relative to node->t */ @@ -113,7 +113,7 @@ coap_insert_node(coap_queue_t **queue, coap_queue_t *node) { node->t -= q->t; /* make node-> relative to q->t */ p = q; q = q->next; - } while (q && coap_time_le(q->t, node->t)); + } while (q && q->t <= node->t); /* insert new item */ if (q) { @@ -547,7 +547,7 @@ coap_send_confirmed(coap_context_t *context, node->t = node->timeout; context->sendqueue_basetime = now; } else { - assert(coap_time_le(context->sendqueue_basetime,now)); + assert(context->sendqueue_basetime <= now); /* make node->t relative to context->sendqueue_basetime */ node->t = now + node->timeout - context->sendqueue_basetime; }