~ubuntu-branches/ubuntu/lucid/nginx/lucid-updates

« back to all changes in this revision

Viewing changes to src/http/modules/ngx_http_index_module.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2008-12-01 20:11:53 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20081201201153-q0ap33bcphfxriy3
Tags: 0.6.34-1ubuntu1
* Merge from debian unstable, remaining changes: (LP: #303916)
  + debian/control:
    - Add Depend on lsb >= 3.2-14, which has the status_of_proc() function.
  + debian/init.d:
    - Add sourcing to '. /lib/lsb/init-functions'
    - Add the 'status' action
  + Fixed FTBFS by properly defining IOV_MAX to its Linux equivelent.
  + Added dpatch based patch system

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
static ngx_int_t ngx_http_index_test_dir(ngx_http_request_t *r,
29
29
    ngx_http_core_loc_conf_t *clcf, u_char *path, u_char *last);
30
 
static ngx_int_t ngx_http_index_error(ngx_http_request_t *r, u_char *file,
31
 
    ngx_err_t err);
 
30
static ngx_int_t ngx_http_index_error(ngx_http_request_t *r,
 
31
    ngx_http_core_loc_conf_t *clcf, u_char *file, ngx_err_t err);
32
32
 
33
33
static ngx_int_t ngx_http_index_init(ngx_conf_t *cf);
34
34
static void *ngx_http_index_create_loc_conf(ngx_conf_t *cf);
225
225
            }
226
226
 
227
227
            if (of.err == NGX_ENOTDIR || of.err == NGX_EACCES) {
228
 
                return ngx_http_index_error(r, path.data, of.err);
 
228
                return ngx_http_index_error(r, clcf, path.data, of.err);
229
229
            }
230
230
 
231
231
            if (!dir_tested) {
303
303
 
304
304
            if (of.err == NGX_ENOENT) {
305
305
                *last = c;
306
 
                return ngx_http_index_error(r, dir.data, NGX_ENOENT);
 
306
                return ngx_http_index_error(r, clcf, dir.data, NGX_ENOENT);
 
307
            }
 
308
 
 
309
            if (of.err == NGX_EACCES) {
 
310
 
 
311
                *last = c;
 
312
 
 
313
                /*
 
314
                 * ngx_http_index_test_dir() is called after the first index
 
315
                 * file testing has returned an error distinct from NGX_EACCES.
 
316
                 * This means that directory searching is allowed.
 
317
                 */
 
318
 
 
319
                return NGX_OK;
307
320
            }
308
321
 
309
322
            ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,
327
340
 
328
341
 
329
342
static ngx_int_t
330
 
ngx_http_index_error(ngx_http_request_t *r, u_char *file, ngx_err_t err)
 
343
ngx_http_index_error(ngx_http_request_t *r, ngx_http_core_loc_conf_t  *clcf,
 
344
    u_char *file, ngx_err_t err)
331
345
{
332
346
    if (err == NGX_EACCES) {
333
347
        ngx_log_error(NGX_LOG_ERR, r->connection->log, err,
336
350
        return NGX_HTTP_FORBIDDEN;
337
351
    }
338
352
 
339
 
    ngx_log_error(NGX_LOG_ERR, r->connection->log, err,
340
 
                  "\"%s\" is not found", file);
 
353
    if (clcf->log_not_found) {
 
354
        ngx_log_error(NGX_LOG_ERR, r->connection->log, err,
 
355
                      "\"%s\" is not found", file);
 
356
    }
341
357
 
342
358
    return NGX_HTTP_NOT_FOUND;
343
359
}