* kernel version, and may interrupt the macros rx_Read or
* rx_Write, which run at normal priority for efficiency. */
if (call->currentPacket) {
- queue_Prepend(&call->iovq, call->currentPacket);
+ call->currentPacket->flags &= ~RX_PKTFLAG_CP;
+ rxi_FreePacket(call->currentPacket);
call->currentPacket = (struct rx_packet *)0;
}
/* It's the next packet. Stick it on the receive queue
* for this call. Set newPackets to make sure we wake
* the reader once all packets have been processed */
+ np->flags |= RX_PKTFLAG_RQ;
queue_Prepend(&call->rq, np);
call->nSoftAcks++;
np = NULL; /* We can't use this anymore */
#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
{
queue_Remove(tp);
+ tp->flags &= ~RX_PKTFLAG_TQ;
rxi_FreePacket(tp); /* rxi_FreePacket mustn't wake up anyone, preemptively. */
}
}
rxi_ClearReceiveQueue(call);
/* why init the queue if you just emptied it? queue_Init(&call->rq); */
+
+ if (call->currentPacket) {
+ call->currentPacket->flags &= ~RX_PKTFLAG_CP;
+ rxi_FreePacket(call->currentPacket);
+ call->currentPacket = (struct rx_packet *)0;
+ }
+ call->curlen = call->nLeft = call->nFree = 0;
+
+ rxi_FreePackets(0, &call->iovq);
+
call->error = 0;
call->twind = call->conn->twind[call->channel];
call->rwind = call->conn->rwind[call->channel];
if (p->header.seq < call->tfirst
&& (p->flags & RX_PKTFLAG_ACKED)) {
queue_Remove(p);
+ p->flags &= ~RX_PKTFLAG_TQ;
rxi_FreePacket(p);
} else
missing = 1;
afs_int32 error;
register struct rx_connection *conn = call->conn;
queue_Remove(rp);
+ rp->flags &= ~RX_PKTFLAG_RQ;
/* RXS_CheckPacket called to undo RXS_PreparePacket's
* work. It may reduce the length of the packet by up
}
call->rnext++;
cp = call->currentPacket = rp;
+ call->currentPacket->flags |= RX_PKTFLAG_CP;
call->curvec = 1; /* 0th vec is always header */
/* begin at the beginning [ more or less ], continue
* on until the end, then stop. */
if (!call->nLeft) {
/* out of packet. Get another one. */
+ call->currentPacket->flags &= ~RX_PKTFLAG_CP;
rxi_FreePacket(cp);
cp = call->currentPacket = (struct rx_packet *)0;
} else if (!call->curlen) {
if (++call->curvec >= cp->niovecs) {
/* current packet is exhausted, get ready for another */
/* don't worry about curvec and stuff, they get set somewhere else */
+ call->currentPacket->flags &= ~RX_PKTFLAG_CP;
rxi_FreePacket(cp);
cp = call->currentPacket = (struct rx_packet *)0;
call->nLeft = 0;
afs_int32 error;
register struct rx_connection *conn = call->conn;
queue_Remove(rp);
+ rp->flags &= ~RX_PKTFLAG_RQ;
/* RXS_CheckPacket called to undo RXS_PreparePacket's
* work. It may reduce the length of the packet by up
}
call->rnext++;
curp = call->currentPacket = rp;
+ call->currentPacket->flags |= RX_PKTFLAG_CP;
call->curvec = 1; /* 0th vec is always header */
cur_iov = &curp->wirevec[1];
/* begin at the beginning [ more or less ], continue
if (!call->nLeft) {
/* out of packet. Get another one. */
+ curp->flags &= ~RX_PKTFLAG_CP;
+ curp->flags |= RX_PKTFLAG_IOVQ;
queue_Append(&call->iovq, curp);
curp = call->currentPacket = (struct rx_packet *)0;
} else if (!call->curlen) {
if (++call->curvec >= curp->niovecs) {
/* current packet is exhausted, get ready for another */
/* don't worry about curvec and stuff, they get set somewhere else */
+ curp->flags &= ~RX_PKTFLAG_CP;
+ curp->flags |= RX_PKTFLAG_IOVQ;
queue_Append(&call->iovq, curp);
curp = call->currentPacket = (struct rx_packet *)0;
call->nLeft = 0;
&& (call->mode == RX_MODE_RECEIVING)) {
call->mode = RX_MODE_SENDING;
if (cp) {
+ cp->flags &= ~RX_PKTFLAG_CP;
rxi_FreePacket(cp);
cp = call->currentPacket = (struct rx_packet *)0;
call->nLeft = 0;
* conn->securityMaxTrailerSize */
hadd32(call->bytesSent, cp->length);
rxi_PrepareSendPacket(call, cp, 0);
+ cp->flags &= ~RX_PKTFLAG_CP;
+ cp->flags |= RX_PKTFLAG_TQ;
queue_Append(&call->tq, cp);
- cp = call->currentPacket = NULL;
+ cp = call->currentPacket = (struct rx_packet *)0;
if (!
(call->
flags & (RX_CALL_FAST_RECOVER |
RX_CALL_FAST_RECOVER_WAIT))) {
rxi_Start(0, call, 0, 0);
}
+ } else else if (cp) {
+ cp->flags &= ~RX_PKTFLAG_CP;
+ rxi_FreePacket(cp);
+ cp = call->currentPacket = (struct rx_packet *)0;
}
/* Wait for transmit window to open up */
while (!call->error
#endif /* RX_ENABLE_LOCKS */
}
if ((cp = rxi_AllocSendPacket(call, nbytes))) {
+ cp->flags |= RX_PKTFLAG_CP;
call->currentPacket = cp;
call->nFree = cp->length;
call->curvec = 1; /* 0th vec is always header */
}
if (call->error) {
if (cp) {
+ cp->flags &= ~RX_PKTFLAG_CP;
rxi_FreePacket(cp);
call->currentPacket = NULL;
}
&& (call->mode == RX_MODE_RECEIVING)) {
call->mode = RX_MODE_SENDING;
if (cp) {
+ cp->flags &= ~RX_PKTFLAG_CP;
rxi_FreePacket(cp);
cp = call->currentPacket = (struct rx_packet *)0;
call->nLeft = 0;
*nio = nextio;
return requestCount - nbytes;
}
+ cp->flags |= RX_PKTFLAG_IOVQ;
queue_Append(&call->iovq, cp);
tnFree = cp->length;
tcurvec = 1;
if (call->error) {
if (cp) {
+ cp->flags &= ~RX_PKTFLAG_CP;
+ cp->flags |= RX_PKTFLAG_IOVQ;
queue_Prepend(&call->iovq, cp);
- cp = call->currentPacket = NULL;
+ cp = call->currentPacket = (struct rx_packet *)0;
}
rxi_FreePackets(0, &call->iovq);
return 0;
* conn->securityMaxTrailerSize */
hadd32(call->bytesSent, cp->length);
rxi_PrepareSendPacket(call, cp, 0);
+ cp->flags |= RX_PKTFLAG_TQ;
queue_Append(&tmpq, cp);
/* The head of the iovq is now the current packet */
if (nbytes) {
if (queue_IsEmpty(&call->iovq)) {
call->error = RX_PROTOCOL_ERROR;
- cp = call->currentPacket = NULL;
rxi_FreePackets(0, &tmpq);
return 0;
}
cp = queue_First(&call->iovq, rx_packet);
queue_Remove(cp);
+ cp->flags &= ~RX_PKTFLAG_IOVQ;
+ cp->flags |= RX_PKTFLAG_CP;
call->currentPacket = cp;
call->nFree = cp->length;
call->curvec = 1;
|| iov[nextio].iov_len > (int)call->curlen) {
call->error = RX_PROTOCOL_ERROR;
if (cp) {
+ cp->flags &= ~RX_PKTFLAG_CP;
queue_Prepend(&tmpq, cp);
- call->currentPacket = NULL;
}
rxi_FreePackets(0, &tmpq);
return 0;
if (call->error) {
if (cp) {
+ cp->flags &= ~RX_PKTFLAG_CP;
rxi_FreePacket(cp);
- cp = call->currentPacket = NULL;
}
return 0;
}
/* cp->length is only supposed to be the user's data */
/* cp->length was already set to (then-current)
* MaxUserDataSize or less. */
+ cp->flags &= ~RX_PKTFLAG_CP;
cp->length -= call->nFree;
call->currentPacket = (struct rx_packet *)0;
call->nFree = 0;
/* The 1 specifies that this is the last packet */
hadd32(call->bytesSent, cp->length);
rxi_PrepareSendPacket(call, cp, 1);
+ cp->flags |= RX_PKTFLAG_TQ;
queue_Append(&call->tq, cp);
if (!
(call->