2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[3673] The time conversion method in PgSQL calculates expiry time itself.

This is to prevent the negative overflows when valid_lft is substracted
from the time_t value. It is also consistent with the MySQL implementation.
This commit is contained in:
Marcin Siodelski
2015-03-04 16:19:36 +01:00
parent 7cc08e462c
commit ccf7e110c2
3 changed files with 29 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -423,8 +423,11 @@ public:
/// @param valid_lifetime Valid lifetime
/// @param expire Reference to MYSQL_TIME object where the expiry time of
/// the lease will be put.
///
/// @throw isc::BadValue if the sum of the calculated expiration time is
/// greater than the value of @c LeaseMgr::MAX_DB_TIME.
static
void convertToDatabaseTime(time_t cltt, uint32_t valid_lifetime,
void convertToDatabaseTime(const time_t cltt, const uint32_t valid_lifetime,
MYSQL_TIME& expire);
/// @brief Convert Database Time to Lease Times