Added autoping timeout preference
This commit is contained in:
@@ -202,7 +202,7 @@ jabber_connect_with_details(const char *const jid, const char *const passwd, con
|
||||
}
|
||||
|
||||
void
|
||||
jabber_ping_fail(void)
|
||||
jabber_autoping_fail(void)
|
||||
{
|
||||
if (jabber_conn.conn_status == JABBER_CONNECTED) {
|
||||
log_info("Closing connection");
|
||||
|
||||
@@ -139,10 +139,11 @@ iq_autoping_check(void)
|
||||
|
||||
gdouble elapsed = g_timer_elapsed(autoping_time, NULL);
|
||||
unsigned long seconds_elapsed = elapsed * 1.0;
|
||||
log_debug("Autoping check: waiting, %u", seconds_elapsed);
|
||||
if (seconds_elapsed > 5) {
|
||||
// disconnect
|
||||
jabber_ping_fail();
|
||||
gint timeout = prefs_get_autoping_timeout();
|
||||
if (timeout > 0 && seconds_elapsed >= timeout) {
|
||||
cons_show("Autoping response timed out afer %u seconds.", timeout);
|
||||
log_debug("Autoping check: timed out afer %u seconds, disconnecting", timeout);
|
||||
jabber_autoping_fail();
|
||||
autoping_wait = FALSE;
|
||||
g_timer_destroy(autoping_time);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ jabber_conn_status_t jabber_connect_with_details(const char *const jid, const ch
|
||||
jabber_conn_status_t jabber_connect_with_account(const ProfAccount *const account);
|
||||
void jabber_disconnect(void);
|
||||
void jabber_shutdown(void);
|
||||
void jabber_ping_fail(void);
|
||||
void jabber_autoping_fail(void);
|
||||
void jabber_process_events(int millis);
|
||||
const char* jabber_get_fulljid(void);
|
||||
const char* jabber_get_domain(void);
|
||||
|
||||
Reference in New Issue
Block a user