From e94d4a0a9572f08fc13afe5eaae04dffc8563172 Mon Sep 17 00:00:00 2001 From: "nelsonb%netscape.com" Date: Sat, 9 Jun 2001 03:20:13 +0000 Subject: [PATCH] Change ssl_Time() to use time() instead of PR_Now on systems that have it. git-svn-id: svn://10.0.0.236/trunk@96769 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/security/nss/lib/ssl/sslnonce.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/mozilla/security/nss/lib/ssl/sslnonce.c b/mozilla/security/nss/lib/ssl/sslnonce.c index 852ad103d25..00b563516b1 100644 --- a/mozilla/security/nss/lib/ssl/sslnonce.c +++ b/mozilla/security/nss/lib/ssl/sslnonce.c @@ -32,7 +32,7 @@ * may use your version of this file under either the MPL or the * GPL. * - * $Id: sslnonce.c,v 1.6 2001-01-30 21:02:24 wtc%netscape.com Exp $ + * $Id: sslnonce.c,v 1.7 2001-06-09 03:20:13 nelsonb%netscape.com Exp $ */ #include "nssrenam.h" @@ -44,7 +44,9 @@ #include "sslproto.h" #include "nssilock.h" #include "nsslocks.h" - +#if defined(XP_UNIX) || defined(XP_WIN) || defined(_WINDOWS) +#include +#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; }