DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37064>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37064

           Summary: wrong timestamp value in UNIQUE_ID on mod_unique_id in
                    Apache2.0.54
           Product: Apache httpd-2.0
           Version: 2.0.54
          Platform: Other
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_unique_id
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Dear all,

I found the value of timestamp in UNIQUE_ID is always wrong in my environment. 
I decoded the value and confirmed that the value was be completely different 
from real one, it didn't has continuousness for requested time, and it looked 
like random numbers.

The reason comes from the difference from variable type. i.e. the variable 
type of unique_id_rec.stamp is a 'unsigned int' but a type of 
request_rec.request_time is 'apr_time_t', which is apr_int64_t. So, timestamp 
results in the value set mainly microsecond part.

The following change will be needed to use correct timestamp.

307c307
<     new_unique_id.stamp = htonl((unsigned int)r->request_time);
---
>     new_unique_id.stamp = htonl((unsigned int)(r-
>request_time/APR_USEC_PER_SEC));

(*one line respectively*)


Thank you.


**FYI:  'requested_time' is set as follows
--in httpd-2.0.52/srclib/apr/time/unix/time.c---
APR_DECLARE(apr_time_t) apr_time_now(void)
{
    struct timeval tv;
    gettimeofday(&tv, NULL);
    return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec;
}

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to