CurrentTime -> rb_currenttime();
This commit is contained in:
parent
b42e202d6b
commit
e335494516
53 changed files with 194 additions and 198 deletions
|
@ -80,11 +80,7 @@ extern struct Client me;
|
||||||
extern rb_dlink_list global_client_list;
|
extern rb_dlink_list global_client_list;
|
||||||
extern struct Client *local[];
|
extern struct Client *local[];
|
||||||
extern struct Counter Count;
|
extern struct Counter Count;
|
||||||
#if 0
|
|
||||||
extern time_t CurrentTime;
|
|
||||||
#endif
|
|
||||||
extern struct timeval SystemTime;
|
extern struct timeval SystemTime;
|
||||||
#define CurrentTime SystemTime.tv_sec
|
|
||||||
extern int default_server_capabs;
|
extern int default_server_capabs;
|
||||||
|
|
||||||
extern time_t startup_time;
|
extern time_t startup_time;
|
||||||
|
|
|
@ -262,7 +262,7 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
sendto_one(source_p, form_str(ERR_TOOMANYCHANNELS),
|
sendto_one(source_p, form_str(ERR_TOOMANYCHANNELS),
|
||||||
me.name, source_p->name, name);
|
me.name, source_p->name, name);
|
||||||
if(successful_join_count)
|
if(successful_join_count)
|
||||||
source_p->localClient->last_join_time = CurrentTime;
|
source_p->localClient->last_join_time = rb_current_time();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,10 +303,10 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
/* add the user to the channel */
|
/* add the user to the channel */
|
||||||
add_user_to_channel(chptr, source_p, flags);
|
add_user_to_channel(chptr, source_p, flags);
|
||||||
if (chptr->mode.join_num &&
|
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_count = 0;
|
||||||
chptr->join_delta = CurrentTime;
|
chptr->join_delta = rb_current_time();
|
||||||
}
|
}
|
||||||
chptr->join_count++;
|
chptr->join_count++;
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
/* its a new channel, set +nt and burst. */
|
/* its a new channel, set +nt and burst. */
|
||||||
if(flags & CHFL_CHANOP)
|
if(flags & CHFL_CHANOP)
|
||||||
{
|
{
|
||||||
chptr->channelts = CurrentTime;
|
chptr->channelts = rb_current_time();
|
||||||
chptr->mode.mode |= MODE_TOPICLIMIT;
|
chptr->mode.mode |= MODE_TOPICLIMIT;
|
||||||
chptr->mode.mode |= MODE_NOPRIVMSGS;
|
chptr->mode.mode |= MODE_NOPRIVMSGS;
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
channel_member_names(chptr, source_p, 1);
|
channel_member_names(chptr, source_p, 1);
|
||||||
|
|
||||||
if(successful_join_count)
|
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.client = source_p;
|
||||||
hook_info.chptr = chptr;
|
hook_info.chptr = chptr;
|
||||||
|
@ -494,10 +494,10 @@ ms_join(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
{
|
{
|
||||||
add_user_to_channel(chptr, source_p, CHFL_PEON);
|
add_user_to_channel(chptr, source_p, CHFL_PEON);
|
||||||
if (chptr->mode.join_num &&
|
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_count = 0;
|
||||||
chptr->join_delta = CurrentTime;
|
chptr->join_delta = rb_current_time();
|
||||||
}
|
}
|
||||||
chptr->join_count++;
|
chptr->join_count++;
|
||||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
|
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
|
||||||
|
|
|
@ -446,7 +446,7 @@ msg_channel(int p_or_n, const char *command,
|
||||||
{
|
{
|
||||||
/* idle time shouldnt be reset by notices --fl */
|
/* idle time shouldnt be reset by notices --fl */
|
||||||
if(p_or_n != NOTICE)
|
if(p_or_n != NOTICE)
|
||||||
source_p->localClient->last = CurrentTime;
|
source_p->localClient->last = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(chptr->mode.mode & MODE_NOCOLOR)
|
if(chptr->mode.mode & MODE_NOCOLOR)
|
||||||
|
@ -530,7 +530,7 @@ msg_channel_flags(int p_or_n, const char *command, struct Client *client_p,
|
||||||
{
|
{
|
||||||
/* idletime shouldnt be reset by notice --fl */
|
/* idletime shouldnt be reset by notice --fl */
|
||||||
if(p_or_n != NOTICE)
|
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",
|
sendto_channel_flags(client_p, type, source_p, chptr, "%s %c%s :%s",
|
||||||
|
@ -551,7 +551,7 @@ expire_tgchange(void *unused)
|
||||||
{
|
{
|
||||||
target = ptr->data;
|
target = ptr->data;
|
||||||
|
|
||||||
if(target->expiry < CurrentTime)
|
if(target->expiry < rb_current_time())
|
||||||
{
|
{
|
||||||
rb_dlinkDelete(ptr, &tgchange_list);
|
rb_dlinkDelete(ptr, &tgchange_list);
|
||||||
rb_patricia_remove(tgchange_tree, target->pnode);
|
rb_patricia_remove(tgchange_tree, target->pnode);
|
||||||
|
@ -576,7 +576,7 @@ add_target(struct Client *source_p, struct Client *target_p)
|
||||||
*
|
*
|
||||||
* XXX: is this controversial?
|
* 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;
|
return 1;
|
||||||
|
|
||||||
hashv = fnv_hash_upper((const unsigned char *)use_id(target_p), 32);
|
hashv = fnv_hash_upper((const unsigned char *)use_id(target_p), 32);
|
||||||
|
@ -597,17 +597,17 @@ add_target(struct Client *source_p, struct Client *target_p)
|
||||||
if(!IsTGChange(source_p))
|
if(!IsTGChange(source_p))
|
||||||
{
|
{
|
||||||
SetTGChange(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 */
|
/* 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))
|
if(i > USED_TARGETS(source_p))
|
||||||
USED_TARGETS(source_p) = 0;
|
USED_TARGETS(source_p) = 0;
|
||||||
else
|
else
|
||||||
USED_TARGETS(source_p) -= i;
|
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 */
|
/* cant clear any, full target list */
|
||||||
else if(USED_TARGETS(source_p) == 10)
|
else if(USED_TARGETS(source_p) == 10)
|
||||||
|
@ -622,7 +622,7 @@ add_target(struct Client *source_p, struct Client *target_p)
|
||||||
*/
|
*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
source_p->localClient->target_last = CurrentTime;
|
source_p->localClient->target_last = rb_current_time();
|
||||||
SetTGChange(source_p);
|
SetTGChange(source_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ msg_client(int p_or_n, const char *command,
|
||||||
/* reset idle time for message only if its not to self
|
/* reset idle time for message only if its not to self
|
||||||
* and its not a notice */
|
* and its not a notice */
|
||||||
if(p_or_n != 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
|
/* target change stuff, dont limit ctcp replies as that
|
||||||
* would allow people to start filling up random users
|
* would allow people to start filling up random users
|
||||||
|
@ -716,7 +716,7 @@ msg_client(int p_or_n, const char *command,
|
||||||
}
|
}
|
||||||
|
|
||||||
if((target_p->localClient->last_caller_id_time +
|
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)
|
if(p_or_n != NOTICE)
|
||||||
sendto_one_numeric(source_p, RPL_TARGNOTIFY,
|
sendto_one_numeric(source_p, RPL_TARGNOTIFY,
|
||||||
|
@ -727,7 +727,7 @@ msg_client(int p_or_n, const char *command,
|
||||||
me.name, target_p->name, source_p->name,
|
me.name, target_p->name, source_p->name,
|
||||||
source_p->username, source_p->host);
|
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 */
|
/* Only so opers can watch for floods */
|
||||||
(void) flood_attack_client(p_or_n, source_p, target_p);
|
(void) flood_attack_client(p_or_n, source_p, target_p);
|
||||||
|
@ -768,11 +768,11 @@ flood_attack_client(int p_or_n, struct Client *source_p, struct Client *target_p
|
||||||
|
|
||||||
if(GlobalSetOptions.floodcount && MyConnect(target_p) && IsClient(source_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->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)
|
if(target_p->localClient->received_number_of_privmsgs <= 0)
|
||||||
{
|
{
|
||||||
target_p->localClient->received_number_of_privmsgs = 0;
|
target_p->localClient->received_number_of_privmsgs = 0;
|
||||||
|
@ -823,11 +823,11 @@ flood_attack_channel(int p_or_n, struct Client *source_p, struct Channel *chptr,
|
||||||
|
|
||||||
if(GlobalSetOptions.floodcount && MyClient(source_p))
|
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->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)
|
if(chptr->received_number_of_privmsgs <= 0)
|
||||||
{
|
{
|
||||||
chptr->received_number_of_privmsgs = 0;
|
chptr->received_number_of_privmsgs = 0;
|
||||||
|
|
|
@ -734,7 +734,7 @@ set_initial_nick(struct Client *client_p, struct Client *source_p, char *nick)
|
||||||
char note[NICKLEN + 10];
|
char note[NICKLEN + 10];
|
||||||
|
|
||||||
/* This had to be copied here to avoid problems.. */
|
/* This had to be copied here to avoid problems.. */
|
||||||
source_p->tsinfo = CurrentTime;
|
source_p->tsinfo = rb_current_time();
|
||||||
if(source_p->name[0])
|
if(source_p->name[0])
|
||||||
del_from_client_hash(source_p->name, source_p);
|
del_from_client_hash(source_p->name, source_p);
|
||||||
|
|
||||||
|
@ -774,10 +774,10 @@ change_local_nick(struct Client *client_p, struct Client *source_p,
|
||||||
nick, chptr->chname);
|
nick, chptr->chname);
|
||||||
return;
|
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->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++;
|
source_p->localClient->number_of_nick_changes++;
|
||||||
|
|
||||||
if(ConfigFileEntry.anti_nick_flood && !IsOper(source_p) &&
|
if(ConfigFileEntry.anti_nick_flood && !IsOper(source_p) &&
|
||||||
|
@ -796,10 +796,10 @@ change_local_nick(struct Client *client_p, struct Client *source_p,
|
||||||
if(!samenick)
|
if(!samenick)
|
||||||
{
|
{
|
||||||
/* force the TS to increase -- jilles */
|
/* force the TS to increase -- jilles */
|
||||||
if (source_p->tsinfo >= CurrentTime)
|
if (source_p->tsinfo >= rb_current_time())
|
||||||
source_p->tsinfo++;
|
source_p->tsinfo++;
|
||||||
else
|
else
|
||||||
source_p->tsinfo = CurrentTime;
|
source_p->tsinfo = rb_current_time();
|
||||||
monitor_signoff(source_p);
|
monitor_signoff(source_p);
|
||||||
/* we only do bancache for local users -- jilles */
|
/* we only do bancache for local users -- jilles */
|
||||||
if(source_p->user)
|
if(source_p->user)
|
||||||
|
@ -870,7 +870,7 @@ change_remote_nick(struct Client *client_p, struct Client *source_p,
|
||||||
/* client changing their nick - dont reset ts if its same */
|
/* client changing their nick - dont reset ts if its same */
|
||||||
if(!samenick)
|
if(!samenick)
|
||||||
{
|
{
|
||||||
source_p->tsinfo = newts ? newts : CurrentTime;
|
source_p->tsinfo = newts ? newts : rb_current_time();
|
||||||
monitor_signoff(source_p);
|
monitor_signoff(source_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ part_one_client(struct Client *client_p, struct Client *source_p, char *name, ch
|
||||||
if(reason[0] && (is_chanop(msptr) || !MyConnect(source_p) ||
|
if(reason[0] && (is_chanop(msptr) || !MyConnect(source_p) ||
|
||||||
((can_send(chptr, source_p, msptr) > 0 &&
|
((can_send(chptr, source_p, msptr) > 0 &&
|
||||||
(source_p->localClient->firsttime +
|
(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,
|
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
|
||||||
":%s PART %s :%s", use_id(source_p), chptr->chname, reason);
|
":%s PART %s :%s", use_id(source_p), chptr->chname, reason);
|
||||||
|
|
|
@ -74,7 +74,7 @@ m_quit(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
|
|
||||||
if(!IsOper(source_p) &&
|
if(!IsOper(source_p) &&
|
||||||
(source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) >
|
(source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) >
|
||||||
CurrentTime)
|
rb_current_time())
|
||||||
{
|
{
|
||||||
exit_client(client_p, source_p, source_p, "Client Quit");
|
exit_client(client_p, source_p, source_p, "Client Quit");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -68,7 +68,7 @@ mr_admin(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
{
|
{
|
||||||
static time_t last_used = 0L;
|
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),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
me.name,
|
me.name,
|
||||||
|
@ -77,7 +77,7 @@ mr_admin(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
|
|
||||||
do_admin(source_p);
|
do_admin(source_p);
|
||||||
|
|
||||||
|
@ -96,14 +96,14 @@ m_admin(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
|
|
||||||
if(parc > 1)
|
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),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
me.name, source_p->name, "ADMIN");
|
me.name, source_p->name, "ADMIN");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
|
|
||||||
if(hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME)
|
if(hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -128,7 +128,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
if(!source_p->localClient->challenge)
|
if(!source_p->localClient->challenge)
|
||||||
return 0;
|
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);
|
sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), me.name, source_p->name);
|
||||||
ilog(L_FOPER, "EXPIRED CHALLENGE (%s) by (%s!%s@%s) (%s)",
|
ilog(L_FOPER, "EXPIRED CHALLENGE (%s) by (%s!%s@%s) (%s)",
|
||||||
|
@ -226,7 +226,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
if(!generate_challenge(&challenge, &(source_p->localClient->challenge), oper_p->rsa_pubkey))
|
if(!generate_challenge(&challenge, &(source_p->localClient->challenge), oper_p->rsa_pubkey))
|
||||||
{
|
{
|
||||||
char *chal = challenge;
|
char *chal = challenge;
|
||||||
source_p->localClient->chal_time = CurrentTime;
|
source_p->localClient->chal_time = rb_current_time();
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
cnt = strlcpy(chal_line, chal, CHALLENGE_WIDTH);
|
cnt = strlcpy(chal_line, chal, CHALLENGE_WIDTH);
|
||||||
|
|
|
@ -143,7 +143,7 @@ m_cmessage(int p_or_n, const char *command,
|
||||||
form_str(ERR_TARGUMODEG), target_p->name);
|
form_str(ERR_TARGUMODEG), target_p->name);
|
||||||
|
|
||||||
if((target_p->localClient->last_caller_id_time +
|
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)
|
if(p_or_n != NOTICE)
|
||||||
sendto_one_numeric(source_p, RPL_TARGNOTIFY,
|
sendto_one_numeric(source_p, RPL_TARGNOTIFY,
|
||||||
|
@ -154,14 +154,14 @@ m_cmessage(int p_or_n, const char *command,
|
||||||
me.name, target_p->name, source_p->name,
|
me.name, target_p->name, source_p->name,
|
||||||
source_p->username, source_p->host);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(p_or_n != NOTICE)
|
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]);
|
sendto_anywhere(target_p, source_p, command, ":%s", parv[3]);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -204,7 +204,7 @@ mo_dline(struct Client *client_p, struct Client *source_p,
|
||||||
"Temporary D-line %d min. - %s (%s)",
|
"Temporary D-line %d min. - %s (%s)",
|
||||||
(int) (tdline_time / 60), reason, current_date);
|
(int) (tdline_time / 60), reason, current_date);
|
||||||
aconf->passwd = rb_strdup(dlbuffer);
|
aconf->passwd = rb_strdup(dlbuffer);
|
||||||
aconf->hold = CurrentTime + tdline_time;
|
aconf->hold = rb_current_time() + tdline_time;
|
||||||
add_temp_dline(aconf);
|
add_temp_dline(aconf);
|
||||||
|
|
||||||
if(EmptyString(oper_reason))
|
if(EmptyString(oper_reason))
|
||||||
|
|
|
@ -562,7 +562,7 @@ set_local_gline(struct Client *source_p, const char *user,
|
||||||
aconf->passwd = rb_strdup(buffer);
|
aconf->passwd = rb_strdup(buffer);
|
||||||
aconf->user = rb_strdup(user);
|
aconf->user = rb_strdup(user);
|
||||||
aconf->host = rb_strdup(host);
|
aconf->host = rb_strdup(host);
|
||||||
aconf->hold = CurrentTime + ConfigFileEntry.gline_time;
|
aconf->hold = rb_current_time() + ConfigFileEntry.gline_time;
|
||||||
add_gline(aconf);
|
add_gline(aconf);
|
||||||
|
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
|
@ -651,8 +651,8 @@ majority_gline(struct Client *source_p, const char *user,
|
||||||
sizeof(pending->oper_host2));
|
sizeof(pending->oper_host2));
|
||||||
pending->reason2 = rb_strdup(reason);
|
pending->reason2 = rb_strdup(reason);
|
||||||
pending->oper_server2 = scache_get_name(source_p->servptr->serv->nameinfo);
|
pending->oper_server2 = scache_get_name(source_p->servptr->serv->nameinfo);
|
||||||
pending->last_gline_time = CurrentTime;
|
pending->last_gline_time = rb_current_time();
|
||||||
pending->time_request2 = CurrentTime;
|
pending->time_request2 = rb_current_time();
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -676,8 +676,8 @@ majority_gline(struct Client *source_p, const char *user,
|
||||||
pending->reason1 = rb_strdup(reason);
|
pending->reason1 = rb_strdup(reason);
|
||||||
pending->reason2 = NULL;
|
pending->reason2 = NULL;
|
||||||
|
|
||||||
pending->last_gline_time = CurrentTime;
|
pending->last_gline_time = rb_current_time();
|
||||||
pending->time_request1 = CurrentTime;
|
pending->time_request1 = rb_current_time();
|
||||||
|
|
||||||
rb_dlinkAddAlloc(pending, &pending_glines);
|
rb_dlinkAddAlloc(pending, &pending_glines);
|
||||||
|
|
||||||
|
|
|
@ -623,7 +623,7 @@ m_info(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
{
|
{
|
||||||
static time_t last_used = 0L;
|
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 */
|
/* safe enough to give this on a local connect only */
|
||||||
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
|
@ -632,7 +632,7 @@ m_info(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
|
|
||||||
if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME)
|
if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -508,7 +508,7 @@ static void
|
||||||
apply_tkline(struct Client *source_p, struct ConfItem *aconf,
|
apply_tkline(struct Client *source_p, struct ConfItem *aconf,
|
||||||
const char *reason, const char *oper_reason, const char *current_date, int tkline_time)
|
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);
|
add_temp_kline(aconf);
|
||||||
|
|
||||||
/* no oper reason.. */
|
/* no oper reason.. */
|
||||||
|
|
|
@ -137,13 +137,13 @@ m_knock(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
* allow one knock per channel per knock_delay_channel
|
* allow one knock per channel per knock_delay_channel
|
||||||
*/
|
*/
|
||||||
if(!IsOper(source_p) &&
|
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),
|
sendto_one(source_p, form_str(ERR_TOOMANYKNOCK),
|
||||||
me.name, source_p->name, name, "user");
|
me.name, source_p->name, name, "user");
|
||||||
return 0;
|
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),
|
sendto_one(source_p, form_str(ERR_TOOMANYKNOCK),
|
||||||
me.name, source_p->name, name, "channel");
|
me.name, source_p->name, name, "channel");
|
||||||
|
@ -151,13 +151,13 @@ m_knock(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ok, we actually can send the knock, tell client */
|
/* 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),
|
sendto_one(source_p, form_str(RPL_KNOCKDLVR),
|
||||||
me.name, source_p->name, name);
|
me.name, source_p->name, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
chptr->last_knock = CurrentTime;
|
chptr->last_knock = rb_current_time();
|
||||||
|
|
||||||
if(ConfigChannel.use_knock)
|
if(ConfigChannel.use_knock)
|
||||||
sendto_channel_local(chptr->mode.mode & MODE_FREEINVITE ? ALL_MEMBERS : ONLY_CHANOPS,
|
sendto_channel_local(chptr->mode.mode & MODE_FREEINVITE ? ALL_MEMBERS : ONLY_CHANOPS,
|
||||||
|
|
|
@ -124,14 +124,14 @@ static int m_list(struct Client *client_p, struct Client *source_p, int parc, co
|
||||||
if (parc < 2 || !IsChannelName(parv[1]))
|
if (parc < 2 || !IsChannelName(parv[1]))
|
||||||
{
|
{
|
||||||
/* pace this due to the sheer traffic involved */
|
/* 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_LOAD2HI), me.name, source_p->name, "LIST");
|
||||||
sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name);
|
sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
return mo_list(client_p, source_p, parc, parv);
|
return mo_list(client_p, source_p, parc, parv);
|
||||||
|
|
|
@ -63,7 +63,7 @@ m_lusers(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
|
|
||||||
if (parc > 2)
|
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 */
|
/* safe enough to give this on a local connect only */
|
||||||
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
|
@ -71,7 +71,7 @@ m_lusers(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
|
|
||||||
if(hunt_server(client_p, source_p, ":%s LUSERS %s :%s", 2, parc, parv) !=
|
if(hunt_server(client_p, source_p, ":%s LUSERS %s :%s", 2, parc, parv) !=
|
||||||
HUNTED_ISME)
|
HUNTED_ISME)
|
||||||
|
|
|
@ -67,7 +67,7 @@ m_motd(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
{
|
{
|
||||||
static time_t last_used = 0;
|
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 */
|
/* safe enough to give this on a local connect only */
|
||||||
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
|
@ -77,7 +77,7 @@ m_motd(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
|
|
||||||
if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME)
|
if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -92,7 +92,7 @@ m_names(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
{
|
{
|
||||||
if(!IsOper(source_p))
|
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),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
me.name, source_p->name, "NAMES");
|
me.name, source_p->name, "NAMES");
|
||||||
|
@ -101,7 +101,7 @@ m_names(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
names_global(source_p);
|
names_global(source_p);
|
||||||
|
|
|
@ -89,7 +89,7 @@ ms_pong(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"End of burst (emulated) from %s (%d seconds)",
|
"End of burst (emulated) from %s (%d seconds)",
|
||||||
source_p->name,
|
source_p->name,
|
||||||
(signed int) (CurrentTime - source_p->localClient->firsttime));
|
(signed int) (rb_current_time() - source_p->localClient->firsttime));
|
||||||
SetEob(source_p);
|
SetEob(source_p);
|
||||||
eob_count++;
|
eob_count++;
|
||||||
call_hook(h_server_eob, source_p);
|
call_hook(h_server_eob, source_p);
|
||||||
|
|
|
@ -230,7 +230,7 @@ parse_resv(struct Client *source_p, const char *name,
|
||||||
|
|
||||||
if(temp_time > 0)
|
if(temp_time > 0)
|
||||||
{
|
{
|
||||||
aconf->hold = CurrentTime + temp_time;
|
aconf->hold = rb_current_time() + temp_time;
|
||||||
|
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"%s added temporary %d min. RESV for [%s] [%s]",
|
"%s added temporary %d min. RESV for [%s] [%s]",
|
||||||
|
@ -288,7 +288,7 @@ parse_resv(struct Client *source_p, const char *name,
|
||||||
|
|
||||||
if(temp_time > 0)
|
if(temp_time > 0)
|
||||||
{
|
{
|
||||||
aconf->hold = CurrentTime + temp_time;
|
aconf->hold = rb_current_time() + temp_time;
|
||||||
|
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"%s added temporary %d min. RESV for [%s] [%s]",
|
"%s added temporary %d min. RESV for [%s] [%s]",
|
||||||
|
|
|
@ -204,8 +204,8 @@ me_rsfnc(struct Client *client_p, struct Client *source_p,
|
||||||
newts = atol(parv[3]);
|
newts = atol(parv[3]);
|
||||||
|
|
||||||
/* timestamp is older than 15mins, ignore it */
|
/* timestamp is older than 15mins, ignore it */
|
||||||
if(newts < (CurrentTime - 900))
|
if(newts < (rb_current_time() - 900))
|
||||||
newts = CurrentTime - 900;
|
newts = rb_current_time() - 900;
|
||||||
|
|
||||||
target_p->tsinfo = newts;
|
target_p->tsinfo = newts;
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ me_nickdelay(struct Client *client_p, struct Client *source_p, int parc, const c
|
||||||
add_nd_entry(parv[2]);
|
add_nd_entry(parv[2]);
|
||||||
nd = irc_dictionary_retrieve(nd_dict, parv[2]);
|
nd = irc_dictionary_retrieve(nd_dict, parv[2]);
|
||||||
if (nd != NULL)
|
if (nd != NULL)
|
||||||
nd->expire = CurrentTime + duration;
|
nd->expire = rb_current_time() + duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -257,7 +257,7 @@ me_svslogin(struct Client *client_p, struct Client *source_p,
|
||||||
{
|
{
|
||||||
char note[NICKLEN + 10];
|
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_snprintf(note, NICKLEN + 10, "Nick: %s", target_p->name);
|
||||||
rb_note(target_p->localClient->F, note);
|
rb_note(target_p->localClient->F, note);
|
||||||
|
|
|
@ -195,7 +195,7 @@ m_stats(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
if(MyClient(source_p) && !IsOper(source_p))
|
if(MyClient(source_p) && !IsOper(source_p))
|
||||||
{
|
{
|
||||||
/* Check the user is actually allowed to do /stats, and isnt flooding */
|
/* 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 */
|
/* safe enough to give this on a local connect only */
|
||||||
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
|
@ -205,7 +205,7 @@ m_stats(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
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(hunt_server (client_p, source_p, ":%s STATS %s :%s", 2, parc, parv) != HUNTED_ISME)
|
||||||
|
@ -894,7 +894,7 @@ stats_usage (struct Client *source_p)
|
||||||
if(0 == secs)
|
if(0 == secs)
|
||||||
secs = 1;
|
secs = 1;
|
||||||
|
|
||||||
rup = (CurrentTime - startup_time) * hzz;
|
rup = (rb_current_time() - startup_time) * hzz;
|
||||||
if(0 == rup)
|
if(0 == rup)
|
||||||
rup = 1;
|
rup = 1;
|
||||||
|
|
||||||
|
@ -935,7 +935,7 @@ stats_uptime (struct Client *source_p)
|
||||||
{
|
{
|
||||||
time_t now;
|
time_t now;
|
||||||
|
|
||||||
now = CurrentTime - startup_time;
|
now = rb_current_time() - startup_time;
|
||||||
sendto_one_numeric(source_p, RPL_STATSUPTIME,
|
sendto_one_numeric(source_p, RPL_STATSUPTIME,
|
||||||
form_str (RPL_STATSUPTIME),
|
form_str (RPL_STATSUPTIME),
|
||||||
now / 86400, (now / 3600) % 24,
|
now / 86400, (now / 3600) % 24,
|
||||||
|
@ -1049,7 +1049,7 @@ stats_servers (struct Client *source_p)
|
||||||
target_p = ptr->data;
|
target_p = ptr->data;
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
seconds = CurrentTime - target_p->localClient->firsttime;
|
seconds = rb_current_time() - target_p->localClient->firsttime;
|
||||||
|
|
||||||
days = (int) (seconds / 86400);
|
days = (int) (seconds / 86400);
|
||||||
seconds %= 86400;
|
seconds %= 86400;
|
||||||
|
@ -1063,7 +1063,7 @@ stats_servers (struct Client *source_p)
|
||||||
"Connected: %d day%s, %d:%02d:%02d",
|
"Connected: %d day%s, %d:%02d:%02d",
|
||||||
target_p->name,
|
target_p->name,
|
||||||
(target_p->serv->by[0] ? target_p->serv->by : "Remote."),
|
(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),
|
(int) rb_linebuf_len (&target_p->localClient->buf_sendq),
|
||||||
days, (days == 1) ? "" : "s", hours, minutes,
|
days, (days == 1) ? "" : "s", hours, minutes,
|
||||||
(int) seconds);
|
(int) seconds);
|
||||||
|
@ -1194,9 +1194,9 @@ stats_servlinks (struct Client *source_p)
|
||||||
(int) target_p->localClient->sendK,
|
(int) target_p->localClient->sendK,
|
||||||
(int) target_p->localClient->receiveM,
|
(int) target_p->localClient->receiveM,
|
||||||
(int) target_p->localClient->receiveK,
|
(int) target_p->localClient->receiveK,
|
||||||
CurrentTime - target_p->localClient->firsttime,
|
rb_current_time() - target_p->localClient->firsttime,
|
||||||
(CurrentTime > target_p->localClient->lasttime) ?
|
(rb_current_time() > target_p->localClient->lasttime) ?
|
||||||
(CurrentTime - target_p->localClient->lasttime) : 0,
|
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
||||||
IsOper (source_p) ? show_capabilities (target_p) : "TS");
|
IsOper (source_p) ? show_capabilities (target_p) : "TS");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1210,7 +1210,7 @@ stats_servlinks (struct Client *source_p)
|
||||||
"? :Recv total : %7.2f %s",
|
"? :Recv total : %7.2f %s",
|
||||||
_GMKv (receiveK), _GMKs (receiveK));
|
_GMKv (receiveK), _GMKs (receiveK));
|
||||||
|
|
||||||
uptime = (CurrentTime - startup_time);
|
uptime = (rb_current_time() - startup_time);
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"? :Server send: %7.2f %s (%4.1f K/s)",
|
"? :Server send: %7.2f %s (%4.1f K/s)",
|
||||||
|
@ -1347,9 +1347,9 @@ stats_l_client(struct Client *source_p, struct Client *target_p,
|
||||||
(int) target_p->localClient->sendK,
|
(int) target_p->localClient->sendK,
|
||||||
(int) target_p->localClient->receiveM,
|
(int) target_p->localClient->receiveM,
|
||||||
(int) target_p->localClient->receiveK,
|
(int) target_p->localClient->receiveK,
|
||||||
CurrentTime - target_p->localClient->firsttime,
|
rb_current_time() - target_p->localClient->firsttime,
|
||||||
(CurrentTime > target_p->localClient->lasttime) ?
|
(rb_current_time() > target_p->localClient->lasttime) ?
|
||||||
(CurrentTime - target_p->localClient->lasttime) : 0,
|
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
||||||
IsOper(source_p) ? show_capabilities(target_p) : "-");
|
IsOper(source_p) ? show_capabilities(target_p) : "-");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1366,9 +1366,9 @@ stats_l_client(struct Client *source_p, struct Client *target_p,
|
||||||
(int) target_p->localClient->sendK,
|
(int) target_p->localClient->sendK,
|
||||||
(int) target_p->localClient->receiveM,
|
(int) target_p->localClient->receiveM,
|
||||||
(int) target_p->localClient->receiveK,
|
(int) target_p->localClient->receiveK,
|
||||||
CurrentTime - target_p->localClient->firsttime,
|
rb_current_time() - target_p->localClient->firsttime,
|
||||||
(CurrentTime > target_p->localClient->lasttime) ?
|
(rb_current_time() > target_p->localClient->lasttime) ?
|
||||||
(CurrentTime - target_p->localClient->lasttime) : 0,
|
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
||||||
"-");
|
"-");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,11 +78,11 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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();
|
set_time();
|
||||||
theirtime = atol(parv[4]);
|
theirtime = atol(parv[4]);
|
||||||
deltat = abs(theirtime - CurrentTime);
|
deltat = abs(theirtime - rb_current_time());
|
||||||
|
|
||||||
if(deltat > ConfigFileEntry.ts_max_delta)
|
if(deltat > ConfigFileEntry.ts_max_delta)
|
||||||
{
|
{
|
||||||
|
@ -90,13 +90,13 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
"Link %s dropped, excessive TS delta"
|
"Link %s dropped, excessive TS delta"
|
||||||
" (my TS=%ld, their TS=%ld, delta=%d)",
|
" (my TS=%ld, their TS=%ld, delta=%d)",
|
||||||
get_server_name(source_p, SHOW_IP),
|
get_server_name(source_p, SHOW_IP),
|
||||||
(long) CurrentTime, (long) theirtime, deltat);
|
(long) rb_current_time(), (long) theirtime, deltat);
|
||||||
ilog(L_SERVER,
|
ilog(L_SERVER,
|
||||||
"Link %s dropped, excessive TS delta"
|
"Link %s dropped, excessive TS delta"
|
||||||
" (my TS=%ld, their TS=%ld, delta=%d)",
|
" (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)",
|
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);
|
exit_client(source_p, source_p, source_p, squitreason);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
|
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
|
||||||
"Link %s notable TS delta"
|
"Link %s notable TS delta"
|
||||||
" (my TS=%ld, their TS=%ld, delta=%d)",
|
" (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;
|
return 0;
|
||||||
|
|
|
@ -81,7 +81,7 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
sendto_one(source_p, form_str(RPL_TESTLINE),
|
sendto_one(source_p, form_str(RPL_TESTLINE),
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
resv_p->hold ? 'q' : 'Q',
|
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);
|
resv_p->name, resv_p->passwd);
|
||||||
/* this is a false positive, so make sure it isn't counted in stats q
|
/* this is a false positive, so make sure it isn't counted in stats q
|
||||||
* --nenolod
|
* --nenolod
|
||||||
|
@ -132,7 +132,7 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
(aconf->flags & CONF_FLAGS_TEMPORARY) ? 'd' : 'D',
|
(aconf->flags & CONF_FLAGS_TEMPORARY) ? 'd' : 'D',
|
||||||
(aconf->flags & CONF_FLAGS_TEMPORARY) ?
|
(aconf->flags & CONF_FLAGS_TEMPORARY) ?
|
||||||
(long) ((aconf->hold - CurrentTime) / 60) : 0L,
|
(long) ((aconf->hold - rb_current_time()) / 60) : 0L,
|
||||||
aconf->host, aconf->passwd);
|
aconf->host, aconf->passwd);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -168,7 +168,7 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
(aconf->flags & CONF_FLAGS_TEMPORARY) ? 'k' : 'K',
|
(aconf->flags & CONF_FLAGS_TEMPORARY) ? 'k' : 'K',
|
||||||
(aconf->flags & CONF_FLAGS_TEMPORARY) ?
|
(aconf->flags & CONF_FLAGS_TEMPORARY) ?
|
||||||
(long) ((aconf->hold - CurrentTime) / 60) : 0L,
|
(long) ((aconf->hold - rb_current_time()) / 60) : 0L,
|
||||||
buf, aconf->passwd);
|
buf, aconf->passwd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
aconf->user, aconf->host);
|
aconf->user, aconf->host);
|
||||||
sendto_one(source_p, form_str(RPL_TESTLINE),
|
sendto_one(source_p, form_str(RPL_TESTLINE),
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
'G', (long) ((aconf->hold - CurrentTime) / 60),
|
'G', (long) ((aconf->hold - rb_current_time()) / 60),
|
||||||
buf, aconf->passwd);
|
buf, aconf->passwd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
sendto_one(source_p, form_str(RPL_TESTLINE),
|
sendto_one(source_p, form_str(RPL_TESTLINE),
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
resv_p->hold ? 'q' : 'Q',
|
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);
|
resv_p->name, resv_p->passwd);
|
||||||
|
|
||||||
/* this is a false positive, so make sure it isn't counted in stats q
|
/* this is a false positive, so make sure it isn't counted in stats q
|
||||||
|
@ -230,7 +230,7 @@ mo_testgecos(struct Client *client_p, struct Client *source_p, int parc, const c
|
||||||
sendto_one(source_p, form_str(RPL_TESTLINE),
|
sendto_one(source_p, form_str(RPL_TESTLINE),
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
aconf->hold ? 'x' : 'X',
|
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);
|
aconf->name, aconf->passwd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ date(void)
|
||||||
time_t lclock;
|
time_t lclock;
|
||||||
int minswest;
|
int minswest;
|
||||||
|
|
||||||
lclock = CurrentTime;
|
lclock = rb_current_time();
|
||||||
gm = gmtime(&lclock);
|
gm = gmtime(&lclock);
|
||||||
memcpy((void *) &gmbuf, (void *) gm, sizeof(gmbuf));
|
memcpy((void *) &gmbuf, (void *) gm, sizeof(gmbuf));
|
||||||
gm = &gmbuf;
|
gm = &gmbuf;
|
||||||
|
|
|
@ -103,7 +103,7 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
char topic_info[USERHOST_REPLYLEN];
|
char topic_info[USERHOST_REPLYLEN];
|
||||||
rb_sprintf(topic_info, "%s!%s@%s",
|
rb_sprintf(topic_info, "%s!%s@%s",
|
||||||
source_p->name, source_p->username, source_p->host);
|
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,
|
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
|
||||||
":%s TOPIC %s :%s",
|
":%s TOPIC %s :%s",
|
||||||
|
|
|
@ -369,7 +369,7 @@ report_this_status(struct Client *source_p, struct Client *target_p,
|
||||||
sendto_one_numeric(source_p, RPL_TRACEUNKNOWN,
|
sendto_one_numeric(source_p, RPL_TRACEUNKNOWN,
|
||||||
form_str(RPL_TRACEUNKNOWN),
|
form_str(RPL_TRACEUNKNOWN),
|
||||||
class_name, name, ip,
|
class_name, name, ip,
|
||||||
CurrentTime - target_p->localClient->firsttime);
|
rb_current_time() - target_p->localClient->firsttime);
|
||||||
cnt++;
|
cnt++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -386,16 +386,16 @@ report_this_status(struct Client *source_p, struct Client *target_p,
|
||||||
form_str(RPL_TRACEOPERATOR),
|
form_str(RPL_TRACEOPERATOR),
|
||||||
class_name, name,
|
class_name, name,
|
||||||
show_ip(source_p, target_p) ? ip : "255.255.255.255",
|
show_ip(source_p, target_p) ? ip : "255.255.255.255",
|
||||||
CurrentTime - target_p->localClient->lasttime,
|
rb_current_time() - target_p->localClient->lasttime,
|
||||||
CurrentTime - target_p->localClient->last);
|
rb_current_time() - target_p->localClient->last);
|
||||||
|
|
||||||
else
|
else
|
||||||
sendto_one_numeric(source_p, RPL_TRACEUSER,
|
sendto_one_numeric(source_p, RPL_TRACEUSER,
|
||||||
form_str(RPL_TRACEUSER),
|
form_str(RPL_TRACEUSER),
|
||||||
class_name, name,
|
class_name, name,
|
||||||
show_ip(source_p, target_p) ? ip : "255.255.255.255",
|
show_ip(source_p, target_p) ? ip : "255.255.255.255",
|
||||||
CurrentTime - target_p->localClient->lasttime,
|
rb_current_time() - target_p->localClient->lasttime,
|
||||||
CurrentTime - target_p->localClient->last);
|
rb_current_time() - target_p->localClient->last);
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -410,7 +410,7 @@ report_this_status(struct Client *source_p, struct Client *target_p,
|
||||||
sendto_one_numeric(source_p, RPL_TRACESERVER, form_str(RPL_TRACESERVER),
|
sendto_one_numeric(source_p, RPL_TRACESERVER, form_str(RPL_TRACESERVER),
|
||||||
class_name, servcount, usercount, name,
|
class_name, servcount, usercount, name,
|
||||||
*(target_p->serv->by) ? target_p->serv->by : "*", "*",
|
*(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++;
|
cnt++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ m_version(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
|
|
||||||
if(parc > 1)
|
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 */
|
/* safe enough to give this on a local connect only */
|
||||||
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
|
@ -69,7 +69,7 @@ m_version(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
|
|
||||||
if(hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) != HUNTED_ISME)
|
if(hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) != HUNTED_ISME)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -176,7 +176,7 @@ m_who(struct Client *client_p, struct Client *source_p, int parc, const char *pa
|
||||||
/* it has to be a global who at this point, limit it */
|
/* it has to be a global who at this point, limit it */
|
||||||
if(!IsOper(source_p))
|
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),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
me.name, source_p->name, "WHO");
|
me.name, source_p->name, "WHO");
|
||||||
|
@ -185,7 +185,7 @@ m_who(struct Client *client_p, struct Client *source_p, int parc, const char *pa
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note: operspy_dont_care_user_info does not apply to
|
/* Note: operspy_dont_care_user_info does not apply to
|
||||||
|
|
|
@ -90,7 +90,7 @@ m_whois(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
if(!IsOper(source_p))
|
if(!IsOper(source_p))
|
||||||
{
|
{
|
||||||
/* seeing as this is going across servers, we should limit it */
|
/* 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),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
me.name, source_p->name, "WHOIS");
|
me.name, source_p->name, "WHOIS");
|
||||||
|
@ -99,7 +99,7 @@ m_whois(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1, parc, parv) !=
|
if(hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1, parc, parv) !=
|
||||||
|
@ -345,7 +345,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_WHOISIDLE, form_str(RPL_WHOISIDLE),
|
sendto_one_numeric(source_p, RPL_WHOISIDLE, form_str(RPL_WHOISIDLE),
|
||||||
target_p->name,
|
target_p->name,
|
||||||
CurrentTime - target_p->localClient->last,
|
rb_current_time() - target_p->localClient->last,
|
||||||
target_p->localClient->firsttime);
|
target_p->localClient->firsttime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -69,7 +69,7 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
|
|
||||||
if(!IsOper(source_p))
|
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),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
me.name, source_p->name, "WHOWAS");
|
me.name, source_p->name, "WHOWAS");
|
||||||
|
@ -78,7 +78,7 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = CurrentTime;
|
last_used = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -321,7 +321,7 @@ apply_xline(struct Client *source_p, const char *name, const char *reason,
|
||||||
|
|
||||||
if(temp_time > 0)
|
if(temp_time > 0)
|
||||||
{
|
{
|
||||||
aconf->hold = CurrentTime + temp_time;
|
aconf->hold = rb_current_time() + temp_time;
|
||||||
|
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"%s added temporary %d min. X-Line for [%s] [%s]",
|
"%s added temporary %d min. X-Line for [%s] [%s]",
|
||||||
|
@ -373,7 +373,7 @@ write_xline(struct Client *source_p, struct ConfItem *aconf)
|
||||||
|
|
||||||
rb_sprintf(buffer, "\"%s\",\"0\",\"%s\",\"%s\",%ld\n",
|
rb_sprintf(buffer, "\"%s\",\"0\",\"%s\",\"%s\",%ld\n",
|
||||||
aconf->name, aconf->passwd,
|
aconf->name, aconf->passwd,
|
||||||
get_oper_name(source_p), CurrentTime);
|
get_oper_name(source_p), rb_current_time());
|
||||||
|
|
||||||
if(fputs(buffer, out) == -1)
|
if(fputs(buffer, out) == -1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -82,12 +82,12 @@ static void blacklist_dns_callback(void *vptr, struct DNSReply *reply)
|
||||||
if (reply->addr.ss_family == AF_INET &&
|
if (reply->addr.ss_family == AF_INET &&
|
||||||
!memcmp(&((struct sockaddr_in *)&reply->addr)->sin_addr, "\177\0\0", 3))
|
!memcmp(&((struct sockaddr_in *)&reply->addr)->sin_addr, "\177\0\0", 3))
|
||||||
listed = TRUE;
|
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,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"Garbage reply from blacklist %s",
|
"Garbage reply from blacklist %s",
|
||||||
blcptr->blacklist->host);
|
blcptr->blacklist->host);
|
||||||
blcptr->blacklist->lastwarning = CurrentTime;
|
blcptr->blacklist->lastwarning = rb_current_time();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ remove_user_from_channel(struct membership *msptr)
|
||||||
if(client_p->servptr == &me)
|
if(client_p->servptr == &me)
|
||||||
rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers);
|
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)
|
if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0)
|
||||||
destroy_channel(chptr);
|
destroy_channel(chptr);
|
||||||
|
@ -279,7 +279,7 @@ remove_user_from_channels(struct Client *client_p)
|
||||||
if(client_p->servptr == &me)
|
if(client_p->servptr == &me)
|
||||||
rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers);
|
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)
|
if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0)
|
||||||
destroy_channel(chptr);
|
destroy_channel(chptr);
|
||||||
|
@ -784,7 +784,7 @@ can_join(struct Client *source_p, struct Channel *chptr, char *key)
|
||||||
/* join throttling stuff --nenolod */
|
/* join throttling stuff --nenolod */
|
||||||
else if(chptr->mode.join_num > 0 && chptr->mode.join_time > 0)
|
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_time) && (chptr->join_count >=
|
||||||
chptr->mode.join_num))
|
chptr->mode.join_num))
|
||||||
i = ERR_THROTTLE;
|
i = ERR_THROTTLE;
|
||||||
|
@ -942,7 +942,7 @@ check_spambot_warning(struct Client *source_p, const char *name)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if((t_delta =
|
if((t_delta =
|
||||||
(CurrentTime - source_p->localClient->last_leave_time)) >
|
(rb_current_time() - source_p->localClient->last_leave_time)) >
|
||||||
JOIN_LEAVE_COUNT_EXPIRE_TIME)
|
JOIN_LEAVE_COUNT_EXPIRE_TIME)
|
||||||
{
|
{
|
||||||
decrement_count = (t_delta / JOIN_LEAVE_COUNT_EXPIRE_TIME);
|
decrement_count = (t_delta / JOIN_LEAVE_COUNT_EXPIRE_TIME);
|
||||||
|
@ -953,7 +953,7 @@ check_spambot_warning(struct Client *source_p, const char *name)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if((CurrentTime -
|
if((rb_current_time() -
|
||||||
(source_p->localClient->last_join_time)) < GlobalSetOptions.spam_time)
|
(source_p->localClient->last_join_time)) < GlobalSetOptions.spam_time)
|
||||||
{
|
{
|
||||||
/* oh, its a possible spambot */
|
/* oh, its a possible spambot */
|
||||||
|
@ -961,9 +961,9 @@ check_spambot_warning(struct Client *source_p, const char *name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(name != NULL)
|
if(name != NULL)
|
||||||
source_p->localClient->last_join_time = CurrentTime;
|
source_p->localClient->last_join_time = rb_current_time();
|
||||||
else
|
else
|
||||||
source_p->localClient->last_leave_time = CurrentTime;
|
source_p->localClient->last_leave_time = rb_current_time();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ add_id(struct Client *source_p, struct Channel *chptr, const char *banid,
|
||||||
strlcpy(who, source_p->name, sizeof(who));
|
strlcpy(who, source_p->name, sizeof(who));
|
||||||
|
|
||||||
actualBan = allocate_ban(realban, who);
|
actualBan = allocate_ban(realban, who);
|
||||||
actualBan->when = CurrentTime;
|
actualBan->when = rb_current_time();
|
||||||
|
|
||||||
rb_dlinkAdd(actualBan, &actualBan->node, list);
|
rb_dlinkAdd(actualBan, &actualBan->node, list);
|
||||||
|
|
||||||
|
|
24
src/client.c
24
src/client.c
|
@ -154,7 +154,7 @@ make_client(struct Client *from)
|
||||||
SetMyConnect(client_p);
|
SetMyConnect(client_p);
|
||||||
client_p->localClient = localClient;
|
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->F = NULL;
|
||||||
client_p->localClient->ctrlfd = -1;
|
client_p->localClient->ctrlfd = -1;
|
||||||
|
@ -303,13 +303,13 @@ check_pings_list(rb_dlink_list * list)
|
||||||
|
|
||||||
ping = get_client_ping(client_p);
|
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
|
* If the client/server hasnt talked to us in 2*ping seconds
|
||||||
* and it has a ping time, then close its connection.
|
* 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)))
|
&& (client_p->flags & FLAGS_PINGSENT)))
|
||||||
{
|
{
|
||||||
if(IsServer(client_p))
|
if(IsServer(client_p))
|
||||||
|
@ -323,7 +323,7 @@ check_pings_list(rb_dlink_list * list)
|
||||||
}
|
}
|
||||||
(void) rb_snprintf(scratch, sizeof(scratch),
|
(void) rb_snprintf(scratch, sizeof(scratch),
|
||||||
"Ping timeout: %d seconds",
|
"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);
|
exit_client(client_p, client_p, &me, scratch);
|
||||||
continue;
|
continue;
|
||||||
|
@ -337,7 +337,7 @@ check_pings_list(rb_dlink_list * list)
|
||||||
*/
|
*/
|
||||||
client_p->flags |= FLAGS_PINGSENT;
|
client_p->flags |= FLAGS_PINGSENT;
|
||||||
/* not nice but does the job */
|
/* 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);
|
sendto_one(client_p, "PING :%s", me.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -373,7 +373,7 @@ check_unknowns_list(rb_dlink_list * list)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
timeout = IsAnyServer(client_p) ? ConfigFileEntry.connect_timeout : 30;
|
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))
|
if(IsAnyServer(client_p))
|
||||||
{
|
{
|
||||||
|
@ -1553,10 +1553,10 @@ exit_local_server(struct Client *client_p, struct Client *source_p, struct Clien
|
||||||
|
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s was connected"
|
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s was connected"
|
||||||
" for %ld seconds. %d/%d sendK/recvK.",
|
" 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.",
|
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))
|
if(has_id(source_p))
|
||||||
del_from_id_hash(source_p->id, source_p);
|
del_from_id_hash(source_p->id, source_p);
|
||||||
|
@ -1603,10 +1603,10 @@ exit_local_client(struct Client *client_p, struct Client *source_p, struct Clien
|
||||||
show_ip(NULL, source_p) ? source_p->sockhost : "255.255.255.255",
|
show_ip(NULL, source_p) ? source_p->sockhost : "255.255.255.255",
|
||||||
comment);
|
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",
|
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,
|
(on_for % 3600) / 60, on_for % 60,
|
||||||
source_p->name, source_p->username, source_p->host,
|
source_p->name, source_p->username, source_p->host,
|
||||||
source_p->localClient->sendK, source_p->localClient->receiveK);
|
source_p->localClient->sendK, source_p->localClient->receiveK);
|
||||||
|
@ -2026,7 +2026,7 @@ close_connection(struct Client *client_p)
|
||||||
ServerStats->is_sbr += client_p->localClient->receiveB;
|
ServerStats->is_sbr += client_p->localClient->receiveB;
|
||||||
ServerStats->is_sks += client_p->localClient->sendK;
|
ServerStats->is_sks += client_p->localClient->sendK;
|
||||||
ServerStats->is_skr += client_p->localClient->receiveK;
|
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)
|
if(ServerStats->is_sbs > 2047)
|
||||||
{
|
{
|
||||||
ServerStats->is_sks += (ServerStats->is_sbs >> 10);
|
ServerStats->is_sks += (ServerStats->is_sbs >> 10);
|
||||||
|
@ -2064,7 +2064,7 @@ close_connection(struct Client *client_p)
|
||||||
ServerStats->is_cbr += client_p->localClient->receiveB;
|
ServerStats->is_cbr += client_p->localClient->receiveB;
|
||||||
ServerStats->is_cks += client_p->localClient->sendK;
|
ServerStats->is_cks += client_p->localClient->sendK;
|
||||||
ServerStats->is_ckr += client_p->localClient->receiveK;
|
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)
|
if(ServerStats->is_cbs > 2047)
|
||||||
{
|
{
|
||||||
ServerStats->is_cks += (ServerStats->is_cbs >> 10);
|
ServerStats->is_cks += (ServerStats->is_cbs >> 10);
|
||||||
|
|
|
@ -600,7 +600,7 @@ get_or_create_channel(struct Client *client_p, const char *chname, int *isnew)
|
||||||
|
|
||||||
rb_dlinkAdd(chptr, &chptr->node, &global_channel_list);
|
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]);
|
rb_dlinkAddAlloc(chptr, &channelTable[hashv]);
|
||||||
|
|
||||||
|
|
|
@ -244,8 +244,8 @@ set_time(void)
|
||||||
newtime.tv_sec = time(NULL);
|
newtime.tv_sec = time(NULL);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if(newtime.tv_sec < CurrentTime)
|
if(newtime.tv_sec < rb_current_time())
|
||||||
rb_set_back_events(CurrentTime - newtime.tv_sec);
|
rb_set_back_events(rb_current_time() - newtime.tv_sec);
|
||||||
|
|
||||||
SystemTime.tv_sec = newtime.tv_sec;
|
SystemTime.tv_sec = newtime.tv_sec;
|
||||||
SystemTime.tv_usec = newtime.tv_usec;
|
SystemTime.tv_usec = newtime.tv_usec;
|
||||||
|
@ -291,7 +291,7 @@ charybdis_io_loop(void)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
delay = rb_event_next();
|
delay = rb_event_next();
|
||||||
if(delay <= CurrentTime)
|
if(delay <= rb_current_time())
|
||||||
rb_event_run();
|
rb_event_run();
|
||||||
|
|
||||||
|
|
||||||
|
@ -634,7 +634,7 @@ main(int argc, char *argv[])
|
||||||
me.servptr = &me;
|
me.servptr = &me;
|
||||||
SetMe(&me);
|
SetMe(&me);
|
||||||
make_server(&me);
|
make_server(&me);
|
||||||
startup_time = CurrentTime;
|
startup_time = rb_current_time();
|
||||||
add_to_client_hash(me.name, &me);
|
add_to_client_hash(me.name, &me);
|
||||||
add_to_id_hash(me.id, &me);
|
add_to_id_hash(me.id, &me);
|
||||||
me.serv->nameinfo = scache_connect(me.name, me.info, 0);
|
me.serv->nameinfo = scache_connect(me.name, me.info, 0);
|
||||||
|
|
|
@ -528,12 +528,12 @@ accept_connection(int pfd, void *data)
|
||||||
/*
|
/*
|
||||||
* slow down the whining to opers bit
|
* 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,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"All connections in use. (%s)",
|
"All connections in use. (%s)",
|
||||||
get_listener_name(listener));
|
get_listener_name(listener));
|
||||||
last_oper_notice = CurrentTime;
|
last_oper_notice = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
write(fd, "ERROR :All connections in use\r\n", 32);
|
write(fd, "ERROR :All connections in use\r\n", 32);
|
||||||
|
|
|
@ -374,8 +374,8 @@ read_packet(int fd, void *data)
|
||||||
call_hook(h_iorecv_id, &hdata);
|
call_hook(h_iorecv_id, &hdata);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(client_p->localClient->lasttime < CurrentTime)
|
if(client_p->localClient->lasttime < rb_current_time())
|
||||||
client_p->localClient->lasttime = CurrentTime;
|
client_p->localClient->lasttime = rb_current_time();
|
||||||
client_p->flags &= ~FLAGS_PINGSENT;
|
client_p->flags &= ~FLAGS_PINGSENT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -98,7 +98,7 @@ reject_expires(void *unused)
|
||||||
pnode = ptr->data;
|
pnode = ptr->data;
|
||||||
rdata = pnode->data;
|
rdata = pnode->data;
|
||||||
|
|
||||||
if(rdata->time + ConfigFileEntry.reject_duration > CurrentTime)
|
if(rdata->time + ConfigFileEntry.reject_duration > rb_current_time())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rb_dlinkDelete(ptr, &reject_list);
|
rb_dlinkDelete(ptr, &reject_list);
|
||||||
|
@ -137,7 +137,7 @@ add_reject(struct Client *client_p, const char *mask1, const char *mask2)
|
||||||
if((pnode = match_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip)) != NULL)
|
if((pnode = match_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip)) != NULL)
|
||||||
{
|
{
|
||||||
rdata = pnode->data;
|
rdata = pnode->data;
|
||||||
rdata->time = CurrentTime;
|
rdata->time = rb_current_time();
|
||||||
rdata->count++;
|
rdata->count++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -150,7 +150,7 @@ add_reject(struct Client *client_p, const char *mask1, const char *mask2)
|
||||||
pnode = make_and_lookup_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip, bitlen);
|
pnode = make_and_lookup_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip, bitlen);
|
||||||
pnode->data = rdata = rb_malloc(sizeof(struct reject_data));
|
pnode->data = rdata = rb_malloc(sizeof(struct reject_data));
|
||||||
rb_dlinkAddTail(pnode, &rdata->rnode, &reject_list);
|
rb_dlinkAddTail(pnode, &rdata->rnode, &reject_list);
|
||||||
rdata->time = CurrentTime;
|
rdata->time = rb_current_time();
|
||||||
rdata->count = 1;
|
rdata->count = 1;
|
||||||
}
|
}
|
||||||
rdata->mask_hashv = hashv;
|
rdata->mask_hashv = hashv;
|
||||||
|
@ -172,7 +172,7 @@ check_reject(struct Client *client_p)
|
||||||
{
|
{
|
||||||
rdata = pnode->data;
|
rdata = pnode->data;
|
||||||
|
|
||||||
rdata->time = CurrentTime;
|
rdata->time = rb_current_time();
|
||||||
if(rdata->count > ConfigFileEntry.reject_after_count)
|
if(rdata->count > ConfigFileEntry.reject_after_count)
|
||||||
{
|
{
|
||||||
ServerStats->is_rej++;
|
ServerStats->is_rej++;
|
||||||
|
|
|
@ -212,7 +212,7 @@ static time_t timeout_query_list(time_t now)
|
||||||
*/
|
*/
|
||||||
static void timeout_resolver(void *notused)
|
static void timeout_resolver(void *notused)
|
||||||
{
|
{
|
||||||
timeout_query_list(CurrentTime);
|
timeout_query_list(rb_current_time());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -241,7 +241,7 @@ static void start_resolver(void)
|
||||||
void init_resolver(void)
|
void init_resolver(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SRAND48
|
#ifdef HAVE_SRAND48
|
||||||
srand48(CurrentTime);
|
srand48(rb_current_time());
|
||||||
#endif
|
#endif
|
||||||
start_resolver();
|
start_resolver();
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ static struct reslist *make_request(struct DNSQuery *query)
|
||||||
{
|
{
|
||||||
struct reslist *request = rb_malloc(sizeof(struct reslist));
|
struct reslist *request = rb_malloc(sizeof(struct reslist));
|
||||||
|
|
||||||
request->sentat = CurrentTime;
|
request->sentat = rb_current_time();
|
||||||
request->retries = 3;
|
request->retries = 3;
|
||||||
request->resend = 1;
|
request->resend = 1;
|
||||||
request->timeout = 4; /* start at 4 and exponential inc. */
|
request->timeout = 4; /* start at 4 and exponential inc. */
|
||||||
|
|
|
@ -116,7 +116,7 @@ make_auth_request(struct Client *client)
|
||||||
client->localClient->auth_request = request;
|
client->localClient->auth_request = request;
|
||||||
request->fd = -1;
|
request->fd = -1;
|
||||||
request->client = client;
|
request->client = client;
|
||||||
request->timeout = CurrentTime + ConfigFileEntry.connect_timeout;
|
request->timeout = rb_current_time() + ConfigFileEntry.connect_timeout;
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ timeout_auth_queries_event(void *notused)
|
||||||
{
|
{
|
||||||
auth = ptr->data;
|
auth = ptr->data;
|
||||||
|
|
||||||
if(auth->timeout < CurrentTime)
|
if(auth->timeout < rb_current_time())
|
||||||
{
|
{
|
||||||
if(auth->fd >= 0)
|
if(auth->fd >= 0)
|
||||||
rb_close(auth->fd);
|
rb_close(auth->fd);
|
||||||
|
@ -452,7 +452,7 @@ timeout_auth_queries_event(void *notused)
|
||||||
sendheader(auth->client, REPORT_FAIL_DNS);
|
sendheader(auth->client, REPORT_FAIL_DNS);
|
||||||
}
|
}
|
||||||
|
|
||||||
auth->client->localClient->lasttime = CurrentTime;
|
auth->client->localClient->lasttime = rb_current_time();
|
||||||
release_auth_client(auth);
|
release_auth_client(auth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
26
src/s_conf.c
26
src/s_conf.c
|
@ -935,17 +935,17 @@ conf_connect_allowed(struct sockaddr *addr, int aftype)
|
||||||
void
|
void
|
||||||
add_temp_kline(struct ConfItem *aconf)
|
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]);
|
rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_WEEK]);
|
||||||
aconf->port = 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]);
|
rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_DAY]);
|
||||||
aconf->port = 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]);
|
rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_HOUR]);
|
||||||
aconf->port = TEMP_HOUR;
|
aconf->port = TEMP_HOUR;
|
||||||
|
@ -969,17 +969,17 @@ add_temp_kline(struct ConfItem *aconf)
|
||||||
void
|
void
|
||||||
add_temp_dline(struct ConfItem *aconf)
|
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]);
|
rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_WEEK]);
|
||||||
aconf->port = 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]);
|
rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_DAY]);
|
||||||
aconf->port = 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]);
|
rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_HOUR]);
|
||||||
aconf->port = TEMP_HOUR;
|
aconf->port = TEMP_HOUR;
|
||||||
|
@ -1012,7 +1012,7 @@ expire_temp_kd(void *list)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
aconf = ptr->data;
|
||||||
|
|
||||||
if(aconf->hold <= CurrentTime)
|
if(aconf->hold <= rb_current_time())
|
||||||
{
|
{
|
||||||
/* Alert opers that a TKline expired - Hwy */
|
/* Alert opers that a TKline expired - Hwy */
|
||||||
if(ConfigFileEntry.tkline_expire_notices)
|
if(ConfigFileEntry.tkline_expire_notices)
|
||||||
|
@ -1037,7 +1037,7 @@ reorganise_temp_kd(void *list)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
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) ?
|
rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ?
|
||||||
&temp_klines[TEMP_MIN] : &temp_dlines[TEMP_MIN]);
|
&temp_klines[TEMP_MIN] : &temp_dlines[TEMP_MIN]);
|
||||||
|
@ -1045,14 +1045,14 @@ reorganise_temp_kd(void *list)
|
||||||
}
|
}
|
||||||
else if(aconf->port > TEMP_HOUR)
|
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) ?
|
rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ?
|
||||||
&temp_klines[TEMP_HOUR] : &temp_dlines[TEMP_HOUR]);
|
&temp_klines[TEMP_HOUR] : &temp_dlines[TEMP_HOUR]);
|
||||||
aconf->port = TEMP_HOUR;
|
aconf->port = TEMP_HOUR;
|
||||||
}
|
}
|
||||||
else if(aconf->port > TEMP_DAY &&
|
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) ?
|
rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ?
|
||||||
&temp_klines[TEMP_DAY] : &temp_dlines[TEMP_DAY]);
|
&temp_klines[TEMP_DAY] : &temp_dlines[TEMP_DAY]);
|
||||||
|
@ -1377,18 +1377,18 @@ write_confitem(KlineType type, struct Client *source_p, char *user,
|
||||||
rb_snprintf(buffer, sizeof(buffer),
|
rb_snprintf(buffer, sizeof(buffer),
|
||||||
"\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n",
|
"\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n",
|
||||||
user, host, reason, oper_reason, current_date,
|
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)
|
else if(type == DLINE_TYPE)
|
||||||
{
|
{
|
||||||
rb_snprintf(buffer, sizeof(buffer),
|
rb_snprintf(buffer, sizeof(buffer),
|
||||||
"\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n", host,
|
"\"%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)
|
else if(type == RESV_TYPE)
|
||||||
{
|
{
|
||||||
rb_snprintf(buffer, sizeof(buffer), "\"%s\",\"%s\",\"%s\",%ld\n",
|
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)
|
if(fputs(buffer, out) == -1)
|
||||||
|
|
|
@ -121,7 +121,7 @@ expire_glines()
|
||||||
kill_ptr = gline_node->data;
|
kill_ptr = gline_node->data;
|
||||||
|
|
||||||
/* these are in chronological order */
|
/* these are in chronological order */
|
||||||
if(kill_ptr->hold > CurrentTime)
|
if(kill_ptr->hold > rb_current_time())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rb_dlinkDestroy(gline_node, &glines);
|
rb_dlinkDestroy(gline_node, &glines);
|
||||||
|
@ -151,7 +151,7 @@ expire_pending_glines()
|
||||||
glp_ptr = pending_node->data;
|
glp_ptr = pending_node->data;
|
||||||
|
|
||||||
if(((glp_ptr->last_gline_time + GLINE_PENDING_EXPIRE) <=
|
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);
|
rb_free(glp_ptr->reason1);
|
||||||
|
|
|
@ -210,7 +210,7 @@ smalldate(void)
|
||||||
{
|
{
|
||||||
static char buf[MAX_DATE_STRING];
|
static char buf[MAX_DATE_STRING];
|
||||||
struct tm *lt;
|
struct tm *lt;
|
||||||
time_t ltime = CurrentTime;
|
time_t ltime = rb_current_time();
|
||||||
|
|
||||||
lt = localtime(<ime);
|
lt = localtime(<ime);
|
||||||
|
|
||||||
|
|
|
@ -693,7 +693,7 @@ expire_temp_rxlines(void *unused)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
aconf = ptr->data;
|
||||||
|
|
||||||
if(aconf->hold && aconf->hold <= CurrentTime)
|
if(aconf->hold && aconf->hold <= rb_current_time())
|
||||||
{
|
{
|
||||||
if(ConfigFileEntry.tkline_expire_notices)
|
if(ConfigFileEntry.tkline_expire_notices)
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
|
@ -710,7 +710,7 @@ expire_temp_rxlines(void *unused)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
aconf = ptr->data;
|
||||||
|
|
||||||
if(aconf->hold && aconf->hold <= CurrentTime)
|
if(aconf->hold && aconf->hold <= rb_current_time())
|
||||||
{
|
{
|
||||||
if(ConfigFileEntry.tkline_expire_notices)
|
if(ConfigFileEntry.tkline_expire_notices)
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
|
@ -725,7 +725,7 @@ expire_temp_rxlines(void *unused)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
aconf = ptr->data;
|
||||||
|
|
||||||
if(aconf->hold && aconf->hold <= CurrentTime)
|
if(aconf->hold && aconf->hold <= rb_current_time())
|
||||||
{
|
{
|
||||||
if(ConfigFileEntry.tkline_expire_notices)
|
if(ConfigFileEntry.tkline_expire_notices)
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
|
@ -754,7 +754,7 @@ add_nd_entry(const char *name)
|
||||||
nd = BlockHeapAlloc(nd_heap);
|
nd = BlockHeapAlloc(nd_heap);
|
||||||
|
|
||||||
strlcpy(nd->name, name, sizeof(nd->name));
|
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 */
|
/* this list is ordered */
|
||||||
rb_dlinkAddTail(nd, &nd->lnode, &nd_list);
|
rb_dlinkAddTail(nd, &nd->lnode, &nd_list);
|
||||||
|
@ -785,7 +785,7 @@ expire_nd_entries(void *unused)
|
||||||
/* this list is ordered - we can stop when we hit the first
|
/* this list is ordered - we can stop when we hit the first
|
||||||
* entry that doesnt expire..
|
* entry that doesnt expire..
|
||||||
*/
|
*/
|
||||||
if(nd->expire > CurrentTime)
|
if(nd->expire > rb_current_time())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
free_nd_entry(nd);
|
free_nd_entry(nd);
|
||||||
|
@ -808,7 +808,7 @@ add_tgchange(const char *host)
|
||||||
target->pnode = pnode;
|
target->pnode = pnode;
|
||||||
|
|
||||||
target->ip = rb_strdup(host);
|
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);
|
rb_dlinkAdd(target, &target->node, &tgchange_list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -370,7 +370,7 @@ try_connections(void *unused)
|
||||||
* made one successfull connection... [this algorithm is
|
* made one successfull connection... [this algorithm is
|
||||||
* a bit fuzzy... -- msa >;) ]
|
* a bit fuzzy... -- msa >;) ]
|
||||||
*/
|
*/
|
||||||
if(tmp_p->hold > CurrentTime)
|
if(tmp_p->hold > rb_current_time())
|
||||||
{
|
{
|
||||||
if(next > tmp_p->hold || next == 0)
|
if(next > tmp_p->hold || next == 0)
|
||||||
next = tmp_p->hold;
|
next = tmp_p->hold;
|
||||||
|
@ -378,7 +378,7 @@ try_connections(void *unused)
|
||||||
}
|
}
|
||||||
|
|
||||||
confrq = get_con_freq(cltmp);
|
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
|
* Found a CONNECT config with port specified, scan clients
|
||||||
|
@ -1079,7 +1079,7 @@ server_estab(struct Client *client_p)
|
||||||
SetServlink(client_p);
|
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->servptr = &me;
|
||||||
|
|
||||||
|
@ -1113,7 +1113,7 @@ server_estab(struct Client *client_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
client_p->serv->nameinfo = scache_connect(client_p->name, client_p->info, IsHidden(client_p));
|
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 */
|
/* fixing eob timings.. -gnp */
|
||||||
|
|
||||||
if((rb_dlink_list_length(&lclient_list) + rb_dlink_list_length(&serv_list)) >
|
if((rb_dlink_list_length(&lclient_list) + rb_dlink_list_length(&serv_list)) >
|
||||||
|
|
|
@ -76,7 +76,7 @@ tstats(struct Client *source_p)
|
||||||
sp->is_sbr += target_p->localClient->receiveB;
|
sp->is_sbr += target_p->localClient->receiveB;
|
||||||
sp->is_sks += target_p->localClient->sendK;
|
sp->is_sks += target_p->localClient->sendK;
|
||||||
sp->is_skr += target_p->localClient->receiveK;
|
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++;
|
sp->is_sv++;
|
||||||
if(sp->is_sbs > 1023)
|
if(sp->is_sbs > 1023)
|
||||||
{
|
{
|
||||||
|
@ -98,7 +98,7 @@ tstats(struct Client *source_p)
|
||||||
sp->is_cbr += target_p->localClient->receiveB;
|
sp->is_cbr += target_p->localClient->receiveB;
|
||||||
sp->is_cks += target_p->localClient->sendK;
|
sp->is_cks += target_p->localClient->sendK;
|
||||||
sp->is_ckr += target_p->localClient->receiveK;
|
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++;
|
sp->is_cl++;
|
||||||
if(sp->is_cbs > 1023)
|
if(sp->is_cbs > 1023)
|
||||||
{
|
{
|
||||||
|
|
|
@ -261,7 +261,7 @@ register_local_user(struct Client *client_p, struct Client *source_p, const char
|
||||||
if(rb_dlink_list_length(&source_p->preClient->dnsbl_queries) > 0)
|
if(rb_dlink_list_length(&source_p->preClient->dnsbl_queries) > 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
client_p->localClient->last = CurrentTime;
|
client_p->localClient->last = rb_current_time();
|
||||||
/* Straight up the maximum rate of flooding... */
|
/* Straight up the maximum rate of flooding... */
|
||||||
source_p->localClient->allow_read = MAX_FLOOD_BURST;
|
source_p->localClient->allow_read = MAX_FLOOD_BURST;
|
||||||
|
|
||||||
|
|
12
src/scache.c
12
src/scache.c
|
@ -105,7 +105,7 @@ find_or_add(const char *name)
|
||||||
strlcpy(ptr->name, name, sizeof(ptr->name));
|
strlcpy(ptr->name, name, sizeof(ptr->name));
|
||||||
ptr->info[0] = '\0';
|
ptr->info[0] = '\0';
|
||||||
ptr->flags = 0;
|
ptr->flags = 0;
|
||||||
ptr->known_since = CurrentTime;
|
ptr->known_since = rb_current_time();
|
||||||
ptr->last_connect = 0;
|
ptr->last_connect = 0;
|
||||||
ptr->last_split = 0;
|
ptr->last_split = 0;
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ scache_connect(const char *name, const char *info, int hidden)
|
||||||
ptr->flags |= SC_HIDDEN;
|
ptr->flags |= SC_HIDDEN;
|
||||||
else
|
else
|
||||||
ptr->flags &= ~SC_HIDDEN;
|
ptr->flags &= ~SC_HIDDEN;
|
||||||
ptr->last_connect = CurrentTime;
|
ptr->last_connect = rb_current_time();
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ scache_split(struct scache_entry *ptr)
|
||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
return;
|
return;
|
||||||
ptr->flags &= ~SC_ONLINE;
|
ptr->flags &= ~SC_ONLINE;
|
||||||
ptr->last_split = CurrentTime;
|
ptr->last_split = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *scache_get_name(struct scache_entry *ptr)
|
const char *scache_get_name(struct scache_entry *ptr)
|
||||||
|
@ -168,9 +168,9 @@ scache_send_flattened_links(struct Client *source_p)
|
||||||
!ConfigServerHide.disable_hidden)
|
!ConfigServerHide.disable_hidden)
|
||||||
show = FALSE;
|
show = FALSE;
|
||||||
else if (scache_ptr->flags & SC_ONLINE)
|
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
|
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)
|
if (show)
|
||||||
sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS),
|
sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS),
|
||||||
scache_ptr->name, me.name, 1, scache_ptr->info);
|
scache_ptr->name, me.name, 1, scache_ptr->info);
|
||||||
|
@ -203,7 +203,7 @@ scache_send_missing(struct Client *source_p)
|
||||||
scache_ptr = scache_hash[i];
|
scache_ptr = scache_hash[i];
|
||||||
while (scache_ptr)
|
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)",
|
sendto_one_numeric(source_p, RPL_MAP, "** %s (recently split)",
|
||||||
scache_ptr->name);
|
scache_ptr->name);
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ void add_history(struct Client *client_p, int online)
|
||||||
del_whowas_from_list(&WHOWASHASH[who->hashv], who);
|
del_whowas_from_list(&WHOWASHASH[who->hashv], who);
|
||||||
}
|
}
|
||||||
who->hashv = hash_whowas_name(client_p->name);
|
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
|
* NOTE: strcpy ok here, the sizes in the client struct MUST
|
||||||
* match the sizes in the whowas struct
|
* match the sizes in the whowas struct
|
||||||
|
@ -118,7 +118,7 @@ struct Client *get_history(const char *nick, time_t timelimit)
|
||||||
struct Whowas *temp;
|
struct Whowas *temp;
|
||||||
int blah;
|
int blah;
|
||||||
|
|
||||||
timelimit = CurrentTime - timelimit;
|
timelimit = rb_current_time() - timelimit;
|
||||||
blah = hash_whowas_name(nick);
|
blah = hash_whowas_name(nick);
|
||||||
temp = WHOWASHASH[blah];
|
temp = WHOWASHASH[blah];
|
||||||
for (; temp; temp = temp->next)
|
for (; temp; temp = temp->next)
|
||||||
|
|
Loading…
Reference in a new issue