Handling large POST data in nginx module

Maxim Dounin mdounin at mdounin.ru
Mon Mar 31 12:59:14 UTC 2014


Hello!

On Sun, Mar 30, 2014 at 12:20:30PM +0200, Mapper Uno wrote:

> Hi,
> 
> I wrote an nginx module that handles POST data and returns back the same
> (something similar to echo_read_request_body  in echo module) however,
> in echo module the input buffer is passed as is to output buffer.
> However, in my case, I need to copy the incoming buffer and then process
> it and then send it back to client.
> 
> What I am seeing in my POST handler routine is, the incoming request
> size is 1377344 bytes. However, the file I am sending via curl command
> is 1420448 bytes. Where could I be losing the rest of the bytes.
> Moreover the curl command on client hangs for a while and eventually
> returns 18 error code.

First of all, make sure to use curl properly.

In particular, curl --data is identical to --data-ascii, while for 
binary data --data-binary must be used.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list