#include "rx_queue.h"
#include "rx_globals.h"
+#include "rx_conn.h"
+#include "rx_call.h"
+#include "rx_packet.h"
+
#ifdef RX_LOCKS_DB
/* rxdb_fileID is used to identify the lock location, along with line#. */
static int rxdb_fileID = RXDB_FILE_RX_RDWR;
call->nHardAcks++;
if (!(call->flags & RX_CALL_RECEIVE_DONE)) {
if (call->nHardAcks > (u_short) rxi_HardAckRate) {
- rxevent_Cancel(call->delayedAckEvent, call,
+ rxevent_Cancel(&call->delayedAckEvent, call,
RX_CALL_REFCOUNT_DELAY);
rxi_SendAck(call, 0, 0, RX_ACK_DELAY, 0);
} else {
rx_ReadProc(struct rx_call *call, char *buf, int nbytes)
{
int bytes;
- int tcurlen;
- int tnLeft;
- char *tcurpos;
SPLVAR;
/* Free any packets from the last call to ReadvProc/WritevProc */
* Most common case, all of the data is in the current iovec.
* We are relying on nLeft being zero unless the call is in receive mode.
*/
- tcurlen = call->curlen;
- tnLeft = call->nLeft;
- if (!call->error && tcurlen > nbytes && tnLeft > nbytes) {
- tcurpos = call->curpos;
- memcpy(buf, tcurpos, nbytes);
+ if (!call->error && call->curlen > nbytes && call->nLeft > nbytes) {
+ memcpy(buf, call->curpos, nbytes);
- call->curpos = tcurpos + nbytes;
- call->curlen = tcurlen - nbytes;
- call->nLeft = tnLeft - nbytes;
+ call->curpos += nbytes;
+ call->curlen -= nbytes;
+ call->nLeft -= nbytes;
if (!call->nLeft && call->currentPacket != NULL) {
/* out of packet. Get another one. */
rx_ReadProc32(struct rx_call *call, afs_int32 * value)
{
int bytes;
- int tcurlen;
- int tnLeft;
- char *tcurpos;
SPLVAR;
/* Free any packets from the last call to ReadvProc/WritevProc */
* Most common case, all of the data is in the current iovec.
* We are relying on nLeft being zero unless the call is in receive mode.
*/
- tcurlen = call->curlen;
- tnLeft = call->nLeft;
- if (!call->error && tcurlen >= sizeof(afs_int32)
- && tnLeft >= sizeof(afs_int32)) {
- tcurpos = call->curpos;
+ if (!call->error && call->curlen >= sizeof(afs_int32)
+ && call->nLeft >= sizeof(afs_int32)) {
- memcpy((char *)value, tcurpos, sizeof(afs_int32));
+ memcpy((char *)value, call->curpos, sizeof(afs_int32));
+
+ call->curpos += sizeof(afs_int32);
+ call->curlen -= sizeof(afs_int32);
+ call->nLeft -= sizeof(afs_int32);
- call->curpos = tcurpos + sizeof(afs_int32);
- call->curlen = (u_short)(tcurlen - sizeof(afs_int32));
- call->nLeft = (u_short)(tnLeft - sizeof(afs_int32));
if (!call->nLeft && call->currentPacket != NULL) {
/* out of packet. Get another one. */
rxi_FreePacket(call->currentPacket);
* send a hard ack. */
if (didConsume && (!(call->flags & RX_CALL_RECEIVE_DONE))) {
if (call->nHardAcks > (u_short) rxi_HardAckRate) {
- rxevent_Cancel(call->delayedAckEvent, call,
+ rxevent_Cancel(&call->delayedAckEvent, call,
RX_CALL_REFCOUNT_DELAY);
rxi_SendAck(call, 0, serial, RX_ACK_DELAY, 0);
didHardAck = 1;