Welcome! Log In Create A New Profile

Advanced

Re: Nginx Module (I/O block)

Maxim Dounin
March 07, 2013 09:10AM
Hello!

On Wed, Mar 06, 2013 at 05:56:15PM +0100, alexander_koch_log wrote:

> Hi,
>
> On 03/06/2013 01:50 PM, Maxim Dounin wrote:
> >Hello!
> >>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?
> >As e.g. with sendfile used file's data is never available in
> >user memory, the answer is no.
> >
> >>One way would be to read to the buffer then truncate the memory,
> >>then send the buffer? Or is there an efficient way?
> >What you are trying to do is probably beter handled by a filter
> >module. You may ask nginx to read a file into memory buffers
> >(output_buffers), and then inspect/modify all data passed though
> >you filter.
> >
>
> So the downside of this method would be to not use sendfile and deal
> with the over of read/write, correct?

You can't use sendfile if you have to scan file contents for a
special byte.

By writing a filter you may avoid reinventing the wheel and doing
file reads yourself. Downside is that you have to write filter
which is expected to work with a data stream, which is not always
feasible.

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
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 982 February 09, 2013 10:42AM

Re: Nginx Module (I/O block)

Maxim Dounin 500 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 476 March 06, 2013 07:52AM

Re: Nginx Module (I/O block)

alexander_koch_log 398 March 06, 2013 11:58AM

Re: Nginx Module (I/O block)

Maxim Dounin 480 March 07, 2013 09:10AM



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

Online Users

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