Only send ACK if it was possible to allocate a queuebuf to hold the data packet.
This commit is contained in:
parent
4d35b905d3
commit
df33cb6e16
1 changed files with 19 additions and 19 deletions
|
@ -34,7 +34,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: runicast.c,v 1.1 2008/07/03 21:52:25 adamdunkels Exp $
|
* $Id: runicast.c,v 1.2 2008/07/07 23:27:57 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -146,24 +146,24 @@ recv_from_stunicast(struct stunicast_conn *stunicast, rimeaddr_t *from)
|
||||||
/* rimebuf_hdrreduce(sizeof(struct runicast_hdr));*/
|
/* rimebuf_hdrreduce(sizeof(struct runicast_hdr));*/
|
||||||
|
|
||||||
q = queuebuf_new_from_rimebuf();
|
q = queuebuf_new_from_rimebuf();
|
||||||
|
if(q != NULL) {
|
||||||
PRINTF("%d.%d: runicast: Sending ACK to %d.%d for %d\n",
|
PRINTF("%d.%d: runicast: Sending ACK to %d.%d for %d\n",
|
||||||
rimeaddr_node_addr.u8[0],rimeaddr_node_addr.u8[1],
|
rimeaddr_node_addr.u8[0],rimeaddr_node_addr.u8[1],
|
||||||
from->u8[0], from->u8[1],
|
from->u8[0], from->u8[1],
|
||||||
packet_seqno);
|
packet_seqno);
|
||||||
rimebuf_clear();
|
rimebuf_clear();
|
||||||
/* rimebuf_hdralloc(sizeof(struct runicast_hdr));
|
/* rimebuf_hdralloc(sizeof(struct runicast_hdr));
|
||||||
hdr = rimebuf_hdrptr();
|
hdr = rimebuf_hdrptr();
|
||||||
hdr->type = TYPE_ACK;
|
hdr->type = TYPE_ACK;
|
||||||
hdr->seqno = packet_seqno;*/
|
hdr->seqno = packet_seqno;*/
|
||||||
rimebuf_set_attr(RIMEBUF_ATTR_PACKET_TYPE, RIMEBUF_ATTR_PACKET_TYPE_ACK);
|
rimebuf_set_attr(RIMEBUF_ATTR_PACKET_TYPE, RIMEBUF_ATTR_PACKET_TYPE_ACK);
|
||||||
rimebuf_set_attr(RIMEBUF_ATTR_PACKET_ID, packet_seqno);
|
rimebuf_set_attr(RIMEBUF_ATTR_PACKET_ID, packet_seqno);
|
||||||
stunicast_send(&c->c, from);
|
stunicast_send(&c->c, from);
|
||||||
RIMESTATS_ADD(acktx);
|
RIMESTATS_ADD(acktx);
|
||||||
|
|
||||||
queuebuf_to_rimebuf(q);
|
queuebuf_to_rimebuf(q);
|
||||||
queuebuf_free(q);
|
queuebuf_free(q);
|
||||||
|
}
|
||||||
if(c->u->recv != NULL) {
|
if(c->u->recv != NULL) {
|
||||||
c->u->recv(c, from, packet_seqno);
|
c->u->recv(c, from, packet_seqno);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue