|
|
@ -1132,16 +1132,15 @@ static int cache_lookup_internal(time_t now, struct dundi_request *req, char *ke
|
|
|
|
int expiration;
|
|
|
|
int expiration;
|
|
|
|
char fs[256];
|
|
|
|
char fs[256];
|
|
|
|
time_t timeout;
|
|
|
|
time_t timeout;
|
|
|
|
unsigned int x;
|
|
|
|
|
|
|
|
/* Build request string */
|
|
|
|
/* Build request string */
|
|
|
|
if (!ast_db_get("dundi/cache", key, data, sizeof(data))) {
|
|
|
|
if (!ast_db_get("dundi/cache", key, data, sizeof(data))) {
|
|
|
|
ptr = data;
|
|
|
|
ptr = data;
|
|
|
|
if (sscanf(ptr, "%d|%n", (int *)&x, &length) == 1) {
|
|
|
|
if (!ast_get_time_t(ptr, &timeout, 0, &length)) {
|
|
|
|
timeout = x;
|
|
|
|
|
|
|
|
expiration = timeout - now;
|
|
|
|
expiration = timeout - now;
|
|
|
|
if (expiration > 0) {
|
|
|
|
if (expiration > 0) {
|
|
|
|
ast_log(LOG_DEBUG, "Found cache expiring in %d seconds!\n", (int)(timeout - now));
|
|
|
|
ast_log(LOG_DEBUG, "Found cache expiring in %d seconds!\n", (int)(timeout - now));
|
|
|
|
ptr += length;
|
|
|
|
ptr += length + 1;
|
|
|
|
while((sscanf(ptr, "%d/%d/%d/%n", &(flags.flags), &weight, &tech, &length) == 3)) {
|
|
|
|
while((sscanf(ptr, "%d/%d/%d/%n", &(flags.flags), &weight, &tech, &length) == 3)) {
|
|
|
|
ptr += length;
|
|
|
|
ptr += length;
|
|
|
|
term = strchr(ptr, '|');
|
|
|
|
term = strchr(ptr, '|');
|
|
|
@ -2030,11 +2029,9 @@ static void load_password(void)
|
|
|
|
char *last=NULL;
|
|
|
|
char *last=NULL;
|
|
|
|
char tmp[256];
|
|
|
|
char tmp[256];
|
|
|
|
time_t expired;
|
|
|
|
time_t expired;
|
|
|
|
unsigned int x;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ast_db_get(secretpath, "secretexpiry", tmp, sizeof(tmp));
|
|
|
|
ast_db_get(secretpath, "secretexpiry", tmp, sizeof(tmp));
|
|
|
|
if (sscanf(tmp, "%d", (int *)&x) == 1) {
|
|
|
|
if (!ast_get_time_t(tmp, &expired, 0, NULL)) {
|
|
|
|
expired = x;
|
|
|
|
|
|
|
|
ast_db_get(secretpath, "secret", tmp, sizeof(tmp));
|
|
|
|
ast_db_get(secretpath, "secret", tmp, sizeof(tmp));
|
|
|
|
current = strchr(tmp, ';');
|
|
|
|
current = strchr(tmp, ';');
|
|
|
|
if (!current)
|
|
|
|
if (!current)
|
|
|
|