Couple questions about module behaviour

hungnv at opensource.com.vn hungnv at opensource.com.vn
Thu Feb 12 04:05:34 UTC 2015


Hello, 

I am doing some research and writing small modules using nginx. One of the modules is serving file which is generated dynamically based on user’s request. I found it’s hard to handle 2 states of user’s connection: 

1. When user request for object A and object A is being generated, server is processing user’s input to produce output, user closes browser, but server still produce output and just fire an error when it finished all the work and give output buffer to next filter. How to prevent this happens? 
2. When user request large static file, lets say we are using mp4 module, a user requests a 1GB file, he just downloaded 100MB then close the browser, nginx log module produce number of bytes sent in log file is the file size (which is the content length). How to know exactly how many bytes server sent to client (number of bytes that client actually received)? 

Thanks. 

 

--
Hưng
Email: hungnv at opensource.com.vn





More information about the nginx-devel mailing list