2 messages in ru.sysoev.nginx[dev] ngx_write_chain_to_temp_file an...
FromSent OnAttachments
Manlio PerilloNov 27, 2007 10:08 am 
Igor SysoevNov 27, 2007 12:35 pm 
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:[dev] ngx_write_chain_to_temp_file and NGX_AGAINActions...
From:Manlio Perillo (manl@public.gmane.org)
Date:Nov 27, 2007 10:08:08 am
List:ru.sysoev.nginx

Hi.

I'm reading the code for writing a temporary buffer in a temporary file, and I have noted something not very clear.

Here is the code (core/ngx_file.c): ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain) { ngx_int_t rc;

if (tf->file.fd == NGX_INVALID_FILE) { rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool, tf->persistent, tf->clean, tf->access);

if (rc == NGX_ERROR || rc == NGX_AGAIN) { return rc; }

However it seems that ngx_create_temp_file never returns NGX_AGAIN.

Moreover the functions ngx_event_pipe_write_chain_to_temp_file (event/ngx_event_pipe.c) and ngx_http_write_request_body (http/ngx_http_request_body) only check for NGX_ERROR and not for NGX_AGAIN.

So, should I check for NGX_ERROR only?