[OpenSIPS-Devel] [opensips] ASYNC_CHANGE_FD status + db engine async state parameter + db_virtual async (#715)

Liviu Chircu notifications at github.com
Wed Feb 17 18:37:26 CET 2016


> +{
> +	handle_async_t* _ah;
> +    handle_con_t * _handle;
> +    handle_set_t * _p = (handle_set_t*)_h->tail;
> +
> +	if (_s->len > 16384) {
> +		LM_ERR("query exceeds buffer size(16384)!\n");
> +		return -1;
> +	}
> +
> +	if ((_ah=pkg_malloc(sizeof(handle_async_t)+_s->len)) == NULL) {
> +		LM_ERR("no more pkg\n");
> +		return -1;
> +	} else {
> +		/* for RR next time the script shall trigger this,
> +		 * other dest shall be called*/

I literally had to read the code in order to understand the comment, rather than vice-verse!

Rule of thumb: when it comes to formulating comments, two things should come to mind: **well-written** vs. **badly-written** (language, acronyms, doc templates, coding style, etc.). **insightful** vs. **impeding** (usefulness of the comment itself: do you really have to *explain how round-robin works*, or simply that this code just does a *"round-robin increment"*?)

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/715/files#r53200651
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20160217/37f87fad/attachment.htm>


More information about the Devel mailing list