comparison src/os/unix/ngx_files.c @ 4:4b2dafa26fe2 NGINX_0_1_2

nginx 0.1.2 *) Feature: the --user=USER, --group=GROUP, and --with-ld-opt=OPTIONS options in configure. *) Feature: the server_name directive supports *.domain.tld. *) Bugfix: the portability improvements. *) Bugfix: if configuration file was set in command line, the reconfiguration was impossible; bug appeared in 0.1.1. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. *) Bugfix: with sendfile the response was not recoded according to the charset module directives; bug appeared in 0.1.1. *) Bugfix: very seldom bug in the kqueue processing. *) Bugfix: the gzip module compressed the proxied responses that was already compressed.
author Igor Sysoev <http://sysoev.ru>
date Thu, 21 Oct 2004 00:00:00 +0400
parents f0b350454894
children 80ba094c6b3e
comparison
equal deleted inserted replaced
3:8beaf7b3241f 4:4b2dafa26fe2
208 208
209 dir->info_valid = 0; 209 dir->info_valid = 0;
210 210
211 return NGX_OK; 211 return NGX_OK;
212 } 212 }
213
214
215 #if 0
216
217 ssize_t ngx_read_file(ngx_file_t *file, char *buf, size_t size, off_t offset)
218 {
219 if (!file->read->ready) {
220
221 ngx_memzero(&file->iocb, sizeof(iocb));
222 file->iocb.aio_fildes = file->fd;
223 file->iocb.aio_buf = buf;
224 file->iocb.aio_nbytes = size;
225 file->iocb.aio_offset = offset;
226 #if (USE_AIO_KQUEUE)
227 file->iocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
228 file->iocb.aio_sigevent.sigev_notify_kqueue = tid->kq;
229 file->iocb.aio_sigevent.sigev_value = (union sigval) file;
230 #endif
231 #if (USE_AIO_SIGNAL)
232 file->iocb.aio_sigevent.sigev_notify = SIGEV_SIGNAL;
233 file->iocb.aio_sigevent.sigev_signo = NGX_SIGAIO;
234 #ifndef __FreeBSD__
235 file->iocb.aio_sigevent.sigev_value.sival_ptr = file;
236 #endif
237 #endif
238
239 if (aio_read(&file->iocb) == -1) {
240 ngx_log_error(NGX_LOG_ERR, file->log, ngx_errno,
241 "aio_read() failed");
242 return NGX_ERROR;
243
244 n = aio_error(&file->iocb);
245 if (n == EINPROGRESS)
246 return NGX_AGAIN;
247
248 if (n == -1) {
249 ngx_log_error(NGX_LOG_ERR, file->log, ngx_errno,
250 "aio_read() failed");
251 return NGX_ERROR;
252 }
253 }
254
255 ngx_assert(file->iocb.aio_buf == buf), return NGX_ERROR,
256 "ngx_aio_read_file: another buffer is passed");
257
258 n = aio_return(&file->iocb);
259 if (n == -1) {
260 ngx_log_error(NGX_LOG_ERR, file->log, ngx_errno,
261 "aio_read() failed");
262 return NGX_ERROR;
263 }
264
265 return n;
266 }
267
268 #endif