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

Comparing ircd-hybrid-8/src/client.c (file contents):
Revision 1240 by michael, Sun Sep 18 09:02:38 2011 UTC vs.
Revision 1241 by michael, Thu Sep 29 20:26:09 2011 UTC

# Line 117 | Line 117 | make_client(struct Client *from)
117  
118    if (from == NULL)
119    {
120 <    client_p->from  = client_p; /* 'from' of local client is self! */
121 <    client_p->since = client_p->lasttime = client_p->firsttime = CurrentTime;
122 <
123 <    client_p->localClient = BlockHeapAlloc(lclient_heap);
120 >    client_p->from                      = client_p; /* 'from' of local client is self! */
121 >    client_p->localClient               = BlockHeapAlloc(lclient_heap);
122 >    client_p->localClient->since        = CurrentTime;
123 >    client_p->localClient->lasttime     = CurrentTime;
124 >    client_p->localClient->firsttime    = CurrentTime;
125      client_p->localClient->registration = REG_INIT;
126 +
127      /* as good a place as any... */
128      dlinkAdd(client_p, &client_p->localClient->lclient_node, &unknown_list);
129    }
# Line 257 | Line 259 | check_pings_list(dlink_list *list)
259      else
260        ping = get_client_ping(client_p, &pingwarn);
261  
262 <    if (ping < CurrentTime - client_p->lasttime)
262 >    if (ping < CurrentTime - client_p->localClient->lasttime)
263      {
264        if (!IsPingSent(client_p))
265        {
# Line 268 | Line 270 | check_pings_list(dlink_list *list)
270           */
271          SetPingSent(client_p);
272          ClearPingWarning(client_p);
273 <        client_p->lasttime = CurrentTime - ping;
273 >        client_p->localClient->lasttime = CurrentTime - ping;
274          sendto_one(client_p, "PING :%s", ID_or_name(&me, client_p));
275        }
276        else
277        {
278 <        if (CurrentTime - client_p->lasttime >= 2 * ping)
278 >        if (CurrentTime - client_p->localClient->lasttime >= 2 * ping)
279          {
280            /*
281             * If the client/server hasn't talked to us in 2*ping seconds
# Line 292 | Line 294 | check_pings_list(dlink_list *list)
294            }
295  
296            snprintf(scratch, sizeof(scratch), "Ping timeout: %d seconds",
297 <                   (int)(CurrentTime - client_p->lasttime));
297 >                   (int)(CurrentTime - client_p->localClient->lasttime));
298            exit_client(client_p, &me, scratch);
299          }
300          else if (!IsPingWarning(client_p) && pingwarn > 0 &&
301                   (IsServer(client_p) || IsHandshake(client_p)) &&
302 <                 CurrentTime - client_p->lasttime >= ping + pingwarn)
302 >                 CurrentTime - client_p->localClient->lasttime >= ping + pingwarn)
303          {
304            /*
305             * If the server hasn't replied in pingwarn seconds after sending
# Line 344 | Line 346 | check_unknowns_list(void)
346       * Check UNKNOWN connections - if they have been in this state
347       * for > 30s, close them.
348       */
349 <    if (IsAuthFinished(client_p) && (CurrentTime - client_p->firsttime) > 30)
349 >    if (IsAuthFinished(client_p) && (CurrentTime - client_p->localClient->firsttime) > 30)
350        exit_client(client_p, &me, "Registration timed out");
351    }
352   }
# Line 1002 | Line 1004 | exit_client(struct Client *source_p, str
1004      {
1005        sendto_realops_flags(UMODE_ALL, L_ALL,
1006                             "%s was connected for %d seconds.  %llu/%llu sendK/recvK.",
1007 <                           source_p->name, (int)(CurrentTime - source_p->firsttime),
1007 >                           source_p->name, (int)(CurrentTime - source_p->localClient->firsttime),
1008                             source_p->localClient->send.bytes >> 10,
1009                             source_p->localClient->recv.bytes >> 10);
1010        ilog(L_NOTICE, "%s was connected for %d seconds.  %llu/%llu sendK/recvK.",
1011 <           source_p->name, (int)(CurrentTime - source_p->firsttime),
1011 >           source_p->name, (int)(CurrentTime - source_p->localClient->firsttime),
1012             source_p->localClient->send.bytes >> 10,
1013             source_p->localClient->recv.bytes >> 10);
1014      }
# Line 1074 | Line 1076 | dead_link_on_read(struct Client *client_
1076  
1077    if (IsServer(client_p) || IsHandshake(client_p))
1078    {
1079 <    int connected = CurrentTime - client_p->firsttime;
1079 >    int connected = CurrentTime - client_p->localClient->firsttime;
1080        
1081      if (error == 0)
1082      {

Diff Legend

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