<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div><div>Hello, </div><div><br></div><div>I guess there’s no problem using std::string or std::vector since ngx_pagespeed from Google uses them as well. </div><div>There must be something wrong with your own module, not nginx. </div><div><br></div><div>—</div><div>Hưng</div><div><br></div><div><div id="MAC_OUTLOOK_SIGNATURE"></div></div></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> nginx-devel <<a href="mailto:nginx-devel-bounces@nginx.org">nginx-devel-bounces@nginx.org</a>> on behalf of Rajalakshmi Iyer <<a href="mailto:rajalakshmi.iyer@blis.com">rajalakshmi.iyer@blis.com</a>><br><span style="font-weight:bold">Reply-To: </span> <<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a>><br><span style="font-weight:bold">Date: </span> Thursday, June 16, 2016 at 11:18 AM<br><span style="font-weight:bold">To: </span> <<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a>><br><span style="font-weight:bold">Subject: </span> Re: C++ module<br></div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div dir="auto"><div>Thanks everyone.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">I have been able to compile a C++ module fine. But I am primarily trying to figure out if it's safe to use features like STL containers or Boost libraries within an Nginx module.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">I am asking this because if I try to allocate an std::string within say the module context, I see a segmentation fault. I assume it's because of the Nginx pool mechanism?<br><br></div><div><br>On 16 Jun 2016, at 02:31, Hung Nguyen <<a href="mailto:hungnv@opensource.com.vn">hungnv@opensource.com.vn</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Hello, </div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Nginx comes with a demo module written in C++ in source code<br><br>Sent from my iPhone</div><div><br>On Jun 16, 2016, at 3:49 AM, Piotr Sikora <<a href="mailto:piotrsikora@google.com">piotrsikora@google.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Hey Raj,<div>it is, take a look at ngx_brotli [1] and ngx_pagespeed [2].</div><div><br></div><div>[1] <a href="https://github.com/google/ngx_brotli">https://github.com/google/ngx_brotli</a><br></div><div>[2] <a href="https://github.com/pagespeed/ngx_pagespeed">https://github.com/pagespeed/ngx_pagespeed</a></div><div><br></div><div>Best regards,</div><div>Piotr Sikora</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 15, 2016 at 8:27 AM, Rajalakshmi Iyer <span dir="ltr"><<a href="mailto:rajalakshmi.iyer@blis.com" target="_blank">rajalakshmi.iyer@blis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello, <div><br></div><div><div>Just wanted to check if it is possible to write NGINX modules in C++ that makes extensive use of the standard template library (STL)? If so, what are the things that one needs to be careful about? </div><div><br></div><div>Thanks in advance,</div><div>Raj</div><div data-smartmail="gmail_signature"><table border="0" cellpadding="0" cellspacing="0"><tbody align="left" valign="top"><tr><td style="vertical-align:top;text-align:left;white-space:nowrap"><br></td><td style="vertical-align:top;text-align:left;white-space:nowrap"><table border="0" cellpadding="0" cellspacing="0"><tbody align="left" valign="top">
</tbody>
</table>
</td>
</tr>
</tbody>
</table></div></div></div><br><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font color="#808080" size="1">This email and any attachments to it may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Blis Ltd, a company registered in England and Wales with registered number 06455773. Its registered office is 5th Floor, 85 Tottenham Court Road, London, W1T 4TQ, United Kingdom.</font></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font color="#808080" size="1"><br></font></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font color="#808080" size="1">If you are not the intended recipient of this email, you must neither take any action based upon its contents, nor copy or show it to anyone. Please contact the sender if you believe you have received this email in error.</font></div><br>_______________________________________________<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/mailman/listinfo/nginx-devel</a><br></blockquote></div><br></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>nginx-devel mailing list</span><br><span><a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a></span><br><span><a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a></span></div></blockquote></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>nginx-devel mailing list</span><br><span><a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a></span><br><span><a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a></span></div></blockquote></div></div><br><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font color="#808080" size="1">This email and any attachments to it may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Blis Ltd, a company registered in England and Wales with registered number 06455773. Its registered office is 5th Floor, 85 Tottenham Court Road, London, W1T 4TQ, United Kingdom.</font></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font color="#808080" size="1"><br></font></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font color="#808080" size="1">If you are not the intended recipient of this email, you must neither take any action based upon its contents, nor copy or show it to anyone. Please contact the sender if you believe you have received this email in error.</font></div>_______________________________________________
nginx-devel mailing list
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a></span></body></html>