Welcome! Log In Create A New Profile

Advanced

Re: Nginx Module (I/O block)

alexander_koch_log
March 05, 2013 06:02PM
On 02/10/2013 12:25 AM, Maxim Dounin wrote:
> Hello!
>
> On Sat, Feb 09, 2013 at 04:41:54PM +0100, alexander_koch_log wrote:
>
>> It is not clear to me how to avoid blocking the nginx reactor loop
>> when creating an nginx module which should perform some long I/O
>> operations and return the response to the client. Or is this
>> handled internally by Nginx?
> Correct aproach is to avoid blocking for a long time, and use
> non-blocking I/O and event-based notification instead.
>
> What exactly should (and can) be done depends on the exact case.
> E.g. to work with sockets there are lots of various functions
> available to simplify things. Working with files without blocking
> is harder and not always possible, but a common case is handled by
> nginx - to send some large file you just have to open the file and
> ask nginx to send an in-file buffer.
>

When sending an in-file buffer, is it still possible to have the read
stop when a special byte char is read like \xFF even though the provided
bytes to read are larger?

One way would be to read to the buffer then truncate the memory, then
send the buffer? Or is there an efficient way?

Thanks,

Alex


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

Nginx Module (I/O block)

alexander_koch_log 989 February 09, 2013 10:42AM

Re: Nginx Module (I/O block)

Maxim Dounin 501 February 09, 2013 06:26PM

Re: Nginx Module (I/O block)

alexander_koch_log 416 March 05, 2013 06:02PM

Re: Nginx Module (I/O block)

Maxim Dounin 477 March 06, 2013 07:52AM

Re: Nginx Module (I/O block)

alexander_koch_log 399 March 06, 2013 11:58AM

Re: Nginx Module (I/O block)

Maxim Dounin 481 March 07, 2013 09:10AM



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

Online Users

Guests: 141
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready