<div dir="ltr">I found this on the web :<div><br></div><div><div>static ngx_str_t* ngx_http_uploadprogress_strdup(ngx_str_t *src, ngx_log_t * log) {</div><div> ngx_str_t *dst;</div><div> dst = ngx_alloc(src->len + sizeof(ngx_str_t), log);</div><div> if (dst == NULL) {</div><div> return NULL;</div><div> }</div><div><br></div><div> dst->len = src->len;</div><div> ngx_memcpy(((char*)dst + sizeof(ngx_str_t)) , src->data, src->len);</div><div> dst->data = ((u_char*)dst + sizeof(ngx_str_t));</div><div> return dst;</div><div>}</div></div><div><br></div><div><br></div><div>Was wondering if there was smthg in the api that would achieve the same thing. Thx for the <span style="font-size:12.8px">ngx_pstrdup() suggestion I've look at it , but didnt want to go all the way with the pool etc .</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 21, 2016 at 11:26 AM, Valentin V. Bartenev <span dir="ltr"><<a href="mailto:vbart@nginx.com" target="_blank">vbart@nginx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Friday 21 October 2016 11:17:40 Mathieu Vachon wrote:<br>
> Hi there,<br>
><br>
> Despite reading the api manual, i cant seem to find a function to duplicate<br>
> a ngx_str_t to another.<br>
><br>
> Did i miss it , or have to roll my own duplicate stuff ?<br>
><br>
<br>
</span>ngx_pstrdup()?<br>
<br>
wbr, Valentin V. Bartenev<br>
<br>
______________________________<wbr>_________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx-devel</a><br>
</blockquote></div><br></div>