Skip to content

Commit f0ab438

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

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/mod/endpoints/mod_verto/mod_verto.c

+5-6
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;
@@ -1994,7 +1994,7 @@ static void client_run(jsock_t *jsock)
19941994

19951995
while(jsock->profile->running) {
19961996
int pflags, poll_time = 50;
1997-
time_t now;
1997+
switch_time_t now;
19981998

19991999
if (!jsock->ws) { die("%s Setup Error\n", jsock->name); }
20002000

@@ -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); }

src/mod/endpoints/mod_verto/mod_verto.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ struct jsock_s {
141141
char remote_host[256];
142142
int remote_port;
143143
int family;
144-
time_t exptime;
145-
time_t logintime;
144+
switch_time_t exptime;
145+
switch_time_t logintime;
146146
struct verto_profile_s *profile;
147147
switch_thread_rwlock_t *rwlock;
148148

@@ -191,7 +191,7 @@ typedef struct verto_pvt_s {
191191
switch_media_handle_t *smh;
192192
switch_core_media_params_t *mparams;
193193
switch_call_cause_t remote_hangup_cause;
194-
time_t detach_time;
194+
switch_time_t detach_time;
195195
struct verto_pvt_s *next;
196196
switch_byte_t text_read_frame_data[SWITCH_RTP_MAX_BUF_LEN];
197197
switch_frame_t text_read_frame;

0 commit comments

Comments
 (0)