Skip to content

Commit b228bb0

Browse files
committed
[mod_verto] use SWITCH_TIME_T_FMT
1 parent e343b47 commit b228bb0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/mod/endpoints/mod_verto/mod_verto.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
10621062
} else {
10631063
switch_xml_t x_param, x_params;
10641064
const char *use_passwd = NULL, *verto_context = NULL, *verto_dialplan = NULL;
1065-
time_t now = switch_epoch_time_now(NULL);
1065+
switch_time_t now = switch_epoch_time_now(NULL);
10661066

10671067
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Login sucessful for user: %s domain: %s\n", id, domain);
10681068

@@ -1117,11 +1117,11 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
11171117
switch_clear_flag(jsock, JPFLAG_AUTH_EXPIRED);
11181118

11191119
if (!strcmp(var, "login-expires")) {
1120-
uint32_t tmp = atol(val);
1120+
switch_time_t tmp = atol(val);
11211121

11221122
if (tmp > now) {
11231123
jsock->exptime = tmp;
1124-
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Login expire time for %s set to %ld seconds [%ld] [%ld]\n", jsock->uid, tmp - now, jsock->exptime, now);
1124+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Login expire time for %s set to %" SWITCH_TIME_T_FMT " seconds [%" SWITCH_TIME_T_FMT "] [%" SWITCH_TIME_T_FMT "]\n", jsock->uid, tmp - now, jsock->exptime, now);
11251125
} else {
11261126
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid expire time for %s. Defaulting to 300 sec\n", jsock->uid);
11271127
jsock->exptime = now + 300;
@@ -2005,9 +2005,8 @@ static void client_run(jsock_t *jsock)
20052005

20062006
if (now >= jsock->exptime) {
20072007
switch_set_flag(jsock, JPFLAG_AUTH_EXPIRED);
2008-
die("%s Authentication Expired [%ld] >= [%ld]\n", jsock->uid, now, jsock->exptime);
2008+
die("%s Authentication Expired [%" SWITCH_TIME_T_FMT "] >= [%" SWITCH_TIME_T_FMT "]\n", jsock->uid, now, jsock->exptime);
20092009
}
2010-
20112010
}
20122011

20132012
if (jsock->drop) { die("%s Dropping Connection\n", jsock->name); }

0 commit comments

Comments
 (0)