From: Greg Ames Date: Wed, 22 Aug 2001 23:12:24 +0000 (+0000) Subject: get rid of nuisance log messages due to subrequests failing with EPIPE X-Git-Tag: 2.0.25~170 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f9493afb2fdf7012ad02a48573382026a32909e9;p=apache get rid of nuisance log messages due to subrequests failing with EPIPE git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90519 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index b65a50ba10..6940667eac 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -275,7 +275,6 @@ static apr_bucket *find_end_sequence(apr_bucket *dptr, include_ctx_t *ctx, apr_b if (ctx->state == PARSE_DIRECTIVE) { /* gonna start over parsing the directive next time through */ ctx->directive_length = 0; - ctx->tag_length = 0; } return dptr; } @@ -763,6 +762,7 @@ static int handle_include(include_ctx_t *ctx, apr_bucket_brigade **bb, request_r char *tag_val = NULL; apr_bucket *tmp_buck; char parsed_string[MAX_STRING_LEN]; + int loglevel = APLOG_ERR; *inserted_head = NULL; if (ctx->flags & FLAG_PRINTING) { @@ -832,8 +832,8 @@ static int handle_include(include_ctx_t *ctx, apr_bucket_brigade **bb, request_r for (p = r; p != NULL && !founddupe; p = p->main) { request_rec *q; for (q = p; q != NULL; q = q->prev) { - if ((q->filename && rr->filename && (strcmp(q->filename, rr->filename) == 0)) || - (strcmp(q->uri, rr->uri) == 0)) { + if ( (strcmp(q->filename, rr->filename) == 0) || + (strcmp(q->uri, rr->uri) == 0) ){ founddupe = 1; break; } @@ -853,14 +853,20 @@ static int handle_include(include_ctx_t *ctx, apr_bucket_brigade **bb, request_r ap_set_module_config(rr->request_config, &include_module, r); if (!error_fmt) { + int rv; + SPLIT_AND_PASS_PRETAG_BUCKETS(*bb, ctx, f->next); - if (ap_run_sub_req(rr)) { - error_fmt = "unable to include \"%s\" in parsed file %s"; + if ((rv = ap_run_sub_req(rr))) { + if (APR_STATUS_IS_EPIPE(rv)) { + /* let's not clutter the log on a busy server */ + loglevel = APLOG_INFO; + } + error_fmt = "unable to include \"%s\" in parsed file %s"; } } if (error_fmt) { - ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, + ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|loglevel, 0, r, error_fmt, tag_val, r->filename); CREATE_ERROR_BUCKET(ctx, tmp_buck, head_ptr, *inserted_head); }