| 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 |
|
} |
| 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 |
|
{ |
| 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 |
| 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 |
| 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 |
|
} |
| 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 |
|
} |
| 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 |
|
{ |