resource->uri = r->uri;
}
- if (r->finfo.filetype != 0) {
+ if (r->finfo.filetype != APR_NOFILE) {
resource->exists = 1;
resource->collection = r->finfo.filetype == APR_DIR;
/* retain proper integrity across the structures */
if (!resource->exists) {
- ctx->finfo.filetype = 0;
+ ctx->finfo.filetype = APR_NOFILE;
}
}
}
if (res1->hooks != res2->hooks)
return 0;
- if ((ctx1->finfo.filetype != 0) && (ctx2->finfo.filetype != 0)
+ if ((ctx1->finfo.filetype != APR_NOFILE) && (ctx2->finfo.filetype != APR_NOFILE)
&& (ctx1->finfo.valid & ctx2->finfo.valid & APR_FINFO_INODE)) {
return ctx1->finfo.inode == ctx2->finfo.inode;
}
if (!resource->exists)
return apr_pstrdup(ctx->pool, "");
- if (ctx->finfo.filetype != 0) {
+ if (ctx->finfo.filetype != APR_NOFILE) {
return apr_psprintf(ctx->pool, "\"%" APR_UINT64_T_HEX_FMT "-%"
APR_UINT64_T_HEX_FMT "-%" APR_UINT64_T_HEX_FMT "\"",
(apr_uint64_t) ctx->finfo.inode,
we never attempt to "run" this sub request. */
rr = ap_sub_req_lookup_file(newpath, r, NULL);
- if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
+ if (rr->status == HTTP_OK && rr->finfo.filetype != APR_NOFILE) {
to_send = rr->filename;
if ((rv = apr_stat(finfo, to_send,
APR_FINFO_GPROT | APR_FINFO_MIN, rr->pool)) != APR_SUCCESS
we never attempt to "run" this sub request. */
rr = ap_sub_req_lookup_uri(tag_val, r, NULL);
- if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
+ if (rr->status == HTTP_OK && rr->finfo.filetype != APR_NOFILE) {
memcpy((char *) finfo, (const char *) &rr->finfo,
sizeof(rr->finfo));
ap_destroy_sub_req(rr);
r->allowed |= (AP_METHOD_BIT << M_GET);
if (r->method_number != M_GET)
return DECLINED;
- if (r->finfo.filetype == 0) {
+ if (r->finfo.filetype == APR_NOFILE) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"File does not exist: %s", r->filename);
return HTTP_NOT_FOUND;
return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
"attempt to include NPH CGI script");
- if (r->finfo.filetype == 0)
+ if (r->finfo.filetype == APR_NOFILE)
return log_scripterror(r, conf, HTTP_NOT_FOUND, 0,
"script not found or unable to stat");
if (r->finfo.filetype == APR_DIR)
#error mod_cgid does not work on this platform. If you teach it to, look
#error at mod_cgi.c for required code in this path.
#else
- if (r->finfo.filetype == 0)
+ if (r->finfo.filetype == APR_NOFILE)
return log_scripterror(r, conf, HTTP_NOT_FOUND, 0,
"script not found or unable to stat");
#endif
weak_len = sizeof(ETAG_WEAK);
}
- if (r->finfo.filetype != 0) {
+ if (r->finfo.filetype != APR_NOFILE) {
/*
* ETag gets set to [W/]"inode-size-mtime", modulo any
* FileETag keywords.
ap_field_noparam(r->pool, r->content_type);
if (action && (t = apr_table_get(conf->action_types, action))) {
- if (*t++ == '0' && r->finfo.filetype == 0) {
+ if (*t++ == '0' && r->finfo.filetype == APR_NOFILE) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"File does not exist: %s", r->filename);
return HTTP_NOT_FOUND;
}
/* We've already got a file of some kind or another */
- if (r->finfo.filetype != 0) {
+ if (r->finfo.filetype != APR_NOFILE) {
return DECLINED;
}
/* if ./.web/$1.meta exists then output 'asis' */
- if (r->finfo.filetype == 0) {
+ if (r->finfo.filetype == APR_NOFILE) {
return DECLINED;
};
switch (code[0]) {
case 'M':
- if (r->finfo.filetype == 0) {
+ if (r->finfo.filetype == APR_NOFILE) {
/* file doesn't exist on disk, so we can't do anything based on
* modification time. Note that this does _not_ log an error.
*/
magic_server_config_rec *conf;
/* the file has to exist */
- if (r->finfo.filetype == 0 || !r->filename) {
+ if (r->finfo.filetype == APR_NOFILE || !r->filename) {
return DECLINED;
}
rr = ap_sub_req_lookup_file(req_conf->location, r,
r->output_filters);
- if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
+ if (rr->status == HTTP_OK && rr->finfo.filetype != APR_NOFILE) {
/*
* We don't touch Content-Length here. It might be
* borked (there's plenty of room for a race condition).
/* See core.c, default handler for all of the cases we just decline. */
if (r->method_number != M_GET ||
- r->finfo.filetype == 0 ||
+ r->finfo.filetype == APR_NOFILE ||
r->finfo.filetype == APR_DIR) {
return DECLINED;
}
}
if (r->method_number == M_GET || r->method_number == M_POST) {
- if (r->finfo.filetype == 0) {
+ if (r->finfo.filetype == APR_NOFILE) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"File does not exist: %s", r->filename);
return HTTP_NOT_FOUND;
* types of failure, such as APR_ENOTDIR. We can do something
* with APR_ENOENT, knowing that the path is good.
*/
- if (!r->finfo.filetype || r->finfo.filetype == APR_LNK) {
+ if (r->finfo.filetype == APR_NOFILE || r->finfo.filetype == APR_LNK) {
rv = apr_stat(&r->finfo, r->filename, APR_FINFO_MIN, r->pool);
/* some OSs will return APR_SUCCESS/APR_REG if we stat
* Also reset if the stat failed, just for safety.
*/
if ((rv != APR_SUCCESS) ||
- (r->finfo.filetype &&
+ (r->finfo.filetype != APR_NOFILE &&
(r->finfo.filetype != APR_DIR) &&
(r->filename[strlen(r->filename) - 1] == '/'))) {
- r->finfo.filetype = 0; /* forget what we learned */
+ r->finfo.filetype = APR_NOFILE; /* forget what we learned */
}
}
* if...we have allowed symlinks
* skip the lstat and dummy up an APR_DIR value for thisinfo.
*/
- if (r->finfo.filetype
+ if (r->finfo.filetype != APR_NOFILE
#ifdef CASE_BLIND_FILESYSTEM
&& (filename_len <= canonical_len)
#endif
/* If we have _not_ optimized, this is the time to recover
* the final stat result.
*/
- if (!r->finfo.filetype || r->finfo.filetype == APR_LNK) {
+ if (r->finfo.filetype == APR_NOFILE || r->finfo.filetype == APR_LNK) {
r->finfo = thisinfo;
}
if (((rv = apr_stat(&rnew->finfo, rnew->filename,
APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS)
&& (rv != APR_INCOMPLETE)) {
- rnew->finfo.filetype = 0;
+ rnew->finfo.filetype = APR_NOFILE;
}
}
else {
APR_FINFO_LINK | APR_FINFO_MIN,
rnew->pool)) != APR_SUCCESS)
&& (rv != APR_INCOMPLETE)) {
- rnew->finfo.filetype = 0;
+ rnew->finfo.filetype = APR_NOFILE;
}
}
}
if (((rv = apr_stat(&rnew->finfo, rnew->filename,
APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS)
&& (rv != APR_INCOMPLETE)) {
- rnew->finfo.filetype = 0;
+ rnew->finfo.filetype = APR_NOFILE;
}
}
else {
APR_FINFO_LINK | APR_FINFO_MIN,
rnew->pool)) != APR_SUCCESS)
&& (rv != APR_INCOMPLETE)) {
- rnew->finfo.filetype = 0;
+ rnew->finfo.filetype = APR_NOFILE;
}
}
/* Run the quick handler if the subrequest is not a dirent or file
* subrequest
*/
- if (!(r->filename && r->finfo.filetype)) {
+ if (!(r->filename && r->finfo.filetype != APR_NOFILE)) {
retval = ap_run_quick_handler(r, 0);
}
if (retval != OK) {