Commit be7dcd53 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1681795, r1682988, r1682979, r1682819, r1682816 from trunk:

initialize args to not print garbage mem during a RewriteRule parse error



Initialize args to not print garbage mem during a RewriteCond parse error (same as r1681795 for RewriteRule)

Improve style in examples.

Improve error message (related to PR57311 diagnostic)

Concat string at compile time in order to save a few cycles.

Submitted by: covener, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1683113 13f79535-47bb-0310-9956-ffa450edef68
parent 755dd84e
Loading
Loading
Loading
Loading
+0 −15
Changes for STATUS: 0 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -105,21 +105,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

   *) Easy patches - synch with trunk
        - mod_rewrite: Initialize args to not print garbage mem during a RewriteCond parse error
        - mod_rewrite: Initialize args to not print garbage mem during a RewriteRule parse error
        - examples/mod_*: Improve style in examples.
        - proxy_util: Improve error message
        - mod_proxy_wstunnel: Concat string at compile time in orser to save a few cycles.
     trunk patch:
        http://svn.apache.org/r1681795
        http://svn.apache.org/r1682988
        http://svn.apache.org/r1682979
        http://svn.apache.org/r1682819
        http://svn.apache.org/r1682816
     2.4.x patch: trunk patchs work
     +1: jailletc36, ylavic, jim



PATCHES PROPOSED TO BACKPORT FROM TRUNK:
+3 −3
Changes for modules/examples/mod_case_filter.c: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -71,8 +71,7 @@ static apr_status_t CaseFilterOutFilter(ap_filter_t *f,
        apr_size_t n;
        apr_bucket *pbktOut;

        if(APR_BUCKET_IS_EOS(pbktIn))
            {
        if (APR_BUCKET_IS_EOS(pbktIn)) {
            apr_bucket *pbktEOS = apr_bucket_eos_create(c->bucket_alloc);
            APR_BRIGADE_INSERT_TAIL(pbbOut, pbktEOS);
            continue;
@@ -83,8 +82,9 @@ static apr_status_t CaseFilterOutFilter(ap_filter_t *f,

        /* write */
        buf = apr_bucket_alloc(len, c->bucket_alloc);
        for(n=0 ; n < len ; ++n)
        for (n=0 ; n < len ; ++n) {
            buf[n] = apr_toupper(data[n]);
        }

        pbktOut = apr_bucket_heap_create(buf, len, apr_bucket_free,
                                         c->bucket_alloc);
+2 −2
Changes for modules/examples/mod_case_filter_in.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -110,8 +110,9 @@ static apr_status_t CaseFilterInFilter(ap_filter_t *f,
            return ret;

        buf = ap_malloc(len);
        for(n=0 ; n < len ; ++n)
        for (n=0 ; n < len ; ++n) {
            buf[n] = apr_toupper(data[n]);
        }

        pbktOut = apr_bucket_heap_create(buf, len, 0, c->bucket_alloc);
        APR_BRIGADE_INSERT_TAIL(pbbOut, pbktOut);
@@ -121,7 +122,6 @@ static apr_status_t CaseFilterInFilter(ap_filter_t *f,
    return APR_SUCCESS;
}


static const char *CaseFilterInEnable(cmd_parms *cmd, void *dummy, int arg)
{
    CaseFilterInConfig *pConfig
+4 −5
Changes for modules/examples/mod_example_hooks.c: 4 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -329,7 +329,8 @@ static void example_log_each(apr_pool_t *p, server_rec *s, const char *note)
{
    if (s != NULL) {
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "mod_example_hooks: %s", note);
    } else {
    }
    else {
        apr_file_t *out = NULL;
        apr_file_open_stderr(&out, p);
        apr_file_printf(out, "mod_example_hooks traced in non-loggable "
@@ -741,7 +742,6 @@ static int x_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
     * Log the call and exit.
     */
    trace_startup(ptemp, NULL, NULL, "x_pre_config()");

    return OK;
}

@@ -1049,7 +1049,8 @@ static int x_handler(request_rec *r)
                                    r->connection->pool);
    if ((status == APR_SUCCESS) && conn_data) {
        ap_rprintf(r, "  <OL>\n%s  </OL>\n", (char *) conn_data);
    } else {
    }
    else {
        ap_rputs("  <P>No connection-specific callback information was "
                 "retrieved.</P>\n", r);
    }
@@ -1135,7 +1136,6 @@ static int x_pre_connection(conn_rec *c, void *csd)
static int x_process_connection(conn_rec *c)
{
    trace_connection(c, "x_process_connection()");

    return DECLINED;
}

@@ -1181,7 +1181,6 @@ static int x_post_read_request(request_rec *r)
 */
static int x_translate_name(request_rec *r)
{

    /*
     * We don't actually *do* anything here, except note the fact that we were
     * called.
+13 −8
Changes for modules/examples/mod_example_ipc.c: 13 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -91,7 +91,8 @@ typedef struct exipc_data {
 * on restarts. It assures that the new children will not talk to a stale
 * shared memory segment.
 */
static apr_status_t shm_cleanup_wrapper(void *unused) {
static apr_status_t shm_cleanup_wrapper(void *unused)
{
    if (exipc_shm)
        return apr_shm_destroy(exipc_shm);
    return OK;
@@ -248,10 +249,12 @@ static int exipc_handler(request_rec *r)
        rs = apr_global_mutex_trylock(exipc_mutex);
        if (APR_STATUS_IS_EBUSY(rs)) {
            apr_sleep(CAMPOUT);
        } else if (APR_SUCCESS == rs) {
        }
        else if (APR_SUCCESS == rs) {
            gotlock = 1;
            break; /* Get out of the loop */
        } else if (APR_STATUS_IS_ENOTIMPL(rs)) {
        }
        else if (APR_STATUS_IS_ENOTIMPL(rs)) {
            /* If it's not implemented, just hang in the mutex. */
            startcamp = apr_time_now();
            rs = apr_global_mutex_lock(exipc_mutex);
@@ -259,21 +262,23 @@ static int exipc_handler(request_rec *r)
            if (APR_SUCCESS == rs) {
                gotlock = 1;
                break; /* Out of the loop */
            } else {
            }
            else {
                /* Some error, log and bail */
                ap_log_error(APLOG_MARK, APLOG_ERR, rs, r->server,
                             "Child %ld failed to acquire lock",
                             (long int)getpid());
                break; /* Out of the loop without having the lock */
            }
        } else {
        }
        else {
            /* Some other error, log and bail */
            ap_log_error(APLOG_MARK, APLOG_ERR, rs, r->server,
                         "Child %ld failed to try and acquire lock",
                         (long int)getpid());
            break; /* Out of the loop without having the lock */

        }

        /*
         * The only way to get to this point is if the trylock worked
         * and returned BUSY. So, bump the time and try again
@@ -307,7 +312,8 @@ static int exipc_handler(request_rec *r)
            ap_rprintf(r, "<tr><td>Counter:</td><td>%u</td></tr>\n",
                       (unsigned int)base->counter);
            ap_rputs("</table>\n", r);
        } else {
        }
        else {
            /*
             * Send a page saying that we couldn't get the lock. Don't say
             * what the counter is, because without the lock the value could
@@ -348,4 +354,3 @@ AP_DECLARE_MODULE(example_ipc) = {
    NULL,                  /* table of config file commands       */
    exipc_register_hooks   /* register hooks                      */
};
Loading