ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/client.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/client.c (file contents):
Revision 8907 by michael, Sun Apr 21 21:17:44 2019 UTC vs.
Revision 8919 by michael, Mon Apr 22 09:52:53 2019 UTC

# Line 90 | Line 90 | client_make(struct Client *from)
90    {
91      client_p->from = client_p;  /* 'from' of local client is self! */
92      client_p->connection = xcalloc(sizeof(*client_p->connection));
93 <    client_p->connection->since = CurrentTime;
94 <    client_p->connection->lasttime = CurrentTime;
95 <    client_p->connection->firsttime = CurrentTime;
93 >    client_p->connection->last_data = event_base->time.sec_monotonic;
94 >    client_p->connection->last_ping = event_base->time.sec_monotonic;
95 >    client_p->connection->created_real = event_base->time.sec_real;
96 >    client_p->connection->created_monotonic = event_base->time.sec_monotonic;
97      client_p->connection->registration = REG_INIT;
98  
99      /* as good a place as any... */
# Line 214 | Line 215 | check_pings_list(dlink_list *list)
215        continue;  /* Ignore it, it's been exited already */
216  
217      unsigned int ping = get_client_ping(&client_p->connection->confs);
218 <    if (ping < CurrentTime - client_p->connection->lasttime)
218 >    if (ping < event_base->time.sec_monotonic - client_p->connection->last_ping)
219      {
220        if (!HasFlag(client_p, FLAGS_PINGSENT))
221        {
# Line 224 | Line 225 | check_pings_list(dlink_list *list)
225           * it is still alive.
226           */
227          AddFlag(client_p, FLAGS_PINGSENT);
228 <        client_p->connection->lasttime = CurrentTime - ping;
228 >        client_p->connection->last_ping = event_base->time.sec_monotonic - ping;
229          sendto_one(client_p, "PING :%s", ID_or_name(&me, client_p));
230        }
231        else
232        {
233 <        if (CurrentTime - client_p->connection->lasttime >= 2 * ping)
233 >        if (event_base->time.sec_monotonic - client_p->connection->last_ping >= 2 * ping)
234          {
235            /*
236             * If the client/server hasn't talked to us in 2*ping seconds
# Line 248 | Line 249 | check_pings_list(dlink_list *list)
249            }
250  
251            snprintf(buf, sizeof(buf), "Ping timeout: %ji seconds",
252 <                   (CurrentTime - client_p->connection->lasttime));
252 >                   (event_base->time.sec_monotonic - client_p->connection->last_ping));
253            exit_client(client_p, buf);
254          }
255        }
# Line 276 | Line 277 | check_unknowns_list(void)
277       * Check UNKNOWN connections - if they have been in this state
278       * for > 30s, close them.
279       */
280 <    if ((CurrentTime - client_p->connection->firsttime) <= 30)
280 >    if ((event_base->time.sec_monotonic - client_p->connection->created_monotonic) <= 30)
281        continue;
282  
283      if (IsHandshake(client_p))
# Line 594 | Line 595 | client_close_connection(struct Client *c
595      ++ServerStats.is_cl;
596      ServerStats.is_cbs += client_p->connection->send.bytes;
597      ServerStats.is_cbr += client_p->connection->recv.bytes;
598 <    ServerStats.is_cti += CurrentTime - client_p->connection->firsttime;
598 >    ServerStats.is_cti += event_base->time.sec_monotonic - client_p->connection->created_monotonic;
599    }
600    else if (IsServer(client_p))
601    {
# Line 603 | Line 604 | client_close_connection(struct Client *c
604      ++ServerStats.is_sv;
605      ServerStats.is_sbs += client_p->connection->send.bytes;
606      ServerStats.is_sbr += client_p->connection->recv.bytes;
607 <    ServerStats.is_sti += CurrentTime - client_p->connection->firsttime;
607 >    ServerStats.is_sti += event_base->time.sec_monotonic - client_p->connection->created_monotonic;
608  
609      DLINK_FOREACH(node, connect_items.head)
610      {
# Line 801 | Line 802 | exit_client(struct Client *source_p, con
802                             source_p->sockhost, comment);
803  
804        ilog(LOG_TYPE_USER, "%s (%ju): %s!%s@%s %s %s %ju/%ju :%s",
805 <           date_ctime(source_p->connection->firsttime),
806 <           CurrentTime - source_p->connection->firsttime,
805 >           date_ctime(source_p->connection->created_real),
806 >           event_base->time.sec_monotonic - source_p->connection->created_monotonic,
807             source_p->name, source_p->username, source_p->host,
808             source_p->sockhost, source_p->account,
809             source_p->connection->send.bytes >> 10,
# Line 861 | Line 862 | exit_client(struct Client *source_p, con
862      {
863        sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE,
864                             "%s was connected for %s. %ju/%ju sendK/recvK.",
865 <                           source_p->name, time_dissect(CurrentTime - source_p->connection->firsttime),
865 >                           source_p->name, time_dissect(event_base->time.sec_monotonic - source_p->connection->created_monotonic),
866                             source_p->connection->send.bytes >> 10,
867                             source_p->connection->recv.bytes >> 10);
868        ilog(LOG_TYPE_IRCD, "%s was connected for %s. %ju/%ju sendK/recvK.",
869 <           source_p->name, time_dissect(CurrentTime - source_p->connection->firsttime),
869 >           source_p->name, time_dissect(event_base->time.sec_monotonic - source_p->connection->created_monotonic),
870             source_p->connection->send.bytes >> 10,
871             source_p->connection->recv.bytes >> 10);
872      }
# Line 954 | Line 955 | dead_link_on_read(struct Client *client_
955  
956      sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE,
957                           "%s was connected for %s",
958 <                         client_p->name, time_dissect(CurrentTime - client_p->connection->firsttime));
958 >                         client_p->name, time_dissect(event_base->time.sec_monotonic - client_p->connection->created_monotonic));
959    }
960  
961    if (error == 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)