windows-down-time-20080205
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 5 Feb 2008 17:10:34 +0000 (17:10 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 5 Feb 2008 17:10:34 +0000 (17:10 +0000)
LICENSE MIT

use clock time instead of osi_Time() for server down time tracking
for proper comparison with expiration times.

src/WINNT/afsd/cm_aclent.c
src/WINNT/afsd/cm_aclent.h
src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_server.c

index 7a14e26..f3b2584 100644 (file)
@@ -78,7 +78,7 @@ long cm_FindACLCache(cm_scache_t *scp, cm_user_t *userp, afs_uint32 *rightsp)
 
     for (aclp = scp->randomACLp; aclp; aclp = aclp->nextp) {
         if (aclp->userp == userp) {
-            if (aclp->tgtLifetime && aclp->tgtLifetime <= osi_Time()) {
+            if (aclp->tgtLifetime && aclp->tgtLifetime <= time(NULL)) {
                 /* ticket expired */
                 osi_QRemoveHT((osi_queue_t **) &cm_data.aclLRUp, (osi_queue_t **) &cm_data.aclLRUEndp, &aclp->q);
                 CleanupACLEnt(aclp);
index 61eaa6b..1116930 100644 (file)
@@ -26,7 +26,7 @@ typedef struct cm_aclent {
     struct cm_scache *backp;   /* back ptr to vnode */
     struct cm_user *userp;     /* user whose access is cached */
     afs_uint32 randomAccess;   /* watch for more rights in acl.h */
-    unsigned long tgtLifetime; /* time this expires */
+    afs_uint32 tgtLifetime;    /* time this expires */
 } cm_aclent_t;
 
 extern osi_rwlock_t cm_aclLock;
index 72602b9..4cea28c 100644 (file)
@@ -1058,7 +1058,7 @@ SRXAFSCB_InitCallBackState3(struct rx_call *callp, afsUUID* serverUuid)
     char *p = NULL;
 
     if (UuidToString((UUID *)serverUuid, &p) == RPC_S_OK) {
-        osi_Log1(afsd_logp, "SRXAFSCB_InitCallBackState3 %s ->",p);
+        osi_Log1(afsd_logp, "SRXAFSCB_InitCallBackState3 %s ->",osi_LogSaveString(afsd_logp,p));
         RpcStringFree(&p);
     } else
         osi_Log0(afsd_logp, "SRXAFSCB_InitCallBackState3 - no server Uuid ->");
@@ -1965,7 +1965,7 @@ cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown)
             lock_ObtainMutex(&tsp->mx);
             if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
                 tsp->flags |= CM_SERVERFLAG_DOWN;
-                tsp->downTime = osi_Time();
+                tsp->downTime = time(NULL);
             }
             cm_ForceNewConnections(tsp);
 
index 425fc0b..7829f23 100644 (file)
@@ -534,7 +534,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
        if (reqp->flags & CM_REQ_NEW_CONN_FORCED) {
             if (!(serverp->flags & CM_SERVERFLAG_DOWN)) {
                 serverp->flags |= CM_SERVERFLAG_DOWN;
-                serverp->downTime = osi_Time();
+                serverp->downTime = time(NULL);
             }
         } else {
            reqp->flags |= CM_REQ_NEW_CONN_FORCED;
index ec3a70b..3ff4db4 100644 (file)
@@ -150,7 +150,7 @@ cm_PingServer(cm_server_t *tsp)
        /* mark server as down */
         if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
             tsp->flags |= CM_SERVERFLAG_DOWN;
-            tsp->downTime = osi_Time();
+            tsp->downTime = time(NULL);
         }
        if (code != VRESTARTING)
            cm_ForceNewConnections(tsp);