extern rb_dlink_list global_client_list;
extern struct Client *local[];
extern struct Counter Count;
-#if 0
-extern time_t CurrentTime;
-#endif
extern struct timeval SystemTime;
-#define CurrentTime SystemTime.tv_sec
extern int default_server_capabs;
extern time_t startup_time;
sendto_one(source_p, form_str(ERR_TOOMANYCHANNELS),
me.name, source_p->name, name);
if(successful_join_count)
- source_p->localClient->last_join_time = CurrentTime;
+ source_p->localClient->last_join_time = rb_current_time();
return 0;
}
/* add the user to the channel */
add_user_to_channel(chptr, source_p, flags);
if (chptr->mode.join_num &&
- CurrentTime - chptr->join_delta >= chptr->mode.join_time)
+ rb_current_time() - chptr->join_delta >= chptr->mode.join_time)
{
chptr->join_count = 0;
- chptr->join_delta = CurrentTime;
+ chptr->join_delta = rb_current_time();
}
chptr->join_count++;
/* its a new channel, set +nt and burst. */
if(flags & CHFL_CHANOP)
{
- chptr->channelts = CurrentTime;
+ chptr->channelts = rb_current_time();
chptr->mode.mode |= MODE_TOPICLIMIT;
chptr->mode.mode |= MODE_NOPRIVMSGS;
channel_member_names(chptr, source_p, 1);
if(successful_join_count)
- source_p->localClient->last_join_time = CurrentTime;
+ source_p->localClient->last_join_time = rb_current_time();
hook_info.client = source_p;
hook_info.chptr = chptr;
{
add_user_to_channel(chptr, source_p, CHFL_PEON);
if (chptr->mode.join_num &&
- CurrentTime - chptr->join_delta >= chptr->mode.join_time)
+ rb_current_time() - chptr->join_delta >= chptr->mode.join_time)
{
chptr->join_count = 0;
- chptr->join_delta = CurrentTime;
+ chptr->join_delta = rb_current_time();
}
chptr->join_count++;
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
{
/* idle time shouldnt be reset by notices --fl */
if(p_or_n != NOTICE)
- source_p->localClient->last = CurrentTime;
+ source_p->localClient->last = rb_current_time();
}
if(chptr->mode.mode & MODE_NOCOLOR)
{
/* idletime shouldnt be reset by notice --fl */
if(p_or_n != NOTICE)
- source_p->localClient->last = CurrentTime;
+ source_p->localClient->last = rb_current_time();
}
sendto_channel_flags(client_p, type, source_p, chptr, "%s %c%s :%s",
{
target = ptr->data;
- if(target->expiry < CurrentTime)
+ if(target->expiry < rb_current_time())
{
rb_dlinkDelete(ptr, &tgchange_list);
rb_patricia_remove(tgchange_tree, target->pnode);
*
* XXX: is this controversial?
*/
- if(source_p->localClient->target_last > CurrentTime && IsOper(target_p))
+ if(source_p->localClient->target_last > rb_current_time() && IsOper(target_p))
return 1;
hashv = fnv_hash_upper((const unsigned char *)use_id(target_p), 32);
if(!IsTGChange(source_p))
{
SetTGChange(source_p);
- source_p->localClient->target_last = CurrentTime;
+ source_p->localClient->target_last = rb_current_time();
}
/* clear as many targets as we can */
- else if((i = (CurrentTime - source_p->localClient->target_last) / 60))
+ else if((i = (rb_current_time() - source_p->localClient->target_last) / 60))
{
if(i > USED_TARGETS(source_p))
USED_TARGETS(source_p) = 0;
else
USED_TARGETS(source_p) -= i;
- source_p->localClient->target_last = CurrentTime;
+ source_p->localClient->target_last = rb_current_time();
}
/* cant clear any, full target list */
else if(USED_TARGETS(source_p) == 10)
*/
else
{
- source_p->localClient->target_last = CurrentTime;
+ source_p->localClient->target_last = rb_current_time();
SetTGChange(source_p);
}
/* reset idle time for message only if its not to self
* and its not a notice */
if(p_or_n != NOTICE)
- source_p->localClient->last = CurrentTime;
+ source_p->localClient->last = rb_current_time();
/* target change stuff, dont limit ctcp replies as that
* would allow people to start filling up random users
}
if((target_p->localClient->last_caller_id_time +
- ConfigFileEntry.caller_id_wait) < CurrentTime)
+ ConfigFileEntry.caller_id_wait) < rb_current_time())
{
if(p_or_n != NOTICE)
sendto_one_numeric(source_p, RPL_TARGNOTIFY,
me.name, target_p->name, source_p->name,
source_p->username, source_p->host);
- target_p->localClient->last_caller_id_time = CurrentTime;
+ target_p->localClient->last_caller_id_time = rb_current_time();
}
/* Only so opers can watch for floods */
(void) flood_attack_client(p_or_n, source_p, target_p);
if(GlobalSetOptions.floodcount && MyConnect(target_p) && IsClient(source_p))
{
- if((target_p->localClient->first_received_message_time + 1) < CurrentTime)
+ if((target_p->localClient->first_received_message_time + 1) < rb_current_time())
{
- delta = CurrentTime - target_p->localClient->first_received_message_time;
+ delta = rb_current_time() - target_p->localClient->first_received_message_time;
target_p->localClient->received_number_of_privmsgs -= delta;
- target_p->localClient->first_received_message_time = CurrentTime;
+ target_p->localClient->first_received_message_time = rb_current_time();
if(target_p->localClient->received_number_of_privmsgs <= 0)
{
target_p->localClient->received_number_of_privmsgs = 0;
if(GlobalSetOptions.floodcount && MyClient(source_p))
{
- if((chptr->first_received_message_time + 1) < CurrentTime)
+ if((chptr->first_received_message_time + 1) < rb_current_time())
{
- delta = CurrentTime - chptr->first_received_message_time;
+ delta = rb_current_time() - chptr->first_received_message_time;
chptr->received_number_of_privmsgs -= delta;
- chptr->first_received_message_time = CurrentTime;
+ chptr->first_received_message_time = rb_current_time();
if(chptr->received_number_of_privmsgs <= 0)
{
chptr->received_number_of_privmsgs = 0;
char note[NICKLEN + 10];
/* This had to be copied here to avoid problems.. */
- source_p->tsinfo = CurrentTime;
+ source_p->tsinfo = rb_current_time();
if(source_p->name[0])
del_from_client_hash(source_p->name, source_p);
nick, chptr->chname);
return;
}
- if((source_p->localClient->last_nick_change + ConfigFileEntry.max_nick_time) < CurrentTime)
+ if((source_p->localClient->last_nick_change + ConfigFileEntry.max_nick_time) < rb_current_time())
source_p->localClient->number_of_nick_changes = 0;
- source_p->localClient->last_nick_change = CurrentTime;
+ source_p->localClient->last_nick_change = rb_current_time();
source_p->localClient->number_of_nick_changes++;
if(ConfigFileEntry.anti_nick_flood && !IsOper(source_p) &&
if(!samenick)
{
/* force the TS to increase -- jilles */
- if (source_p->tsinfo >= CurrentTime)
+ if (source_p->tsinfo >= rb_current_time())
source_p->tsinfo++;
else
- source_p->tsinfo = CurrentTime;
+ source_p->tsinfo = rb_current_time();
monitor_signoff(source_p);
/* we only do bancache for local users -- jilles */
if(source_p->user)
/* client changing their nick - dont reset ts if its same */
if(!samenick)
{
- source_p->tsinfo = newts ? newts : CurrentTime;
+ source_p->tsinfo = newts ? newts : rb_current_time();
monitor_signoff(source_p);
}
if(reason[0] && (is_chanop(msptr) || !MyConnect(source_p) ||
((can_send(chptr, source_p, msptr) > 0 &&
(source_p->localClient->firsttime +
- ConfigFileEntry.anti_spam_exit_message_time) < CurrentTime))))
+ ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time()))))
{
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s PART %s :%s", use_id(source_p), chptr->chname, reason);
if(!IsOper(source_p) &&
(source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) >
- CurrentTime)
+ rb_current_time())
{
exit_client(client_p, source_p, source_p, "Client Quit");
return 0;
{
static time_t last_used = 0L;
- if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name,
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
do_admin(source_p);
if(parc > 1)
{
- if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name, source_p->name, "ADMIN");
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
if(hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME)
return 0;
if(!source_p->localClient->challenge)
return 0;
- if((CurrentTime - source_p->localClient->chal_time) > CHALLENGE_EXPIRES)
+ if((rb_current_time() - source_p->localClient->chal_time) > CHALLENGE_EXPIRES)
{
sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), me.name, source_p->name);
ilog(L_FOPER, "EXPIRED CHALLENGE (%s) by (%s!%s@%s) (%s)",
if(!generate_challenge(&challenge, &(source_p->localClient->challenge), oper_p->rsa_pubkey))
{
char *chal = challenge;
- source_p->localClient->chal_time = CurrentTime;
+ source_p->localClient->chal_time = rb_current_time();
for(;;)
{
cnt = strlcpy(chal_line, chal, CHALLENGE_WIDTH);
form_str(ERR_TARGUMODEG), target_p->name);
if((target_p->localClient->last_caller_id_time +
- ConfigFileEntry.caller_id_wait) < CurrentTime)
+ ConfigFileEntry.caller_id_wait) < rb_current_time())
{
if(p_or_n != NOTICE)
sendto_one_numeric(source_p, RPL_TARGNOTIFY,
me.name, target_p->name, source_p->name,
source_p->username, source_p->host);
- target_p->localClient->last_caller_id_time = CurrentTime;
+ target_p->localClient->last_caller_id_time = rb_current_time();
}
return 0;
}
if(p_or_n != NOTICE)
- source_p->localClient->last = CurrentTime;
+ source_p->localClient->last = rb_current_time();
sendto_anywhere(target_p, source_p, command, ":%s", parv[3]);
return 0;
"Temporary D-line %d min. - %s (%s)",
(int) (tdline_time / 60), reason, current_date);
aconf->passwd = rb_strdup(dlbuffer);
- aconf->hold = CurrentTime + tdline_time;
+ aconf->hold = rb_current_time() + tdline_time;
add_temp_dline(aconf);
if(EmptyString(oper_reason))
aconf->passwd = rb_strdup(buffer);
aconf->user = rb_strdup(user);
aconf->host = rb_strdup(host);
- aconf->hold = CurrentTime + ConfigFileEntry.gline_time;
+ aconf->hold = rb_current_time() + ConfigFileEntry.gline_time;
add_gline(aconf);
sendto_realops_snomask(SNO_GENERAL, L_ALL,
sizeof(pending->oper_host2));
pending->reason2 = rb_strdup(reason);
pending->oper_server2 = scache_get_name(source_p->servptr->serv->nameinfo);
- pending->last_gline_time = CurrentTime;
- pending->time_request2 = CurrentTime;
+ pending->last_gline_time = rb_current_time();
+ pending->time_request2 = rb_current_time();
return NO;
}
}
pending->reason1 = rb_strdup(reason);
pending->reason2 = NULL;
- pending->last_gline_time = CurrentTime;
- pending->time_request1 = CurrentTime;
+ pending->last_gline_time = rb_current_time();
+ pending->time_request1 = rb_current_time();
rb_dlinkAddAlloc(pending, &pending_glines);
{
static time_t last_used = 0L;
- if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
/* safe enough to give this on a local connect only */
sendto_one(source_p, form_str(RPL_LOAD2HI),
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME)
return 0;
apply_tkline(struct Client *source_p, struct ConfItem *aconf,
const char *reason, const char *oper_reason, const char *current_date, int tkline_time)
{
- aconf->hold = CurrentTime + tkline_time;
+ aconf->hold = rb_current_time() + tkline_time;
add_temp_kline(aconf);
/* no oper reason.. */
* allow one knock per channel per knock_delay_channel
*/
if(!IsOper(source_p) &&
- (source_p->localClient->last_knock + ConfigChannel.knock_delay) > CurrentTime)
+ (source_p->localClient->last_knock + ConfigChannel.knock_delay) > rb_current_time())
{
sendto_one(source_p, form_str(ERR_TOOMANYKNOCK),
me.name, source_p->name, name, "user");
return 0;
}
- else if((chptr->last_knock + ConfigChannel.knock_delay_channel) > CurrentTime)
+ else if((chptr->last_knock + ConfigChannel.knock_delay_channel) > rb_current_time())
{
sendto_one(source_p, form_str(ERR_TOOMANYKNOCK),
me.name, source_p->name, name, "channel");
}
/* ok, we actually can send the knock, tell client */
- source_p->localClient->last_knock = CurrentTime;
+ source_p->localClient->last_knock = rb_current_time();
sendto_one(source_p, form_str(RPL_KNOCKDLVR),
me.name, source_p->name, name);
}
- chptr->last_knock = CurrentTime;
+ chptr->last_knock = rb_current_time();
if(ConfigChannel.use_knock)
sendto_channel_local(chptr->mode.mode & MODE_FREEINVITE ? ALL_MEMBERS : ONLY_CHANOPS,
if (parc < 2 || !IsChannelName(parv[1]))
{
/* pace this due to the sheer traffic involved */
- if (((last_used + ConfigFileEntry.pace_wait) > CurrentTime))
+ if (((last_used + ConfigFileEntry.pace_wait) > rb_current_time()))
{
sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "LIST");
sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name);
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
}
return mo_list(client_p, source_p, parc, parv);
if (parc > 2)
{
- if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
/* safe enough to give this on a local connect only */
sendto_one(source_p, form_str(RPL_LOAD2HI),
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
if(hunt_server(client_p, source_p, ":%s LUSERS %s :%s", 2, parc, parv) !=
HUNTED_ISME)
{
static time_t last_used = 0;
- if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
/* safe enough to give this on a local connect only */
sendto_one(source_p, form_str(RPL_LOAD2HI),
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME)
return 0;
{
if(!IsOper(source_p))
{
- if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name, source_p->name, "NAMES");
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
}
names_global(source_p);
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"End of burst (emulated) from %s (%d seconds)",
source_p->name,
- (signed int) (CurrentTime - source_p->localClient->firsttime));
+ (signed int) (rb_current_time() - source_p->localClient->firsttime));
SetEob(source_p);
eob_count++;
call_hook(h_server_eob, source_p);
if(temp_time > 0)
{
- aconf->hold = CurrentTime + temp_time;
+ aconf->hold = rb_current_time() + temp_time;
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s added temporary %d min. RESV for [%s] [%s]",
if(temp_time > 0)
{
- aconf->hold = CurrentTime + temp_time;
+ aconf->hold = rb_current_time() + temp_time;
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s added temporary %d min. RESV for [%s] [%s]",
newts = atol(parv[3]);
/* timestamp is older than 15mins, ignore it */
- if(newts < (CurrentTime - 900))
- newts = CurrentTime - 900;
+ if(newts < (rb_current_time() - 900))
+ newts = rb_current_time() - 900;
target_p->tsinfo = newts;
add_nd_entry(parv[2]);
nd = irc_dictionary_retrieve(nd_dict, parv[2]);
if (nd != NULL)
- nd->expire = CurrentTime + duration;
+ nd->expire = rb_current_time() + duration;
}
return 0;
{
char note[NICKLEN + 10];
- send_signon(NULL, target_p, nick, user, host, CurrentTime, login);
+ send_signon(NULL, target_p, nick, user, host, rb_current_time(), login);
rb_snprintf(note, NICKLEN + 10, "Nick: %s", target_p->name);
rb_note(target_p->localClient->F, note);
if(MyClient(source_p) && !IsOper(source_p))
{
/* Check the user is actually allowed to do /stats, and isnt flooding */
- if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
/* safe enough to give this on a local connect only */
sendto_one(source_p, form_str(RPL_LOAD2HI),
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
}
if(hunt_server (client_p, source_p, ":%s STATS %s :%s", 2, parc, parv) != HUNTED_ISME)
if(0 == secs)
secs = 1;
- rup = (CurrentTime - startup_time) * hzz;
+ rup = (rb_current_time() - startup_time) * hzz;
if(0 == rup)
rup = 1;
{
time_t now;
- now = CurrentTime - startup_time;
+ now = rb_current_time() - startup_time;
sendto_one_numeric(source_p, RPL_STATSUPTIME,
form_str (RPL_STATSUPTIME),
now / 86400, (now / 3600) % 24,
target_p = ptr->data;
j++;
- seconds = CurrentTime - target_p->localClient->firsttime;
+ seconds = rb_current_time() - target_p->localClient->firsttime;
days = (int) (seconds / 86400);
seconds %= 86400;
"Connected: %d day%s, %d:%02d:%02d",
target_p->name,
(target_p->serv->by[0] ? target_p->serv->by : "Remote."),
- (int) (CurrentTime - target_p->localClient->lasttime),
+ (int) (rb_current_time() - target_p->localClient->lasttime),
(int) rb_linebuf_len (&target_p->localClient->buf_sendq),
days, (days == 1) ? "" : "s", hours, minutes,
(int) seconds);
(int) target_p->localClient->sendK,
(int) target_p->localClient->receiveM,
(int) target_p->localClient->receiveK,
- CurrentTime - target_p->localClient->firsttime,
- (CurrentTime > target_p->localClient->lasttime) ?
- (CurrentTime - target_p->localClient->lasttime) : 0,
+ rb_current_time() - target_p->localClient->firsttime,
+ (rb_current_time() > target_p->localClient->lasttime) ?
+ (rb_current_time() - target_p->localClient->lasttime) : 0,
IsOper (source_p) ? show_capabilities (target_p) : "TS");
}
"? :Recv total : %7.2f %s",
_GMKv (receiveK), _GMKs (receiveK));
- uptime = (CurrentTime - startup_time);
+ uptime = (rb_current_time() - startup_time);
sendto_one_numeric(source_p, RPL_STATSDEBUG,
"? :Server send: %7.2f %s (%4.1f K/s)",
(int) target_p->localClient->sendK,
(int) target_p->localClient->receiveM,
(int) target_p->localClient->receiveK,
- CurrentTime - target_p->localClient->firsttime,
- (CurrentTime > target_p->localClient->lasttime) ?
- (CurrentTime - target_p->localClient->lasttime) : 0,
+ rb_current_time() - target_p->localClient->firsttime,
+ (rb_current_time() > target_p->localClient->lasttime) ?
+ (rb_current_time() - target_p->localClient->lasttime) : 0,
IsOper(source_p) ? show_capabilities(target_p) : "-");
}
(int) target_p->localClient->sendK,
(int) target_p->localClient->receiveM,
(int) target_p->localClient->receiveK,
- CurrentTime - target_p->localClient->firsttime,
- (CurrentTime > target_p->localClient->lasttime) ?
- (CurrentTime - target_p->localClient->lasttime) : 0,
+ rb_current_time() - target_p->localClient->firsttime,
+ (rb_current_time() > target_p->localClient->lasttime) ?
+ (rb_current_time() - target_p->localClient->lasttime) : 0,
"-");
}
}
}
/*
- * since we're here, might as well set CurrentTime while we're at it
+ * since we're here, might as well set rb_current_time() while we're at it
*/
set_time();
theirtime = atol(parv[4]);
- deltat = abs(theirtime - CurrentTime);
+ deltat = abs(theirtime - rb_current_time());
if(deltat > ConfigFileEntry.ts_max_delta)
{
"Link %s dropped, excessive TS delta"
" (my TS=%ld, their TS=%ld, delta=%d)",
get_server_name(source_p, SHOW_IP),
- (long) CurrentTime, (long) theirtime, deltat);
+ (long) rb_current_time(), (long) theirtime, deltat);
ilog(L_SERVER,
"Link %s dropped, excessive TS delta"
" (my TS=%ld, their TS=%ld, delta=%d)",
- log_client_name(source_p, SHOW_IP), (long) CurrentTime, (long) theirtime, deltat);
+ log_client_name(source_p, SHOW_IP), (long) rb_current_time(), (long) theirtime, deltat);
snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%d)",
- (long) CurrentTime, (long) theirtime, deltat);
+ (long) rb_current_time(), (long) theirtime, deltat);
exit_client(source_p, source_p, source_p, squitreason);
return 0;
}
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"Link %s notable TS delta"
" (my TS=%ld, their TS=%ld, delta=%d)",
- source_p->name, (long) CurrentTime, (long) theirtime, deltat);
+ source_p->name, (long) rb_current_time(), (long) theirtime, deltat);
}
return 0;
sendto_one(source_p, form_str(RPL_TESTLINE),
me.name, source_p->name,
resv_p->hold ? 'q' : 'Q',
- resv_p->hold ? (long) ((resv_p->hold - CurrentTime) / 60) : 0L,
+ resv_p->hold ? (long) ((resv_p->hold - rb_current_time()) / 60) : 0L,
resv_p->name, resv_p->passwd);
/* this is a false positive, so make sure it isn't counted in stats q
* --nenolod
me.name, source_p->name,
(aconf->flags & CONF_FLAGS_TEMPORARY) ? 'd' : 'D',
(aconf->flags & CONF_FLAGS_TEMPORARY) ?
- (long) ((aconf->hold - CurrentTime) / 60) : 0L,
+ (long) ((aconf->hold - rb_current_time()) / 60) : 0L,
aconf->host, aconf->passwd);
return 0;
me.name, source_p->name,
(aconf->flags & CONF_FLAGS_TEMPORARY) ? 'k' : 'K',
(aconf->flags & CONF_FLAGS_TEMPORARY) ?
- (long) ((aconf->hold - CurrentTime) / 60) : 0L,
+ (long) ((aconf->hold - rb_current_time()) / 60) : 0L,
buf, aconf->passwd);
return 0;
}
aconf->user, aconf->host);
sendto_one(source_p, form_str(RPL_TESTLINE),
me.name, source_p->name,
- 'G', (long) ((aconf->hold - CurrentTime) / 60),
+ 'G', (long) ((aconf->hold - rb_current_time()) / 60),
buf, aconf->passwd);
return 0;
}
sendto_one(source_p, form_str(RPL_TESTLINE),
me.name, source_p->name,
resv_p->hold ? 'q' : 'Q',
- resv_p->hold ? (long) ((resv_p->hold - CurrentTime) / 60) : 0L,
+ resv_p->hold ? (long) ((resv_p->hold - rb_current_time()) / 60) : 0L,
resv_p->name, resv_p->passwd);
/* this is a false positive, so make sure it isn't counted in stats q
sendto_one(source_p, form_str(RPL_TESTLINE),
me.name, source_p->name,
aconf->hold ? 'x' : 'X',
- aconf->hold ? (long) ((aconf->hold - CurrentTime) / 60) : 0L,
+ aconf->hold ? (long) ((aconf->hold - rb_current_time()) / 60) : 0L,
aconf->name, aconf->passwd);
return 0;
}
time_t lclock;
int minswest;
- lclock = CurrentTime;
+ lclock = rb_current_time();
gm = gmtime(&lclock);
memcpy((void *) &gmbuf, (void *) gm, sizeof(gmbuf));
gm = &gmbuf;
char topic_info[USERHOST_REPLYLEN];
rb_sprintf(topic_info, "%s!%s@%s",
source_p->name, source_p->username, source_p->host);
- set_channel_topic(chptr, parv[2], topic_info, CurrentTime);
+ set_channel_topic(chptr, parv[2], topic_info, rb_current_time());
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s TOPIC %s :%s",
sendto_one_numeric(source_p, RPL_TRACEUNKNOWN,
form_str(RPL_TRACEUNKNOWN),
class_name, name, ip,
- CurrentTime - target_p->localClient->firsttime);
+ rb_current_time() - target_p->localClient->firsttime);
cnt++;
break;
form_str(RPL_TRACEOPERATOR),
class_name, name,
show_ip(source_p, target_p) ? ip : "255.255.255.255",
- CurrentTime - target_p->localClient->lasttime,
- CurrentTime - target_p->localClient->last);
+ rb_current_time() - target_p->localClient->lasttime,
+ rb_current_time() - target_p->localClient->last);
else
sendto_one_numeric(source_p, RPL_TRACEUSER,
form_str(RPL_TRACEUSER),
class_name, name,
show_ip(source_p, target_p) ? ip : "255.255.255.255",
- CurrentTime - target_p->localClient->lasttime,
- CurrentTime - target_p->localClient->last);
+ rb_current_time() - target_p->localClient->lasttime,
+ rb_current_time() - target_p->localClient->last);
cnt++;
}
break;
sendto_one_numeric(source_p, RPL_TRACESERVER, form_str(RPL_TRACESERVER),
class_name, servcount, usercount, name,
*(target_p->serv->by) ? target_p->serv->by : "*", "*",
- me.name, CurrentTime - target_p->localClient->lasttime);
+ me.name, rb_current_time() - target_p->localClient->lasttime);
cnt++;
}
if(parc > 1)
{
- if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
/* safe enough to give this on a local connect only */
sendto_one(source_p, form_str(RPL_LOAD2HI),
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
if(hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) != HUNTED_ISME)
return 0;
/* it has to be a global who at this point, limit it */
if(!IsOper(source_p))
{
- if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name, source_p->name, "WHO");
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
}
/* Note: operspy_dont_care_user_info does not apply to
if(!IsOper(source_p))
{
/* seeing as this is going across servers, we should limit it */
- if((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait_simple) > rb_current_time())
{
sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name, source_p->name, "WHOIS");
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
}
if(hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1, parc, parv) !=
sendto_one_numeric(source_p, RPL_WHOISIDLE, form_str(RPL_WHOISIDLE),
target_p->name,
- CurrentTime - target_p->localClient->last,
+ rb_current_time() - target_p->localClient->last,
target_p->localClient->firsttime);
}
else
if(!IsOper(source_p))
{
- if((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
+ if((last_used + ConfigFileEntry.pace_wait_simple) > rb_current_time())
{
sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name, source_p->name, "WHOWAS");
return 0;
}
else
- last_used = CurrentTime;
+ last_used = rb_current_time();
}
if(temp_time > 0)
{
- aconf->hold = CurrentTime + temp_time;
+ aconf->hold = rb_current_time() + temp_time;
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s added temporary %d min. X-Line for [%s] [%s]",
rb_sprintf(buffer, "\"%s\",\"0\",\"%s\",\"%s\",%ld\n",
aconf->name, aconf->passwd,
- get_oper_name(source_p), CurrentTime);
+ get_oper_name(source_p), rb_current_time());
if(fputs(buffer, out) == -1)
{
if (reply->addr.ss_family == AF_INET &&
!memcmp(&((struct sockaddr_in *)&reply->addr)->sin_addr, "\177\0\0", 3))
listed = TRUE;
- else if (blcptr->blacklist->lastwarning + 3600 < CurrentTime)
+ else if (blcptr->blacklist->lastwarning + 3600 < rb_current_time())
{
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"Garbage reply from blacklist %s",
blcptr->blacklist->host);
- blcptr->blacklist->lastwarning = CurrentTime;
+ blcptr->blacklist->lastwarning = rb_current_time();
}
}
if(client_p->servptr == &me)
rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers);
- chptr->users_last = CurrentTime;
+ chptr->users_last = rb_current_time();
if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0)
destroy_channel(chptr);
if(client_p->servptr == &me)
rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers);
- chptr->users_last = CurrentTime;
+ chptr->users_last = rb_current_time();
if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0)
destroy_channel(chptr);
/* join throttling stuff --nenolod */
else if(chptr->mode.join_num > 0 && chptr->mode.join_time > 0)
{
- if ((CurrentTime - chptr->join_delta <=
+ if ((rb_current_time() - chptr->join_delta <=
chptr->mode.join_time) && (chptr->join_count >=
chptr->mode.join_num))
i = ERR_THROTTLE;
else
{
if((t_delta =
- (CurrentTime - source_p->localClient->last_leave_time)) >
+ (rb_current_time() - source_p->localClient->last_leave_time)) >
JOIN_LEAVE_COUNT_EXPIRE_TIME)
{
decrement_count = (t_delta / JOIN_LEAVE_COUNT_EXPIRE_TIME);
}
else
{
- if((CurrentTime -
+ if((rb_current_time() -
(source_p->localClient->last_join_time)) < GlobalSetOptions.spam_time)
{
/* oh, its a possible spambot */
}
}
if(name != NULL)
- source_p->localClient->last_join_time = CurrentTime;
+ source_p->localClient->last_join_time = rb_current_time();
else
- source_p->localClient->last_leave_time = CurrentTime;
+ source_p->localClient->last_leave_time = rb_current_time();
}
}
strlcpy(who, source_p->name, sizeof(who));
actualBan = allocate_ban(realban, who);
- actualBan->when = CurrentTime;
+ actualBan->when = rb_current_time();
rb_dlinkAdd(actualBan, &actualBan->node, list);
SetMyConnect(client_p);
client_p->localClient = localClient;
- client_p->localClient->lasttime = client_p->localClient->firsttime = CurrentTime;
+ client_p->localClient->lasttime = client_p->localClient->firsttime = rb_current_time();
client_p->localClient->F = NULL;
client_p->localClient->ctrlfd = -1;
ping = get_client_ping(client_p);
- if(ping < (CurrentTime - client_p->localClient->lasttime))
+ if(ping < (rb_current_time() - client_p->localClient->lasttime))
{
/*
* If the client/server hasnt talked to us in 2*ping seconds
* and it has a ping time, then close its connection.
*/
- if(((CurrentTime - client_p->localClient->lasttime) >= (2 * ping)
+ if(((rb_current_time() - client_p->localClient->lasttime) >= (2 * ping)
&& (client_p->flags & FLAGS_PINGSENT)))
{
if(IsServer(client_p))
}
(void) rb_snprintf(scratch, sizeof(scratch),
"Ping timeout: %d seconds",
- (int) (CurrentTime - client_p->localClient->lasttime));
+ (int) (rb_current_time() - client_p->localClient->lasttime));
exit_client(client_p, client_p, &me, scratch);
continue;
*/
client_p->flags |= FLAGS_PINGSENT;
/* not nice but does the job */
- client_p->localClient->lasttime = CurrentTime - ping;
+ client_p->localClient->lasttime = rb_current_time() - ping;
sendto_one(client_p, "PING :%s", me.name);
}
}
*/
timeout = IsAnyServer(client_p) ? ConfigFileEntry.connect_timeout : 30;
- if((CurrentTime - client_p->localClient->firsttime) > timeout)
+ if((rb_current_time() - client_p->localClient->firsttime) > timeout)
{
if(IsAnyServer(client_p))
{
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s was connected"
" for %ld seconds. %d/%d sendK/recvK.",
- source_p->name, CurrentTime - source_p->localClient->firsttime, sendk, recvk);
+ source_p->name, rb_current_time() - source_p->localClient->firsttime, sendk, recvk);
ilog(L_SERVER, "%s was connected for %ld seconds. %d/%d sendK/recvK.",
- source_p->name, CurrentTime - source_p->localClient->firsttime, sendk, recvk);
+ source_p->name, rb_current_time() - source_p->localClient->firsttime, sendk, recvk);
if(has_id(source_p))
del_from_id_hash(source_p->id, source_p);
show_ip(NULL, source_p) ? source_p->sockhost : "255.255.255.255",
comment);
- on_for = CurrentTime - source_p->localClient->firsttime;
+ on_for = rb_current_time() - source_p->localClient->firsttime;
ilog(L_USER, "%s (%3lu:%02lu:%02lu): %s!%s@%s %d/%d",
- myctime(CurrentTime), on_for / 3600,
+ myctime(rb_current_time()), on_for / 3600,
(on_for % 3600) / 60, on_for % 60,
source_p->name, source_p->username, source_p->host,
source_p->localClient->sendK, source_p->localClient->receiveK);
ServerStats->is_sbr += client_p->localClient->receiveB;
ServerStats->is_sks += client_p->localClient->sendK;
ServerStats->is_skr += client_p->localClient->receiveK;
- ServerStats->is_sti += CurrentTime - client_p->localClient->firsttime;
+ ServerStats->is_sti += rb_current_time() - client_p->localClient->firsttime;
if(ServerStats->is_sbs > 2047)
{
ServerStats->is_sks += (ServerStats->is_sbs >> 10);
ServerStats->is_cbr += client_p->localClient->receiveB;
ServerStats->is_cks += client_p->localClient->sendK;
ServerStats->is_ckr += client_p->localClient->receiveK;
- ServerStats->is_cti += CurrentTime - client_p->localClient->firsttime;
+ ServerStats->is_cti += rb_current_time() - client_p->localClient->firsttime;
if(ServerStats->is_cbs > 2047)
{
ServerStats->is_cks += (ServerStats->is_cbs >> 10);
rb_dlinkAdd(chptr, &chptr->node, &global_channel_list);
- chptr->channelts = CurrentTime; /* doesn't hurt to set it here */
+ chptr->channelts = rb_current_time(); /* doesn't hurt to set it here */
rb_dlinkAddAlloc(chptr, &channelTable[hashv]);
newtime.tv_sec = time(NULL);
#endif
- if(newtime.tv_sec < CurrentTime)
- rb_set_back_events(CurrentTime - newtime.tv_sec);
+ if(newtime.tv_sec < rb_current_time())
+ rb_set_back_events(rb_current_time() - newtime.tv_sec);
SystemTime.tv_sec = newtime.tv_sec;
SystemTime.tv_usec = newtime.tv_usec;
*/
delay = rb_event_next();
- if(delay <= CurrentTime)
+ if(delay <= rb_current_time())
rb_event_run();
me.servptr = &me;
SetMe(&me);
make_server(&me);
- startup_time = CurrentTime;
+ startup_time = rb_current_time();
add_to_client_hash(me.name, &me);
add_to_id_hash(me.id, &me);
me.serv->nameinfo = scache_connect(me.name, me.info, 0);
/*
* slow down the whining to opers bit
*/
- if((last_oper_notice + 20) <= CurrentTime)
+ if((last_oper_notice + 20) <= rb_current_time())
{
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"All connections in use. (%s)",
get_listener_name(listener));
- last_oper_notice = CurrentTime;
+ last_oper_notice = rb_current_time();
}
write(fd, "ERROR :All connections in use\r\n", 32);
call_hook(h_iorecv_id, &hdata);
#endif
- if(client_p->localClient->lasttime < CurrentTime)
- client_p->localClient->lasttime = CurrentTime;
+ if(client_p->localClient->lasttime < rb_current_time())
+ client_p->localClient->lasttime = rb_current_time();
client_p->flags &= ~FLAGS_PINGSENT;
/*
pnode = ptr->data;
rdata = pnode->data;
- if(rdata->time + ConfigFileEntry.reject_duration > CurrentTime)
+ if(rdata->time + ConfigFileEntry.reject_duration > rb_current_time())
continue;
rb_dlinkDelete(ptr, &reject_list);
if((pnode = match_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip)) != NULL)
{
rdata = pnode->data;
- rdata->time = CurrentTime;
+ rdata->time = rb_current_time();
rdata->count++;
}
else
pnode = make_and_lookup_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip, bitlen);
pnode->data = rdata = rb_malloc(sizeof(struct reject_data));
rb_dlinkAddTail(pnode, &rdata->rnode, &reject_list);
- rdata->time = CurrentTime;
+ rdata->time = rb_current_time();
rdata->count = 1;
}
rdata->mask_hashv = hashv;
{
rdata = pnode->data;
- rdata->time = CurrentTime;
+ rdata->time = rb_current_time();
if(rdata->count > ConfigFileEntry.reject_after_count)
{
ServerStats->is_rej++;
*/
static void timeout_resolver(void *notused)
{
- timeout_query_list(CurrentTime);
+ timeout_query_list(rb_current_time());
}
/*
void init_resolver(void)
{
#ifdef HAVE_SRAND48
- srand48(CurrentTime);
+ srand48(rb_current_time());
#endif
start_resolver();
}
{
struct reslist *request = rb_malloc(sizeof(struct reslist));
- request->sentat = CurrentTime;
+ request->sentat = rb_current_time();
request->retries = 3;
request->resend = 1;
request->timeout = 4; /* start at 4 and exponential inc. */
client->localClient->auth_request = request;
request->fd = -1;
request->client = client;
- request->timeout = CurrentTime + ConfigFileEntry.connect_timeout;
+ request->timeout = rb_current_time() + ConfigFileEntry.connect_timeout;
return request;
}
{
auth = ptr->data;
- if(auth->timeout < CurrentTime)
+ if(auth->timeout < rb_current_time())
{
if(auth->fd >= 0)
rb_close(auth->fd);
sendheader(auth->client, REPORT_FAIL_DNS);
}
- auth->client->localClient->lasttime = CurrentTime;
+ auth->client->localClient->lasttime = rb_current_time();
release_auth_client(auth);
}
}
void
add_temp_kline(struct ConfItem *aconf)
{
- if(aconf->hold >= CurrentTime + (10080 * 60))
+ if(aconf->hold >= rb_current_time() + (10080 * 60))
{
rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_WEEK]);
aconf->port = TEMP_WEEK;
}
- else if(aconf->hold >= CurrentTime + (1440 * 60))
+ else if(aconf->hold >= rb_current_time() + (1440 * 60))
{
rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_DAY]);
aconf->port = TEMP_DAY;
}
- else if(aconf->hold >= CurrentTime + (60 * 60))
+ else if(aconf->hold >= rb_current_time() + (60 * 60))
{
rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_HOUR]);
aconf->port = TEMP_HOUR;
void
add_temp_dline(struct ConfItem *aconf)
{
- if(aconf->hold >= CurrentTime + (10080 * 60))
+ if(aconf->hold >= rb_current_time() + (10080 * 60))
{
rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_WEEK]);
aconf->port = TEMP_WEEK;
}
- else if(aconf->hold >= CurrentTime + (1440 * 60))
+ else if(aconf->hold >= rb_current_time() + (1440 * 60))
{
rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_DAY]);
aconf->port = TEMP_DAY;
}
- else if(aconf->hold >= CurrentTime + (60 * 60))
+ else if(aconf->hold >= rb_current_time() + (60 * 60))
{
rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_HOUR]);
aconf->port = TEMP_HOUR;
{
aconf = ptr->data;
- if(aconf->hold <= CurrentTime)
+ if(aconf->hold <= rb_current_time())
{
/* Alert opers that a TKline expired - Hwy */
if(ConfigFileEntry.tkline_expire_notices)
{
aconf = ptr->data;
- if(aconf->hold < (CurrentTime + (60 * 60)))
+ if(aconf->hold < (rb_current_time() + (60 * 60)))
{
rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ?
&temp_klines[TEMP_MIN] : &temp_dlines[TEMP_MIN]);
}
else if(aconf->port > TEMP_HOUR)
{
- if(aconf->hold < (CurrentTime + (1440 * 60)))
+ if(aconf->hold < (rb_current_time() + (1440 * 60)))
{
rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ?
&temp_klines[TEMP_HOUR] : &temp_dlines[TEMP_HOUR]);
aconf->port = TEMP_HOUR;
}
else if(aconf->port > TEMP_DAY &&
- (aconf->hold < (CurrentTime + (10080 * 60))))
+ (aconf->hold < (rb_current_time() + (10080 * 60))))
{
rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ?
&temp_klines[TEMP_DAY] : &temp_dlines[TEMP_DAY]);
rb_snprintf(buffer, sizeof(buffer),
"\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n",
user, host, reason, oper_reason, current_date,
- get_oper_name(source_p), CurrentTime);
+ get_oper_name(source_p), rb_current_time());
}
else if(type == DLINE_TYPE)
{
rb_snprintf(buffer, sizeof(buffer),
"\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n", host,
- reason, oper_reason, current_date, get_oper_name(source_p), CurrentTime);
+ reason, oper_reason, current_date, get_oper_name(source_p), rb_current_time());
}
else if(type == RESV_TYPE)
{
rb_snprintf(buffer, sizeof(buffer), "\"%s\",\"%s\",\"%s\",%ld\n",
- host, reason, get_oper_name(source_p), CurrentTime);
+ host, reason, get_oper_name(source_p), rb_current_time());
}
if(fputs(buffer, out) == -1)
kill_ptr = gline_node->data;
/* these are in chronological order */
- if(kill_ptr->hold > CurrentTime)
+ if(kill_ptr->hold > rb_current_time())
break;
rb_dlinkDestroy(gline_node, &glines);
glp_ptr = pending_node->data;
if(((glp_ptr->last_gline_time + GLINE_PENDING_EXPIRE) <=
- CurrentTime) || find_is_glined(glp_ptr->host, glp_ptr->user))
+ rb_current_time()) || find_is_glined(glp_ptr->host, glp_ptr->user))
{
rb_free(glp_ptr->reason1);
{
static char buf[MAX_DATE_STRING];
struct tm *lt;
- time_t ltime = CurrentTime;
+ time_t ltime = rb_current_time();
lt = localtime(<ime);
{
aconf = ptr->data;
- if(aconf->hold && aconf->hold <= CurrentTime)
+ if(aconf->hold && aconf->hold <= rb_current_time())
{
if(ConfigFileEntry.tkline_expire_notices)
sendto_realops_snomask(SNO_GENERAL, L_ALL,
{
aconf = ptr->data;
- if(aconf->hold && aconf->hold <= CurrentTime)
+ if(aconf->hold && aconf->hold <= rb_current_time())
{
if(ConfigFileEntry.tkline_expire_notices)
sendto_realops_snomask(SNO_GENERAL, L_ALL,
{
aconf = ptr->data;
- if(aconf->hold && aconf->hold <= CurrentTime)
+ if(aconf->hold && aconf->hold <= rb_current_time())
{
if(ConfigFileEntry.tkline_expire_notices)
sendto_realops_snomask(SNO_GENERAL, L_ALL,
nd = BlockHeapAlloc(nd_heap);
strlcpy(nd->name, name, sizeof(nd->name));
- nd->expire = CurrentTime + ConfigFileEntry.nick_delay;
+ nd->expire = rb_current_time() + ConfigFileEntry.nick_delay;
/* this list is ordered */
rb_dlinkAddTail(nd, &nd->lnode, &nd_list);
/* this list is ordered - we can stop when we hit the first
* entry that doesnt expire..
*/
- if(nd->expire > CurrentTime)
+ if(nd->expire > rb_current_time())
return;
free_nd_entry(nd);
target->pnode = pnode;
target->ip = rb_strdup(host);
- target->expiry = CurrentTime + (60*60*12);
+ target->expiry = rb_current_time() + (60*60*12);
rb_dlinkAdd(target, &target->node, &tgchange_list);
}
* made one successfull connection... [this algorithm is
* a bit fuzzy... -- msa >;) ]
*/
- if(tmp_p->hold > CurrentTime)
+ if(tmp_p->hold > rb_current_time())
{
if(next > tmp_p->hold || next == 0)
next = tmp_p->hold;
}
confrq = get_con_freq(cltmp);
- tmp_p->hold = CurrentTime + confrq;
+ tmp_p->hold = rb_current_time() + confrq;
/*
* Found a CONNECT config with port specified, scan clients
SetServlink(client_p);
}
- sendto_one(client_p, "SVINFO %d %d 0 :%ld", TS_CURRENT, TS_MIN, CurrentTime);
+ sendto_one(client_p, "SVINFO %d %d 0 :%ld", TS_CURRENT, TS_MIN, rb_current_time());
client_p->servptr = &me;
}
client_p->serv->nameinfo = scache_connect(client_p->name, client_p->info, IsHidden(client_p));
- client_p->localClient->firsttime = CurrentTime;
+ client_p->localClient->firsttime = rb_current_time();
/* fixing eob timings.. -gnp */
if((rb_dlink_list_length(&lclient_list) + rb_dlink_list_length(&serv_list)) >
sp->is_sbr += target_p->localClient->receiveB;
sp->is_sks += target_p->localClient->sendK;
sp->is_skr += target_p->localClient->receiveK;
- sp->is_sti += CurrentTime - target_p->localClient->firsttime;
+ sp->is_sti += rb_current_time() - target_p->localClient->firsttime;
sp->is_sv++;
if(sp->is_sbs > 1023)
{
sp->is_cbr += target_p->localClient->receiveB;
sp->is_cks += target_p->localClient->sendK;
sp->is_ckr += target_p->localClient->receiveK;
- sp->is_cti += CurrentTime - target_p->localClient->firsttime;
+ sp->is_cti += rb_current_time() - target_p->localClient->firsttime;
sp->is_cl++;
if(sp->is_cbs > 1023)
{
if(rb_dlink_list_length(&source_p->preClient->dnsbl_queries) > 0)
return -1;
- client_p->localClient->last = CurrentTime;
+ client_p->localClient->last = rb_current_time();
/* Straight up the maximum rate of flooding... */
source_p->localClient->allow_read = MAX_FLOOD_BURST;
strlcpy(ptr->name, name, sizeof(ptr->name));
ptr->info[0] = '\0';
ptr->flags = 0;
- ptr->known_since = CurrentTime;
+ ptr->known_since = rb_current_time();
ptr->last_connect = 0;
ptr->last_split = 0;
ptr->flags |= SC_HIDDEN;
else
ptr->flags &= ~SC_HIDDEN;
- ptr->last_connect = CurrentTime;
+ ptr->last_connect = rb_current_time();
return ptr;
}
if (ptr == NULL)
return;
ptr->flags &= ~SC_ONLINE;
- ptr->last_split = CurrentTime;
+ ptr->last_split = rb_current_time();
}
const char *scache_get_name(struct scache_entry *ptr)
!ConfigServerHide.disable_hidden)
show = FALSE;
else if (scache_ptr->flags & SC_ONLINE)
- show = scache_ptr->known_since < CurrentTime - ConfigServerHide.links_delay;
+ show = scache_ptr->known_since < rb_current_time() - ConfigServerHide.links_delay;
else
- show = scache_ptr->last_split > CurrentTime - ConfigServerHide.links_delay && scache_ptr->last_split - scache_ptr->known_since > ConfigServerHide.links_delay;
+ show = scache_ptr->last_split > rb_current_time() - ConfigServerHide.links_delay && scache_ptr->last_split - scache_ptr->known_since > ConfigServerHide.links_delay;
if (show)
sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS),
scache_ptr->name, me.name, 1, scache_ptr->info);
scache_ptr = scache_hash[i];
while (scache_ptr)
{
- if (!(scache_ptr->flags & SC_ONLINE) && scache_ptr->last_split > CurrentTime - MISSING_TIMEOUT)
+ if (!(scache_ptr->flags & SC_ONLINE) && scache_ptr->last_split > rb_current_time() - MISSING_TIMEOUT)
sendto_one_numeric(source_p, RPL_MAP, "** %s (recently split)",
scache_ptr->name);
del_whowas_from_list(&WHOWASHASH[who->hashv], who);
}
who->hashv = hash_whowas_name(client_p->name);
- who->logoff = CurrentTime;
+ who->logoff = rb_current_time();
/*
* NOTE: strcpy ok here, the sizes in the client struct MUST
* match the sizes in the whowas struct
struct Whowas *temp;
int blah;
- timelimit = CurrentTime - timelimit;
+ timelimit = rb_current_time() - timelimit;
blah = hash_whowas_name(nick);
temp = WHOWASHASH[blah];
for (; temp; temp = temp->next)