> +             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;
> +             }

Seems redundant to re-set outval.flags and rs.s every iteration (and rs.len for 
that matter).

Shouldn't you move everything from outval.flags to the end of this block to 
outside the `while{}`?

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/375/files#r19525189
_______________________________________________
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel

Reply via email to