5 messages in ru.sysoev.nginxRe: [dev] how to read client body data
FromSent OnAttachments
Manlio PerilloAug 21, 2007 1:50 pm 
Manlio PerilloAug 21, 2007 2:13 pm 
Igor SysoevAug 21, 2007 9:59 pm 
Igor SysoevAug 21, 2007 10:01 pm 
Manlio PerilloAug 22, 2007 3:47 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [dev] how to read client body dataActions...
From:Manlio Perillo (manl@public.gmane.org)
Date:Aug 22, 2007 3:47:19 am
List:ru.sysoev.nginx

Igor Sysoev ha scritto:

[...]

The request->request_body->temp_file->file->fd handle is opened for read (and will be closed at request finalization)?

Yes. Do not forget to test

if (r->request_body && r->request_body->temp_file) {

Ok, so I can do:

if (r->request_body) { if (r->request_body->temp_file) { /* all the request body is in a temporary file */ fd = request_body->temp_file->file->fd; ... use the file descriptor for reading; no need to close it } else if (r->request_body->buf} /* all the request body is in a buffer */ } }

I'm right?