Commit 64527cd0 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Use varargs...

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1205894 13f79535-47bb-0310-9956-ffa450edef68
parent c7e4f1dd
Loading
Loading
Loading
Loading
+5 −4
Changes for include/util_filter.h: 5 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -322,8 +322,8 @@ AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *filter,
 *         ::HTTP_INTERNAL_SERVER_ERROR on all other errors
 * @param r      The request rec
 * @param bucket The current bucket brigade
 * @param msg    Optional error msg; if NULL defaults to "ap_pass_brigade returned"
 *
 * @param fmt The format string. If NULL defaults to "ap_pass_brigade returned"
 * @param ... The arguments to use to fill out the format string
 * @remark Ownership of the brigade is retained by the caller. On return,
 *         the contents of the brigade are UNDEFINED, and the caller must
 *         either call apr_brigade_cleanup or apr_brigade_destroy on
@@ -331,7 +331,8 @@ AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *filter,
 */
AP_DECLARE(apr_status_t) ap_pass_brigade_fchk(request_rec *r,
                                              apr_bucket_brigade *bucket,
                                              const char *msg);
                                              const char *fmt,
                                              ...);


/**
@@ -574,7 +575,7 @@ AP_DECLARE_NONSTD(apr_status_t) ap_fputstrs(ap_filter_t *f,
 * @param f the filter we are writing to
 * @param bb The brigade to buffer into
 * @param fmt The format string
 * @param ... The argumets to use to fill out the format string
 * @param ... The arguments to use to fill out the format string
 */
AP_DECLARE_NONSTD(apr_status_t) ap_fprintf(ap_filter_t *f,
                                           apr_bucket_brigade *bb,
+3 −6
Changes for modules/cache/mod_cache.c: 3 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -294,9 +294,8 @@ static int cache_quick_handler(request_rec *r, int lookup)
    APR_BRIGADE_INSERT_TAIL(out, e);

    return ap_pass_brigade_fchk(r, out,
                                apr_psprintf(r->pool,
                                "cache_quick_handler(%s): ap_pass_brigade returned",
                                             cache->provider_name));
                                cache->provider_name);
}

/**
@@ -568,10 +567,8 @@ static int cache_handler(request_rec *r)
    out = apr_brigade_create(r->pool, r->connection->bucket_alloc);
    e = apr_bucket_eos_create(out->bucket_alloc);
    APR_BRIGADE_INSERT_TAIL(out, e);
    return ap_pass_brigade_fchk(r, out,
                                apr_psprintf(r->pool,
                                             "cache(%s): ap_pass_brigade returned",
                                             cache->provider_name));
    return ap_pass_brigade_fchk(r, out, "cache(%s): ap_pass_brigade returned",
                                cache->provider_name);
}

/*
+12 −4
Changes for server/util_filter.c: 12 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -544,17 +544,25 @@ AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *next,
 */
AP_DECLARE(apr_status_t) ap_pass_brigade_fchk(request_rec *r,
                                              apr_bucket_brigade *bb,
                                              const char *errmsg)
                                              const char *fmt,
                                              ...)
{
    apr_status_t rv;
    if (!errmsg)
        errmsg = "ap_pass_brigade returned";

    rv = ap_pass_brigade(r->output_filters, bb);
    if (rv != APR_SUCCESS) {
        if (rv != AP_FILTER_ERROR) {
            if (!fmt)
                ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r,
                          "%s %d", errmsg, rv);
                              "ap_pass_brigade returned %d", rv);
            else {
                va_list ap;
                const char *res;
                va_start(ap, fmt);
                res = apr_pvsprintf(r->pool, fmt, ap);
                va_end(ap);
                ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r, res, NULL);
            }
            return HTTP_INTERNAL_SERVER_ERROR;
        }
        return AP_FILTER_ERROR;