X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fircd.c;h=ad6ae5fb5f9699e4f7e521575496efa005eb9e8a;hb=7cbbc6aa8338d394d79cb7048438dd45adf5c648;hp=f5f0eeb54d513403c0885f549129d52cb851895c;hpb=dfd1ba1a12e57ef10ee82d1e13f45ea5b7fb9c0f;p=ircu2.10.12-pk.git diff --git a/ircd/ircd.c b/ircd/ircd.c index f5f0eeb..ad6ae5f 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -339,7 +339,19 @@ static void check_pings(struct Event* ev) { if (!cptr) continue; - + + /* We don't need to check zombies here */ + if (IsNotConn(cptr)) { + assert(IsUser(cptr)); + /* for now: reap after fixed time (5 minutes) */ + if ((CurrentTime - cli_user(cptr)->last) >= 300) { + SetFlag(cptr, FLAG_DEADSOCKET); + /* this will be used as exit message */ + ircd_strncpy(cli_info(cptr), "Ping timeout", REALLEN); + } else + continue; + } + assert(&me != cptr); /* I should never be in the local client array! */ @@ -420,6 +432,14 @@ static void check_pings(struct Event* ev) { sendto_opmask_butone(0, SNO_OLDSNO, "No response from %s, closing link", cli_name(cptr)); + /* + * Keep client structure around when a user pings out, so that they can + * reconnect to it later + */ + if (IsUser(cptr) && IsAccount(cptr)) { + zombie_client(&me, &me, cptr); + continue; + } exit_client_msg(cptr, cptr, &me, "Ping timeout"); continue; }