Rewrite timeout computation in a way that is less prone to overflow.
(Problem reported by Peter Sylvester.)
This commit is contained in:
parent
68b64fb610
commit
7476f3ac3b
@ -389,7 +389,7 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len)
|
|||||||
CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION);
|
CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((long)(ret->time+ret->timeout) < (long)time(NULL)) /* timeout */
|
if (ret->timeout < (long)(time(NULL) - ret->time)) /* timeout */
|
||||||
{
|
{
|
||||||
s->ctx->stats.sess_timeout++;
|
s->ctx->stats.sess_timeout++;
|
||||||
/* remove it from the cache */
|
/* remove it from the cache */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user