Changeset b958cb5
- Timestamp:
- 2012-02-26T09:20:30Z (13 years ago)
- Branches:
- master
- Children:
- e371011
- Parents:
- 441a67e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r441a67e rb958cb5 858 858 static gboolean irc_userping( gpointer _irc, gint fd, b_input_condition cond ) 859 859 { 860 double now = gettime(); 860 861 irc_t *irc = _irc; 861 int rv= 0;862 int fail = 0; 862 863 863 864 if( !( irc->status & USTATUS_LOGGED_IN ) ) 864 865 { 865 if( gettime()> ( irc->last_pong + IRC_LOGIN_TIMEOUT ) )866 rv = gettime()- irc->last_pong;866 if( now > ( irc->last_pong + IRC_LOGIN_TIMEOUT ) ) 867 fail = now - irc->last_pong; 867 868 } 868 869 else 869 870 { 870 if( ( gettime() > ( irc->last_pong + global.conf->ping_interval ) ) && !irc->pinging ) 871 if( now > ( irc->last_pong + global.conf->ping_timeout ) ) 872 { 873 fail = now - irc->last_pong; 874 } 875 else 871 876 { 872 877 irc_write( irc, "PING :%s", IRC_PING_STRING ); 873 irc->pinging = 1; 874 } 875 else if( gettime() > ( irc->last_pong + global.conf->ping_timeout ) ) 876 { 877 rv = gettime() - irc->last_pong; 878 } 879 } 880 881 if( rv > 0 ) 882 { 883 irc_abort( irc, 0, "Ping Timeout: %d seconds", rv ); 878 } 879 } 880 881 if( fail > 0 ) 882 { 883 irc_abort( irc, 0, "Ping Timeout: %d seconds", fail ); 884 884 return FALSE; 885 885 }
Note: See TracChangeset
for help on using the changeset viewer.