nginx POST field data processing (Was Re: Introducing Nginx Guts blog)

Ranier ranier at cultura.com.br
Mon Jan 24 22:18:25 MSK 2011


Hi, agentzh.

->Please please do not capitalize my nick.
Oh, Sorry.I did not  know.

"You mean reading one field requires parsing through the whole request
body? Yeah, it's currently designed this way, just like nginx's
$arg_FIELD always walk through the whole query string buffer every
time. One may argue that query strings can not be huge while request
bodies can be of megas of bytes, and I agree it's suboptimal for big
chunk of data when there's lots of fields to be processed :)"

I mean, is better to my purpose, read all fields in one pass.
Preferably  storing in array of ngx_str_t.

"Putting data into nginx variables requires an additional data copy.
Are you suggesting any other places that introduces unnecessary data
copies?"

ngx_str_t var to each post field, I mean, array of ngx_str_t
I agree. ngx_str_t is not the best place, but,I'm  currently using.
Of course one ngx_str_t for each post field (maybe more memory use...)

"Putting data into nginx variables requires an additional data copy.
Are you suggesting any other places that introduces unnecessary data
copies?"

Maybe array of ngx_str_t.
Drawback: name of field? Yes, to store name field, more ngx_str_t, more memory.

"Nginx variables do have their own memory footprint and for the sake of
ngx_form_input's UI, it's inevitable :"

I agree. Sorry,my inexperience,I  was not  thinking straight.

"POST fields are (usually) encoded as URI components, are you
suggesting in-place URI decoding? (In-place request body processing
may have bad side-effects that you do not want.) Also...how about the
POST body is big enough for nginx to put it onto temporary disk files?"
Of course,I had  forgotten POST FIELDS like input files...

Please,did not want to  belittle  your  module.
For me, wasenough pointer to fields posts.
r->header_in->pos solve my needs.
Maybe one pointer like r->post_fieldswould be  great.

Thanky you for the patience and attention.

Ranier Vilela
PS. Sorry, my english is terrible. ;)




More information about the nginx-devel mailing list