understanding ngx_str_t structure

Roman Arutyunyan arut at nginx.com
Fri Sep 27 11:05:27 UTC 2019

On Fri, Sep 27, 2019 at 06:51:12AM -0400, astre wrote:
> Thanks Roman, it is working. Is there a way to directly print using
> std::cout instead of ngx_log_* functions ?
> P.S: I'm writing module in C++.

You can use string length in the 'len' field to limit the number of characters
printed.  There are many ways to do that, for example:

std::cout.write(r->uri.data, r->uri.len);

> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,285729,285731#msg-285731
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

PS: it is better to ask development questions in the nginx-devel mailing list:

Roman Arutyunyan

More information about the nginx mailing list