}
rxi_SendSpecial(call, call->conn, (struct rx_packet *)0,
RX_PACKET_TYPE_ACKALL, NULL, 0, 0);
+ call->flags |= RX_CALL_ACKALL_SENT;
if (event)
MUTEX_EXIT(&call->lock);
#else /* RX_ENABLE_LOCKS */
call->delayedAckEvent = NULL;
rxi_SendSpecial(call, call->conn, (struct rx_packet *)0,
RX_PACKET_TYPE_ACKALL, NULL, 0, 0);
+ call->flags |= RX_CALL_ACKALL_SENT;
#endif /* RX_ENABLE_LOCKS */
}
ap->serial = htonl(serial);
ap->maxSkew = 0; /* used to be peer->inPacketSkew */
- ap->firstPacket = htonl(call->rnext); /* First packet not yet forwarded to reader */
+ /*
+ * First packet not yet forwarded to reader. When ACKALL has been
+ * sent the peer has been told that all received packets will be
+ * delivered to the reader. The value 'rnext' is used internally
+ * to refer to the next packet in the receive queue that must be
+ * delivered to the reader. From the perspective of the peer it
+ * already has so report the last sequence number plus one if there
+ * are packets in the receive queue awaiting processing.
+ */
+ if ((call->flags & RX_CALL_ACKALL_SENT) &&
+ !queue_IsEmpty(&call->rq)) {
+ ap->firstPacket = htonl(queue_Last(&call->rq, rx_packet)->header.seq + 1);
+ } else
+ ap->firstPacket = htonl(call->rnext);
+
ap->previousPacket = htonl(call->rprev); /* Previous packet received */
/* No fear of running out of ack packet here because there can only be at most
#define RX_CALL_NEED_START 0x10000 /* tells rxi_Start to start again */
#define RX_CALL_PEER_BUSY 0x20000 /* the last packet we received on this call was a
* BUSY packet; i.e. the channel for this call is busy */
+#define RX_CALL_ACKALL_SENT 0x40000 /* ACKALL has been sent on the call */
/* The structure of the data portion of an acknowledge packet: An acknowledge