You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2012/10/04 14:52:54 UTC
svn commit: r1394027 - in /httpd/httpd/branches/2.4.x: ./ STATUS
modules/filters/mod_include.c
Author: jim
Date: Thu Oct 4 12:52:54 2012
New Revision: 1394027
URL: http://svn.apache.org/viewvc?rev=1394027&view=rev
Log:
Merge r1393058 from trunk:
mod_include: When an include file or virtual path fails, include the result
code that tells us why.
Submitted by: minfrin
Reviewed/backported by: jim
Modified:
httpd/httpd/branches/2.4.x/ (props changed)
httpd/httpd/branches/2.4.x/STATUS
httpd/httpd/branches/2.4.x/modules/filters/mod_include.c
Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
Merged /httpd/httpd/trunk:r1393058
Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1394027&r1=1394026&r2=1394027&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Thu Oct 4 12:52:54 2012
@@ -89,12 +89,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_include: When an include file or virtual path fails, include the result
- code that tells us why.
- trunk patch: http://svn.apache.org/viewvc?rev=1393058&view=rev
- 2.4.x patch: trunk patch works
- +1: minfrin, rjung, jim
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
Modified: httpd/httpd/branches/2.4.x/modules/filters/mod_include.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/filters/mod_include.c?rev=1394027&r1=1394026&r2=1394027&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/filters/mod_include.c (original)
+++ httpd/httpd/branches/2.4.x/modules/filters/mod_include.c Thu Oct 4 12:52:54 2012
@@ -1797,6 +1797,8 @@ static apr_status_t handle_include(inclu
request_rec *rr = NULL;
char *error_fmt = NULL;
char *parsed_string;
+ apr_status_t rv = APR_SUCCESS;
+ int status = 0;
ap_ssi_get_tag_and_value(ctx, &tag, &tag_val, SSI_VALUE_DECODED);
if (!tag || !tag_val) {
@@ -1815,7 +1817,6 @@ static apr_status_t handle_include(inclu
SSI_EXPAND_DROP_NAME);
if (tag[0] == 'f') {
char *newpath;
- apr_status_t rv;
/* be safe; only files in this directory or below allowed */
rv = apr_filepath_merge(&newpath, NULL, parsed_string,
@@ -1843,14 +1844,14 @@ static apr_status_t handle_include(inclu
}
if (!error_fmt && rr->status != HTTP_OK) {
- error_fmt = "unable to include \"%s\" in parsed file %s";
+ error_fmt = "unable to include \"%s\" in parsed file %s, subrequest setup returned %d";
}
if (!error_fmt && (ctx->flags & SSI_FLAG_NO_EXEC) &&
rr->content_type && strncmp(rr->content_type, "text/", 5)) {
error_fmt = "unable to include potential exec \"%s\" in parsed "
- "file %s";
+ "file %s, content type not text/*";
}
/* See the Kludge in includes_filter for why.
@@ -1861,13 +1862,13 @@ static apr_status_t handle_include(inclu
ap_set_module_config(rr->request_config, &include_module, r);
}
- if (!error_fmt && ap_run_sub_req(rr)) {
- error_fmt = "unable to include \"%s\" in parsed file %s";
+ if (!error_fmt && ((status = ap_run_sub_req(rr)))) {
+ error_fmt = "unable to include \"%s\" in parsed file %s, subrequest returned %d";
}
if (error_fmt) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, error_fmt, tag_val,
- r->filename);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, error_fmt, tag_val,
+ r->filename, status ? status : rr ? rr->status : 0);
if (last_error) {
/* onerror threw an error, give up completely */
break;