]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-rx-clear-queues-correctly-20080925
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 25 Sep 2008 18:21:33 +0000 (18:21 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 25 Sep 2008 18:21:33 +0000 (18:21 +0000)
LICENSE IPL10

don't potentially leak packets by leaving them behind and initing queues;
in fact, if you are cleaning up there is no need to init queues anyway.

(cherry picked from commit a72eea6bb1758678d25528cd1ab9b439ade2f844)

src/rx/rx.c

index 6e032d307ec54db2cd1511b5b4220b2266441ed5..b4b9083b367d9a797a126e7a84b3c55922a16fc2 100644 (file)
@@ -1221,7 +1221,7 @@ rx_NewCall(register struct rx_connection *conn)
     MUTEX_ENTER(&call->lock);
     rxi_WaitforTQBusy(call);
     if (call->flags & RX_CALL_TQ_CLEARME) {
-       rxi_ClearTransmitQueue(call, 0);
+       rxi_ClearTransmitQueue(call, 1);
        queue_Init(&call->tq);
     }
     MUTEX_EXIT(&call->lock);
@@ -2173,7 +2173,7 @@ rxi_NewCall(register struct rx_connection *conn, register int channel)
 #ifdef AFS_GLOBAL_RXLOCK_KERNEL
        /* Now, if TQ wasn't cleared earlier, do it now. */
        if (call->flags & RX_CALL_TQ_CLEARME) {
-           rxi_ClearTransmitQueue(call, 0);
+           rxi_ClearTransmitQueue(call, 1);
            queue_Init(&call->tq);
        }
 #endif /* AFS_GLOBAL_RXLOCK_KERNEL */
@@ -4576,7 +4576,6 @@ rxi_ResetCall(register struct rx_call *call, register int newcall)
     MUTEX_EXIT(&peer->peer_lock);
 
     flags = call->flags;
-    rxi_ClearReceiveQueue(call);
 #ifdef AFS_GLOBAL_RXLOCK_KERNEL
     if (flags & RX_CALL_TQ_BUSY) {
        call->flags = RX_CALL_TQ_CLEARME | RX_CALL_TQ_BUSY;
@@ -4584,8 +4583,8 @@ rxi_ResetCall(register struct rx_call *call, register int newcall)
     } else
 #endif /* AFS_GLOBAL_RXLOCK_KERNEL */
     {
-       rxi_ClearTransmitQueue(call, 0);
-       queue_Init(&call->tq);
+       rxi_ClearTransmitQueue(call, 1);
+       /* why init the queue if you just emptied it? queue_Init(&call->tq); */
        if (call->tqWaiters || (flags & RX_CALL_TQ_WAIT)) {
            dpf(("rcall %x has %d waiters and flags %d\n", call, call->tqWaiters, call->flags));
        }
@@ -4599,7 +4598,9 @@ rxi_ResetCall(register struct rx_call *call, register int newcall)
            call->tqWaiters--;
        }
     }
-    queue_Init(&call->rq);
+
+    rxi_ClearReceiveQueue(call);
+    /* why init the queue if you just emptied it? queue_Init(&call->rq); */
     call->error = 0;
     call->twind = call->conn->twind[call->channel];
     call->rwind = call->conn->rwind[call->channel];