Welcome! Log In Create A New Profile

Advanced

Re: XSLT2 - new module, reviews and opinions needed :)

October 15, 2009 09:49AM
Many thanks for your comments!

Ad 1. You're right. We changed the code style and now it should be consistent and similar to Nginx style. ;)

Ad 2. This is interesting. We've thought about using an upstream, what is more, we've tried to do it. ;) However, our module allows to download simultaneously a lot of files, when upstream allows to download only one per one request. Am I wrong? Is it possible to download simultaneously a few files using upstream?

When it comes to gethostbyname - ofc you're right again, we will think about this. ;) Any suggestions?

Ad 3. Right, corrected.

Ad 4. This is interesting too. I’ve changed code by adding just “r->count++;” and removing “r->buffered = 1;” and it seems to work. Independently of value returned from body_filter function. When it returns NGX_OK it works, when it returns NGX_DONE after last chain - it works too... What should be returned?

Furthermore, is it all about r->count? Just increment it and forget? Only way to learn that mechanism is reading source code of Nginx? Is it described anywhere? We’ve tried to look for information about asynchronous work of filters, but we haven’t found anything except existing modules and their source code. ;)

New version of code with r->count is available at sourceforge SVN: http://xxslt.svn.sourceforge.net/viewvc/xxslt/http/modules/xslt2/ngx_http_xslt2_filter_module.c?view=markup

5. One more thing – collecting data from incoming buffer chains. I’ve seen in other modules (for example in xslt) strange way to collect all buffers and process them after getting the last one. You have to copy the content, set in->buf->pos = in->buf->last (that isn’t intuitive ;)) and return NGX_OK from body_filter for each buffer chain. Is it only way to do it?

This has an important disadvantage – we can’t keep pointers to that buffers, because their content is changed by nginx later. We’ve tried to set some flags in buffers with no interesting result. ;)

We would like to collect pointers to buffers, don’t copy their content and in some cases – return original, unmodified buffer chains after obtaining the last buffer chain (= after reading whole incoming data). Can we do it without copying all of them?
Subject Author Posted

XSLT2 - new module, reviews and opinions needed :)

piotreek October 14, 2009 06:46AM

Re: XSLT2 - new module, reviews and opinions needed :)

Maxim Dounin October 14, 2009 07:48AM

Re: XSLT2 - new module, reviews and opinions needed :)

piotreek October 15, 2009 09:49AM

Re: XSLT2 - new module, reviews and opinions needed :)

Maxim Dounin October 15, 2009 12:06PM

Re: XSLT2 - new module, reviews and opinions needed :)

piotreek October 21, 2009 06:30AM

Re: XSLT2 - new module, reviews and opinions needed :)

Maxim Dounin October 21, 2009 12:28PM

Re: XSLT2 - new module, reviews and opinions needed :)

piotreek October 21, 2009 09:39AM

Re: XSLT2 - new module, reviews and opinions needed :)

Maxim Dounin October 21, 2009 12:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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