Repository : ssh://git@open-mesh.org/alfred
On branch : master
commit 0cfb4e1c6d171ca3116f2228994a21065a8f0b2c Author: Sven Eckelmann sven@open-mesh.com Date: Thu Jan 17 17:17:29 2013 +0100
alfred: Only send txend when requested
The synchronization (master <-> master, local -> master) without data doesn't require a txend because the remote would not have opened a transaction for it. Therefore, sending a txend would only increase the network requirements.
Signed-off-by: Sven Eckelmann sven@open-mesh.com
0cfb4e1c6d171ca3116f2228994a21065a8f0b2c send.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/send.c b/send.c index 588dac1..d6920f8 100644 --- a/send.c +++ b/send.c @@ -108,16 +108,18 @@ int push_data(struct globals *globals, struct in6_addr *destination, }
/* send transaction txend packet */ - status_end.header.type = ALFRED_STATUS_TXEND; - status_end.header.version = ALFRED_VERSION; - length = sizeof(status_end) - sizeof(status_end.header); - status_end.header.length = htons(length); + if (seqno > 0 || type_filter != NO_FILTER) { + status_end.header.type = ALFRED_STATUS_TXEND; + status_end.header.version = ALFRED_VERSION; + length = sizeof(status_end) - sizeof(status_end.header); + status_end.header.length = htons(length);
- status_end.tx.id = tx_id; - status_end.tx.seqno = htons(seqno); + status_end.tx.id = tx_id; + status_end.tx.seqno = htons(seqno);
- send_alfred_packet(globals, destination, &status_end, - sizeof(status_end)); + send_alfred_packet(globals, destination, &status_end, + sizeof(status_end)); + }
return 0; }