Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mod_verto] use SWITCH_TIME_T_FMT #2721

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/mod/endpoints/mod_verto/mod_verto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
} else {
switch_xml_t x_param, x_params;
const char *use_passwd = NULL, *verto_context = NULL, *verto_dialplan = NULL;
time_t now = switch_epoch_time_now(NULL);
switch_time_t now = switch_epoch_time_now(NULL);

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

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

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

if (tmp > now) {
jsock->exptime = tmp;
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);
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);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid expire time for %s. Defaulting to 300 sec\n", jsock->uid);
jsock->exptime = now + 300;
Expand Down Expand Up @@ -1994,7 +1994,7 @@ static void client_run(jsock_t *jsock)

while(jsock->profile->running) {
int pflags, poll_time = 50;
time_t now;
switch_time_t now;

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

Expand All @@ -2005,9 +2005,8 @@ static void client_run(jsock_t *jsock)

if (now >= jsock->exptime) {
switch_set_flag(jsock, JPFLAG_AUTH_EXPIRED);
die("%s Authentication Expired [%ld] >= [%ld]\n", jsock->uid, now, jsock->exptime);
die("%s Authentication Expired [%" SWITCH_TIME_T_FMT "] >= [%" SWITCH_TIME_T_FMT "]\n", jsock->uid, now, jsock->exptime);
}

}

if (jsock->drop) { die("%s Dropping Connection\n", jsock->name); }
Expand Down
6 changes: 3 additions & 3 deletions src/mod/endpoints/mod_verto/mod_verto.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ struct jsock_s {
char remote_host[256];
int remote_port;
int family;
time_t exptime;
time_t logintime;
switch_time_t exptime;
switch_time_t logintime;
struct verto_profile_s *profile;
switch_thread_rwlock_t *rwlock;

Expand Down Expand Up @@ -191,7 +191,7 @@ typedef struct verto_pvt_s {
switch_media_handle_t *smh;
switch_core_media_params_t *mparams;
switch_call_cause_t remote_hangup_cause;
time_t detach_time;
switch_time_t detach_time;
struct verto_pvt_s *next;
switch_byte_t text_read_frame_data[SWITCH_RTP_MAX_BUF_LEN];
switch_frame_t text_read_frame;
Expand Down
Loading