Welcome! Log In Create A New Profile

Advanced

nginx tempfiles

Nick Kew
August 28, 2014 08:54PM
I have a filter that may want to rewrite request bodies.

Stream-editing an nginx chain is straightforward enough
(the equivalent output filter works fine).
But as I understand it, I need to cater for a case where
a request body is in r->request_body->temp_file.
Assuming it's there for a reason, I thought the least-bad
approach would be to stream-edit it to another tempfile
and switch r->request_body->temp_file to that.

However, that approach appears to be pushing against
nginx's tempfile handling, from the moment I look at
ngx_create_temp_file and realise the amount of preparation
required to set up a path and file before calling it.

Will Bad Things happen if I simplify by using a system
call like mkstemp and then just substitute file->fd
in nginx's temp_file struct?

Or is this approach completely barking up the wrong tree?

--
Nick Kew

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

nginx tempfiles

Nick Kew 750 August 28, 2014 08:54PM

Re: nginx tempfiles

Maxim Dounin 342 August 29, 2014 09:28AM

Re: nginx tempfiles

Nick Kew 303 September 01, 2014 06:36AM

Re: nginx tempfiles

Valentin V. Bartenev 311 September 01, 2014 08:10AM

Re: nginx tempfiles

Maxim Dounin 387 September 01, 2014 08:40AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 139
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready