]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Look for, and use Event-Timestamp
authorAlan T. DeKok <aland@freeradius.org>
Sun, 19 Dec 2010 11:03:47 +0000 (12:03 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 19 Dec 2010 11:03:47 +0000 (12:03 +0100)
To calculate Acct-Delay-Time

src/main/detail.c

index 5fdb57527489eb1f6980001f11cc746c1c903aa2..f94961e64dfcc1cb8c917d4f3045630e95219811 100644 (file)
@@ -678,6 +678,17 @@ int detail_recv(rad_listen_t *listener,
         */
        packet->vps = paircopy(data->vps);
 
+       /*
+        *      Prefer the Event-Timestamp in the packet, if it
+        *      exists.  That is when the event occurred, whereas the
+        *      "Timestamp" field is when we wrote the packet to the
+        *      detail file, which could have been much later.
+        */
+       vp = pairfind(packet->vps, PW_EVENT_TIMESTAMP);
+       if (vp) {
+               data->timestamp = vp->vp_integer;
+       }
+
        /*
         *      Look for Acct-Delay-Time, and update
         *      based on Acct-Delay-Time += (time(NULL) - timestamp)