<p>In modules/exec/exec.c:</p>
<pre style='color:#555'>> +                if ((buflen + tmplen) >= MAX_BUF_SIZE) {
> +                        LM_WARN("no more space in output buffer\n");
> +                        break;
> +                }
> +                memcpy(buf+buflen, tmpbuf, tmplen);
> +                buflen += tmplen;
> +
> +                outval.flags = PV_VAL_STR;
> +                outval.rs.s = buf;
> +                outval.rs.len = buflen;
> +
> +                if (buflen &&
> +                        pv_set_value(msg, &outvar->v.pve->spec, 0, &outval) < 0) {
> +                        LM_ERR("cannot set output pv value\n");
> +                        return -1;
> +                }
</pre>
<p>Seems redundant to re-set outval.flags and rs.s every iteration (and rs.len for that matter).</p>
<p>Shouldn't you move everything from outval.flags to the end of this block to outside the <code>while{}</code>?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/pull/375/files#r19525189">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOcicmUNvH1_xhV9pjvhYOVyR9CkoQXks5nIKH7gaJpZM4Cz-_8.gif" width="1" /></p>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"View this Pull Request on GitHub","action":{"@type":"ViewAction","url":"https://github.com/OpenSIPS/opensips/pull/375/files#r19525189","name":"View Pull Request"}}</script>