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

Comparing ircd-hybrid/trunk/src/send.c (file contents):
Revision 4213 by michael, Mon Jul 14 09:26:05 2014 UTC vs.
Revision 4431 by michael, Thu Aug 7 19:04:30 2014 UTC

# Line 916 | Line 916 | sendto_realops_flags(unsigned int flags,
916   *                (at most 5 warnings every 5 seconds)
917   */
918   void
919 < sendto_realops_flags_ratelimited(const char *pattern, ...)
919 > sendto_realops_flags_ratelimited(time_t *rate, const char *pattern, ...)
920   {
921    va_list args;
922    char buffer[IRCD_BUFSIZE] = "";
923 –  static time_t last = 0;
924 –  static int warnings = 0;
923  
924 <  if (CurrentTime - last < 5)
925 <  {
926 <    if (++warnings > 5)
929 <      return;
930 <  }
931 <  else
932 <  {
933 <    last = CurrentTime;
934 <    warnings = 0;
935 <  }
924 >  if ((CurrentTime - *rate) < 20)
925 >    return;
926 >  *rate = CurrentTime;
927  
928    va_start(args, pattern);
929    vsnprintf(buffer, sizeof(buffer), pattern, args);

Diff Legend

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