diff options
author | nelsonb%netscape.com <devnull@localhost> | 2001-06-09 03:20:13 +0000 |
---|---|---|
committer | nelsonb%netscape.com <devnull@localhost> | 2001-06-09 03:20:13 +0000 |
commit | e377487941df8ca1ec69da1735efbeaa8ecd2082 (patch) | |
tree | 3635e4b328b277498cb96c32749a041f3acd234e /security/nss | |
parent | 1043d7d06ef17e12ef0e00225dc0a89d28288ee8 (diff) | |
download | nss-hg-e377487941df8ca1ec69da1735efbeaa8ecd2082.tar.gz |
Change ssl_Time() to use time() instead of PR_Now on systems that have it.
Diffstat (limited to 'security/nss')
-rw-r--r-- | security/nss/lib/ssl/sslnonce.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/security/nss/lib/ssl/sslnonce.c b/security/nss/lib/ssl/sslnonce.c index 79e6c24c8..4a32012e1 100644 --- a/security/nss/lib/ssl/sslnonce.c +++ b/security/nss/lib/ssl/sslnonce.c @@ -44,7 +44,9 @@ #include "sslproto.h" #include "nssilock.h" #include "nsslocks.h" - +#if defined(XP_UNIX) || defined(XP_WIN) || defined(_WINDOWS) +#include <time.h> +#endif PRUint32 ssl_sid_timeout = 100; PRUint32 ssl3_sid_timeout = 86400L; /* 24 hours */ @@ -337,14 +339,19 @@ SSL_ClearSessionCache(void) PRUint32 ssl_Time(void) { + PRUint32 myTime; +#if defined(XP_UNIX) || defined(XP_WIN) || defined(_WINDOWS) + myTime = time(NULL); /* accurate until the year 2038. */ +#else + /* portable, but possibly slower */ PRTime now; PRInt64 ll; - PRUint32 time; now = PR_Now(); LL_I2L(ll, 1000000L); LL_DIV(now, now, ll); - LL_L2UI(time, now); - return time; + LL_L2UI(myTime, now); +#endif + return myTime; } |