[OpenSIPS-Devel] [opensips] Slot Based Taildrop algorithm for ratelimit (#728)

Răzvan Crainea notifications at github.com
Mon Jan 4 16:47:52 CET 2016


> +	return hist_counter;
> +}
> +
> +
> +
> +/**
> + * the algorithm keeps a circular window of requests in a fixed size buffer
> + *
> + * @param pipe   containing the window
> + * @param update whether or not to inc call number
> + * @return number of calls in the window
> + */
> +static inline int hist_check(rl_pipe_t *pipe)
> +{
> +	/* Window ELement*/
> +	#define WEL(__el__) pipe->rwin.__el__

This is really bad programming - use the structure and its field!

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/728/files#r48743447
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20160104/6edd667b/attachment.htm>


More information about the Devel mailing list