You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by ma...@apache.org on 2006/04/14 20:02:00 UTC
svn commit: r394155 - in /apr/apr-util/branches/1.2.x: CHANGES
crypto/getuuid.c
Author: maxb
Date: Fri Apr 14 11:01:58 2006
New Revision: 394155
URL: http://svn.apache.org/viewcvs?rev=394155&view=rev
Log:
Backport 383681, 383689
*) Fix incorrect byte order (PR 37342) and incorrect timestamp type
in the fallback UUID generator used when no external UUID generator
is detected by APR.
Modified:
apr/apr-util/branches/1.2.x/CHANGES
apr/apr-util/branches/1.2.x/crypto/getuuid.c
Modified: apr/apr-util/branches/1.2.x/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr-util/branches/1.2.x/CHANGES?rev=394155&r1=394154&r2=394155&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/CHANGES (original)
+++ apr/apr-util/branches/1.2.x/CHANGES Fri Apr 14 11:01:58 2006
@@ -1,6 +1,9 @@
Changes with APR-util 1.2.8
-
+ *) Fix incorrect byte order (PR 37342) and incorrect timestamp type
+ in the fallback UUID generator used when no external UUID generator
+ is detected by APR.
+ [Max Bowsher]
Changes with APR-util 1.2.7
Modified: apr/apr-util/branches/1.2.x/crypto/getuuid.c
URL: http://svn.apache.org/viewcvs/apr/apr-util/branches/1.2.x/crypto/getuuid.c?rev=394155&r1=394154&r2=394155&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/crypto/getuuid.c (original)
+++ apr/apr-util/branches/1.2.x/crypto/getuuid.c Fri Apr 14 11:01:58 2006
@@ -147,11 +147,11 @@
{
/* ### this needs to be made thread-safe! */
- apr_time_t time_now;
- static apr_interval_time_t time_last = 0;
- static apr_interval_time_t fudge = 0;
+ apr_uint64_t time_now;
+ static apr_uint64_t time_last = 0;
+ static apr_uint64_t fudge = 0;
- time_now = apr_time_now();
+ get_system_time(&time_now);
/* if clock reading changed since last UUID generated... */
if (time_last != time_now) {
@@ -188,17 +188,21 @@
get_current_time(×tamp);
- d[0] = (unsigned char)timestamp;
- d[1] = (unsigned char)(timestamp >> 8);
- d[2] = (unsigned char)(timestamp >> 16);
- d[3] = (unsigned char)(timestamp >> 24);
- d[4] = (unsigned char)(timestamp >> 32);
- d[5] = (unsigned char)(timestamp >> 40);
- d[6] = (unsigned char)(timestamp >> 48);
- d[7] = (unsigned char)(((timestamp >> 56) & 0x0F) | 0x10);
-
+ /* time_low, uint32 */
+ d[3] = (unsigned char)timestamp;
+ d[2] = (unsigned char)(timestamp >> 8);
+ d[1] = (unsigned char)(timestamp >> 16);
+ d[0] = (unsigned char)(timestamp >> 24);
+ /* time_mid, uint16 */
+ d[5] = (unsigned char)(timestamp >> 32);
+ d[4] = (unsigned char)(timestamp >> 40);
+ /* time_hi_and_version, uint16 */
+ d[7] = (unsigned char)(timestamp >> 48);
+ d[6] = (unsigned char)(((timestamp >> 56) & 0x0F) | 0x10);
+ /* clock_seq_hi_and_reserved, uint8 */
d[8] = (unsigned char)(((uuid_state_seqnum >> 8) & 0x3F) | 0x80);
+ /* clock_seq_low, uint8 */
d[9] = (unsigned char)uuid_state_seqnum;
-
+ /* node, byte[6] */
memcpy(&d[10], uuid_state_node, NODE_LENGTH);
}