call->nLeft = call->nFree = call->curlen = 0;
/* Free any packets from the last call to ReadvProc/WritevProc */
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
CALL_RELE(call, RX_CALL_REFCOUNT_BEGIN);
} else {
call = (struct rx_call *)rxi_Alloc(sizeof(struct rx_call));
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->allNextp = rx_allCallsp;
rx_allCallsp = call;
call->call_id =
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rx_MutexIncrement(rx_stats.nCallStructs, rx_stats_mutex);
MUTEX_EXIT(&rx_freeCallQueue_lock);
queue_Init(&call->tq);
queue_Init(&call->rq);
queue_Init(&call->iovq);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->rqc = call->tqc = call->iovqc = 0;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
/* Bind the call to its connection structure (prereq for reset) */
call->conn = conn;
rxi_ResetCall(call, 1);
* the reader once all packets have been processed */
np->flags |= RX_PKTFLAG_RQ;
queue_Prepend(&call->rq, np);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->rqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
call->nSoftAcks++;
np = NULL; /* We can't use this anymore */
newPackets = 1;
* queue head if the queue is empty or the packet should be
* appended. */
np->flags |= RX_PKTFLAG_RQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->rqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
queue_InsertBefore(tp, np);
call->nSoftAcks++;
np = NULL;
{
queue_Remove(tp);
tp->flags &= ~RX_PKTFLAG_TQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->tqc--;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePacket(tp); /* rxi_FreePacket mustn't wake up anyone, preemptively. */
}
}
}
} else {
#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->tqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->tq);
#ifdef AFS_GLOBAL_RXLOCK_KERNEL
call->flags &= ~RX_CALL_TQ_CLEARME;
count = rxi_FreePackets(0, &call->rq);
rx_packetReclaims += count;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->rqc -= count;
if ( call->rqc != 0 )
dpf(("rxi_ClearReceiveQueue call %x rqc %u != 0", call, call->rqc));
call->currentPacket->flags &= ~RX_PKTFLAG_CP;
call->currentPacket->flags |= RX_PKTFLAG_IOVQ;
queue_Prepend(&call->iovq, call->currentPacket);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
call->currentPacket = (struct rx_packet *)0;
}
call->curlen = call->nLeft = call->nFree = 0;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
#endif
rxi_FreePackets(0, &call->iovq);
&& (p->flags & RX_PKTFLAG_ACKED)) {
queue_Remove(p);
p->flags &= ~RX_PKTFLAG_TQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->tqc--;
#endif
rxi_FreePacket(p);
#ifdef AFS_NT40_ENV
int rx_DumpCalls(FILE *outputFile, char *cookie)
{
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
int zilch;
#ifdef KDUMP_RX_LOCK
struct rx_call_rx_lock *c;
}
sprintf(output, "%s - End dumping all Rx Calls\r\n", cookie);
WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
return 0;
}
#endif /* AFS_NT40_ENV */
static int rxdb_fileID = RXDB_FILE_RX_PACKET;
#endif /* RX_LOCKS_DB */
static struct rx_packet *rx_mallocedP = 0;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
static afs_uint32 rx_packet_id = 0;
#endif
NETPRI;
MUTEX_ENTER(&rx_freePktQ_lock);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
p->packetId = rx_packet_id++;
p->allNextp = rx_mallocedP;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rx_mallocedP = p;
MUTEX_EXIT(&rx_freePktQ_lock);
USERPRI;
p->niovecs = 2;
queue_Append(&rx_freePacketQueue, p);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
p->packetId = rx_packet_id++;
p->allNextp = rx_mallocedP;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rx_mallocedP = p;
}
NETPRI;
MUTEX_ENTER(&rx_freePktQ_lock);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
p->packetId = rx_packet_id++;
p->allNextp = rx_mallocedP;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rx_mallocedP = p;
MUTEX_EXIT(&rx_freePktQ_lock);
USERPRI;
p->niovecs = 2;
queue_Append(&rx_freePacketQueue, p);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
p->packetId = rx_packet_id++;
p->allNextp = rx_mallocedP;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rx_mallocedP = p;
}
*/
int rx_DumpPackets(FILE *outputFile, char *cookie)
{
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
int zilch;
struct rx_packet *p;
char output[2048];
MUTEX_EXIT(&rx_freePktQ_lock);
USERPRI;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
return 0;
}
#endif /* AFS_NT40_ENV */
/* Free any packets from the last call to ReadvProc/WritevProc */
if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
}
register struct rx_connection *conn = call->conn;
queue_Remove(rp);
rp->flags &= ~RX_PKTFLAG_RQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->rqc--;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
/* RXS_CheckPacket called to undo RXS_PreparePacket's
* work. It may reduce the length of the packet by up
* ReadvProc/WritevProc.
*/
if (!queue_IsEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
}
* ReadvProc/WritevProc.
*/
if (!queue_IsEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
}
register struct rx_connection *conn = call->conn;
queue_Remove(rp);
rp->flags &= ~RX_PKTFLAG_RQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->rqc--;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
/* RXS_CheckPacket called to undo RXS_PreparePacket's
* work. It may reduce the length of the packet by up
curp->flags &= ~RX_PKTFLAG_CP;
curp->flags |= RX_PKTFLAG_IOVQ;
queue_Append(&call->iovq, curp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
curp = call->currentPacket = (struct rx_packet *)0;
} else if (!call->curlen) {
/* need to get another struct iov */
curp->flags &= ~RX_PKTFLAG_CP;
curp->flags |= RX_PKTFLAG_IOVQ;
queue_Append(&call->iovq, curp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
curp = call->currentPacket = (struct rx_packet *)0;
call->nLeft = 0;
} else {
/* Free any packets from the last call to ReadvProc/WritevProc */
if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
}
/* Free any packets from the last call to ReadvProc/WritevProc */
if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
}
rxi_PrepareSendPacket(call, cp, 0);
cp->flags |= RX_PKTFLAG_TQ;
queue_Append(&call->tq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->tqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
cp = (struct rx_packet *)0;
if (!
(call->
* ReadvProc/WritevProc.
*/
if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
}
* ReadvProc/WritevProc.
*/
if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
}
/* Free any packets from the last call to ReadvProc/WritevProc */
if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
}
}
cp->flags |= RX_PKTFLAG_IOVQ;
queue_Append(&call->iovq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
tnFree = cp->length;
tcurvec = 1;
tcurpos =
int nextio;
int requestCount;
struct rx_queue tmpq;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
u_short tmpqc;
#endif
cp->flags &= ~RX_PKTFLAG_CP;
cp->flags |= RX_PKTFLAG_IOVQ;
queue_Prepend(&call->iovq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
cp = call->currentPacket = (struct rx_packet *)0;
}
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
return 0;
}
* a zero length write will push a short packet. */
nextio = 0;
queue_Init(&tmpq);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
tmpqc = 0;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
do {
if (call->nFree == 0 && cp) {
clock_NewTime(); /* Bogus: need new time package */
hadd32(call->bytesSent, cp->length);
rxi_PrepareSendPacket(call, cp, 0);
queue_Append(&tmpq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
tmpqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
cp = call->currentPacket = (struct rx_packet *)0;
/* The head of the iovq is now the current packet */
if (nbytes) {
if (queue_IsEmpty(&call->iovq)) {
call->error = RX_PROTOCOL_ERROR;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
tmpqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &tmpq);
return 0;
}
cp = queue_First(&call->iovq, rx_packet);
queue_Remove(cp);
cp->flags &= ~RX_PKTFLAG_IOVQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc--;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
cp->flags |= RX_PKTFLAG_CP;
call->currentPacket = cp;
call->nFree = cp->length;
if (cp) {
cp->flags &= ~RX_PKTFLAG_CP;
queue_Prepend(&tmpq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
tmpqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
cp = call->currentPacket = (struct rx_packet *)0;
}
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
tmpqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &tmpq);
return 0;
}
/* Free any packets from the last call to ReadvProc/WritevProc */
if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
rxi_FreePackets(0, &call->iovq);
}
rxi_PrepareSendPacket(call, cp, 1);
cp->flags |= RX_PKTFLAG_TQ;
queue_Append(&call->tq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
call->tqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
if (!
(call->
flags & (RX_CALL_FAST_RECOVER | RX_CALL_FAST_RECOVER_WAIT))) {