idle dead time track less
authorDerrick Brashear <shadow@dementia.org>
Thu, 10 Jun 2010 15:34:39 +0000 (11:34 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 14 Jun 2010 03:07:47 +0000 (20:07 -0700)
retransmits don't count as sends for idle "send time" purposes.
neither do ping acks. disallow both in computations.

Change-Id: I599bb1111189efd21580d357c31c043f2315f910
Reviewed-on: http://gerrit.openafs.org/2112
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/rx/rx.c

index 407b03c..1f31048 100644 (file)
@@ -5299,7 +5299,10 @@ rxi_SendList(struct rx_call *call, struct rx_packet **list, int len,
     /* Update last send time for this call (for keep-alive
      * processing), and for the connection (so that we can discover
      * idle connections) */
-    call->lastSendData = conn->lastSendTime = call->lastSendTime = clock_Sec();
+    conn->lastSendTime = call->lastSendTime = clock_Sec();
+    /* Let a set of retransmits trigger an idle timeout */
+    if (!resending)
+       call->lastSendData = call->lastSendTime;
 }
 
 /* When sending packets we need to follow these rules:
@@ -5791,8 +5794,11 @@ rxi_Send(struct rx_call *call, struct rx_packet *p,
      * processing), and for the connection (so that we can discover
      * idle connections) */
     conn->lastSendTime = call->lastSendTime = clock_Sec();
-    /* Don't count keepalives here, so idleness can be tracked. */
-    if ((p->header.type != RX_PACKET_TYPE_ACK) || (((struct rx_ackPacket *)rx_DataOf(p))->reason != RX_ACK_PING))
+    /* Don't count keepalive ping/acks here, so idleness can be tracked. */
+    if ((p->header.type != RX_PACKET_TYPE_ACK) ||
+       ((((struct rx_ackPacket *)rx_DataOf(p))->reason != RX_ACK_PING) &&
+        (((struct rx_ackPacket *)rx_DataOf(p))->reason !=
+         RX_ACK_PING_RESPONSE)))
        call->lastSendData = call->lastSendTime;
 }