comparison src/os/unix/ngx_files.c @ 238:a528ae0fe909 NGINX_0_4_4

nginx 0.4.4 *) Feature: the $scheme variable. *) Feature: the "expires" directive supports the "max" parameter. *) Feature: the "include" directive supports the "*" mask. Thanks to Jonathan Dance. *) Bugfix: the "return" directive always overrode the "error_page" response code redirected by the "error_page" directive. *) Bugfix: a segmentation fault occurred if zero-length body was in PUT method. *) Bugfix: the redirect was changed incorrectly if the variables were used in the "proxy_redirect" directive.
author Igor Sysoev <http://sysoev.ru>
date Mon, 02 Oct 2006 00:00:00 +0400
parents 38e7b94d63ac
children 7d7cee0d62e0
comparison
equal deleted inserted replaced
237:302a8e8b4ae7 238:a528ae0fe909
251 251
252 return NGX_OK; 252 return NGX_OK;
253 } 253 }
254 254
255 255
256 ngx_int_t
257 ngx_open_glob(ngx_glob_t *gl)
258 {
259 if (glob((char *) gl->pattern, 0, NULL, &gl->pglob) == 0) {
260 return NGX_OK;
261 }
262
263 return NGX_ERROR;
264 }
265
266
267 ngx_int_t
268 ngx_read_glob(ngx_glob_t *gl, ngx_str_t *name)
269 {
270 if (gl->n < gl->pglob.gl_pathc) {
271
272 name->len = (size_t) ngx_strlen(gl->pglob.gl_pathv[gl->n]);
273 name->data = (u_char *) gl->pglob.gl_pathv[gl->n];
274 gl->n++;
275
276 return NGX_OK;
277 }
278
279 return NGX_DONE;
280 }
281
282
283 void
284 ngx_close_glob(ngx_glob_t *gl)
285 {
286 globfree(&gl->pglob);
287 }
288
289
256 ngx_err_t 290 ngx_err_t
257 ngx_trylock_fd(ngx_fd_t fd) 291 ngx_trylock_fd(ngx_fd_t fd)
258 { 292 {
259 struct flock fl; 293 struct flock fl;
260 294