Welcome! Log In Create A New Profile

Advanced

processing request body in files

Jeff Kaufman
August 08, 2014 10:46AM
In ngx_pagespeed we want to handle POSTs, processing them in our nginx
module and performing an action. This works fine for small POSTs, but
if they're too big then r->request_body->temp_file is set and the data
isn't available in memory. Right now we just log an error, but I'd
like to fix this.

To read from that file, is it safe to just call
ngx_open_tempfile(r->request_body->temp_file->file.name, ...) and then
ngx_read_file() until that returns 0 for EOF (like standard unix) or
an error? Or is there something more complex we need to do?

(I've looked for existing modules that do this, but haven't found any.
I'm not finding any modules that currently do that; just ones that
issue a rename command to move r->request_body->temp_file into the
final destination.)

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

processing request body in files

Jeff Kaufman 619 August 08, 2014 10:46AM

Re: processing request body in files

Maxim Dounin 314 August 08, 2014 12:44PM

Re: processing request body in files

Jeff Kaufman 341 August 11, 2014 09:36AM



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

Online Users

Guests: 169
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