X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=blobdiff_plain;f=ircd%2Fircd.c;fp=ircd%2Fircd.c;h=91ab9b41f6d5de57e42b85ce7153e62713039b5f;hp=f5f0eeb54d513403c0885f549129d52cb851895c;hb=5fc729d47823a57c8e6e0e3b078522eccd120ca7;hpb=98c74ba6a77e8f110f03252eead8cd37e7ecc83e diff --git a/ircd/ircd.c b/ircd/ircd.c index f5f0eeb..91ab9b4 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 (15 minutes) */ + if ((CurrentTime - cli_user(cptr)->last) >= 900) { + 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; }