Commit 6043e87f authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

More ap_log_rerror() usage and axe some more AJP: prefixes


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1203878 13f79535-47bb-0310-9956-ffa450edef68
parent 5cac360c
Loading
Loading
Loading
Loading
+44 −45
Changes for modules/proxy/ajp_header.c: 44 added lines, 45 removed lines.
Original line number Diff line number Diff line
@@ -223,11 +223,10 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
    const apr_array_header_t *arr = apr_table_elts(r->subprocess_env);
    const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts;

    ap_log_error(APLOG_MARK, APLOG_TRACE8, 0, r->server,
                         "Into ajp_marshal_into_msgb");
    ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, r, "Into ajp_marshal_into_msgb");

    if ((method = sc_for_req_method_by_id(r)) == UNKNOWN_METHOD) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_marshal_into_msgb - No such method %s",
               r->method);
        return AJP_EBAD_METHOD;
@@ -255,7 +254,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
        ajp_msg_append_uint8(msg, is_ssl)                        ||
        ajp_msg_append_uint16(msg, (apr_uint16_t) num_headers)) {

        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_marshal_into_msgb: "
               "Error appending the message begining");
        return APR_EGENERAL;
@@ -268,7 +267,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,

        if ((sc = sc_for_req_header(elts[i].key)) != UNKNOWN_METHOD) {
            if (ajp_msg_append_uint16(msg, (apr_uint16_t)sc)) {
                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                       "ajp_marshal_into_msgb: "
                       "Error appending the header name");
                return AJP_EOVERFLOW;
@@ -276,7 +275,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
        }
        else {
            if (ajp_msg_append_string(msg, elts[i].key)) {
                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                       "ajp_marshal_into_msgb: "
                       "Error appending the header name");
                return AJP_EOVERFLOW;
@@ -284,12 +283,12 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
        }

        if (ajp_msg_append_string(msg, elts[i].val)) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                   "ajp_marshal_into_msgb: "
                   "Error appending the header value");
            return AJP_EOVERFLOW;
        }
        ap_log_error(APLOG_MARK, APLOG_TRACE5, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r,
                   "ajp_marshal_into_msgb: Header[%d] [%s] = [%s]",
                   i, elts[i].key, elts[i].val);
    }
@@ -298,7 +297,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
    if (s->secret) {
        if (ajp_msg_append_uint8(msg, SC_A_SECRET) ||
            ajp_msg_append_string(msg, s->secret)) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                   "Error ajp_marshal_into_msgb - "
                   "Error appending secret");
            return APR_EGENERAL;
@@ -309,7 +308,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
    if (r->user) {
        if (ajp_msg_append_uint8(msg, SC_A_REMOTE_USER) ||
            ajp_msg_append_string(msg, r->user)) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                   "ajp_marshal_into_msgb: "
                   "Error appending the remote user");
            return AJP_EOVERFLOW;
@@ -318,7 +317,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
    if (r->ap_auth_type) {
        if (ajp_msg_append_uint8(msg, SC_A_AUTH_TYPE) ||
            ajp_msg_append_string(msg, r->ap_auth_type)) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                   "ajp_marshal_into_msgb: "
                   "Error appending the auth type");
            return AJP_EOVERFLOW;
@@ -328,7 +327,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
    if (uri->query) {
        if (ajp_msg_append_uint8(msg, SC_A_QUERY_STRING) ||
            ajp_msg_append_string(msg, uri->query)) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                   "ajp_marshal_into_msgb: "
                   "Error appending the query string");
            return AJP_EOVERFLOW;
@@ -337,7 +336,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
    if ((session_route = apr_table_get(r->notes, "session-route"))) {
        if (ajp_msg_append_uint8(msg, SC_A_JVM_ROUTE) ||
            ajp_msg_append_string(msg, session_route)) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                   "ajp_marshal_into_msgb: "
                   "Error appending the jvm route");
            return AJP_EOVERFLOW;
@@ -360,7 +359,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
            && envvar[0]) {
            if (ajp_msg_append_uint8(msg, SC_A_SSL_CERT)
                || ajp_msg_append_string(msg, envvar)) {
                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                              "ajp_marshal_into_msgb: "
                              "Error appending the SSL certificates");
                return AJP_EOVERFLOW;
@@ -372,7 +371,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
            && envvar[0]) {
            if (ajp_msg_append_uint8(msg, SC_A_SSL_CIPHER)
                || ajp_msg_append_string(msg, envvar)) {
                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                              "ajp_marshal_into_msgb: "
                              "Error appending the SSL ciphers");
                return AJP_EOVERFLOW;
@@ -384,7 +383,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
            && envvar[0]) {
            if (ajp_msg_append_uint8(msg, SC_A_SSL_SESSION)
                || ajp_msg_append_string(msg, envvar)) {
                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                              "ajp_marshal_into_msgb: "
                              "Error appending the SSL session");
                return AJP_EOVERFLOW;
@@ -398,8 +397,8 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,

            if (ajp_msg_append_uint8(msg, SC_A_SSL_KEY_SIZE)
                || ajp_msg_append_uint16(msg, (unsigned short) atoi(envvar))) {
                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                             "Error ajp_marshal_into_msgb - "
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                              "ajp_marshal_into_msgb: "
                              "Error appending the SSL key size");
                return APR_EGENERAL;
            }
@@ -418,7 +417,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
        if (ajp_msg_append_uint8(msg, SC_A_REQ_ATTRIBUTE) ||
            ajp_msg_append_string(msg, key)   ||
            ajp_msg_append_string(msg, val)) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                    "ajp_marshal_into_msgb: "
                    "Error appending attribute %s=%s",
                    key, val);
@@ -433,7 +432,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
            if (ajp_msg_append_uint8(msg, SC_A_REQ_ATTRIBUTE) ||
                ajp_msg_append_string(msg, elts[i].key + 4)   ||
                ajp_msg_append_string(msg, elts[i].val)) {
                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                        "ajp_marshal_into_msgb: "
                        "Error appending attribute %s=%s",
                        elts[i].key, elts[i].val);
@@ -443,13 +442,13 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
    }

    if (ajp_msg_append_uint8(msg, SC_A_ARE_DONE)) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_marshal_into_msgb: "
               "Error appending the message end");
        return AJP_EOVERFLOW;
    }

    ap_log_error(APLOG_MARK, APLOG_TRACE8, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, r,
            "ajp_marshal_into_msgb: Done");
    return APR_SUCCESS;
}
@@ -498,7 +497,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
    rc = ajp_msg_get_uint16(msg, &status);

    if (rc != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                "ajp_unmarshal_response: Null status");
        return rc;
    }
@@ -515,7 +514,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
        r->status_line = NULL;
    }

    ap_log_error(APLOG_MARK, APLOG_TRACE4, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r,
           "ajp_unmarshal_response: status = %d", status);

    rc = ajp_msg_get_uint16(msg, &num_headers);
@@ -536,7 +535,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
        num_headers = 0;
    }

    ap_log_error(APLOG_MARK, APLOG_TRACE4, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r,
           "ajp_unmarshal_response: Number of headers is = %d",
           num_headers);

@@ -553,7 +552,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
            ajp_msg_get_uint16(msg, &name);
            stringname = long_res_header_for_sc(name);
            if (stringname == NULL) {
                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                       "ajp_unmarshal_response: "
                       "No such sc (%08x)",
                       name);
@@ -563,7 +562,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
            name = 0;
            rc = ajp_msg_get_string(msg, &stringname);
            if (rc != APR_SUCCESS) {
                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                       "ajp_unmarshal_response: "
                       "Null header name");
                return rc;
@@ -573,7 +572,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,

        rc = ajp_msg_get_string(msg, &value);
        if (rc != APR_SUCCESS) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                   "ajp_unmarshal_response: "
                   "Null header value");
            return rc;
@@ -594,7 +593,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
        }

        ap_xlate_proto_from_ascii(value, strlen(value));
        ap_log_error(APLOG_MARK, APLOG_TRACE5, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r,
               "ajp_unmarshal_response: Header[%d] [%s] = [%s]",
                       i, stringname, value);

@@ -604,7 +603,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
        if (strcasecmp(stringname, "Content-Type") == 0) {
             /* add corresponding filter */
            ap_set_content_type(r, apr_pstrdup(r->pool, value));
            ap_log_error(APLOG_MARK, APLOG_TRACE5, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r,
               "ajp_unmarshal_response: ap_set_content_type to '%s'", value);
        }
    }
@@ -625,14 +624,14 @@ apr_status_t ajp_send_header(apr_socket_t *sock,

    rc = ajp_msg_create(r->pool, buffsize, &msg);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_send_header: ajp_msg_create failed");
        return rc;
    }

    rc = ajp_marshal_into_msgb(msg, r, uri);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_send_header: ajp_marshal_into_msgb failed");
        return rc;
    }
@@ -640,7 +639,7 @@ apr_status_t ajp_send_header(apr_socket_t *sock,
    rc = ajp_ilink_send(sock, msg);
    ajp_msg_log(r, msg, "ajp_send_header: ajp_ilink_send packet dump");
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_send_header: ajp_ilink_send failed");
        return rc;
    }
@@ -662,7 +661,7 @@ apr_status_t ajp_read_header(apr_socket_t *sock,
    if (*msg) {
        rc = ajp_msg_reuse(*msg);
        if (rc != APR_SUCCESS) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                   "ajp_read_header: ajp_msg_reuse failed");
            return rc;
        }
@@ -670,7 +669,7 @@ apr_status_t ajp_read_header(apr_socket_t *sock,
    else {
        rc = ajp_msg_create(r->pool, buffsize, msg);
        if (rc != APR_SUCCESS) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                   "ajp_read_header: ajp_msg_create failed");
            return rc;
        }
@@ -678,13 +677,13 @@ apr_status_t ajp_read_header(apr_socket_t *sock,
    ajp_msg_reset(*msg);
    rc = ajp_ilink_receive(sock, *msg);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_read_header: ajp_ilink_receive failed");
        return rc;
    }
    ajp_msg_log(r, *msg, "ajp_read_header: ajp_ilink_receive packet dump");
    rc = ajp_msg_peek_uint8(*msg, &result);
    ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
               "ajp_read_header: ajp_ilink_received %s (0x%02x)",
               ajp_type_str(result), result);
    return APR_SUCCESS;
@@ -695,7 +694,7 @@ int ajp_parse_type(request_rec *r, ajp_msg_t *msg)
{
    apr_byte_t result;
    ajp_msg_peek_uint8(msg, &result);
    ap_log_error(APLOG_MARK, APLOG_TRACE6, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_TRACE6, 0, r,
               "ajp_parse_type: got %s (0x%02x)",
               ajp_type_str(result), result);
    return (int) result;
@@ -710,12 +709,12 @@ apr_status_t ajp_parse_header(request_rec *r, proxy_dir_conf *conf,

    rc = ajp_msg_get_uint8(msg, &result);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_parse_headers: ajp_msg_get_byte failed");
        return rc;
    }
    if (result != CMD_AJP13_SEND_HEADERS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_parse_headers: wrong type %s (0x%02x) expecting %s (0x%02x)",
               ajp_type_str(result), result,
               ajp_type_str(CMD_AJP13_SEND_HEADERS), CMD_AJP13_SEND_HEADERS);
@@ -734,12 +733,12 @@ apr_status_t ajp_parse_data(request_rec *r, ajp_msg_t *msg,

    rc = ajp_msg_get_uint8(msg, &result);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_parse_data: ajp_msg_get_byte failed");
        return rc;
    }
    if (result != CMD_AJP13_SEND_BODY_CHUNK) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_parse_data: wrong type %s (0x%02x) expecting %s (0x%02x)",
               ajp_type_str(result), result,
               ajp_type_str(CMD_AJP13_SEND_BODY_CHUNK), CMD_AJP13_SEND_BODY_CHUNK);
@@ -761,7 +760,7 @@ apr_status_t ajp_parse_data(request_rec *r, ajp_msg_t *msg,
     */
    expected_len = msg->len - (AJP_HEADER_LEN + AJP_HEADER_SZ_LEN + 1 + 1);
    if (*len != expected_len) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_parse_data: Wrong chunk length. Length of chunk is %i,"
               " expected length is %i.", *len, expected_len);
        return AJP_EBAD_HEADER;
@@ -779,12 +778,12 @@ apr_status_t ajp_parse_reuse(request_rec *r, ajp_msg_t *msg,

    rc = ajp_msg_get_uint8(msg, &result);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_parse_reuse: ajp_msg_get_byte failed");
        return rc;
    }
    if (result != CMD_AJP13_END_RESPONSE) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_parse_reuse: wrong type %s (0x%02x) expecting %s (0x%02x)",
               ajp_type_str(result), result,
               ajp_type_str(CMD_AJP13_END_RESPONSE), CMD_AJP13_END_RESPONSE);
+11 −11
Changes for modules/proxy/ajp_utils.c: 11 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -30,19 +30,19 @@ apr_status_t ajp_handle_cping_cpong(apr_socket_t *sock,
    apr_interval_time_t org;
    apr_byte_t result;

    ap_log_error(APLOG_MARK, APLOG_TRACE8, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, r,
                         "Into ajp_handle_cping_cpong");

    rc = ajp_msg_create(r->pool, AJP_PING_PONG_SZ, &msg);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_handle_cping_cpong: ajp_msg_create failed");
        return rc;
    }

    rc = ajp_msg_serialize_cping(msg);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_handle_cping_cpong: ajp_marshal_into_msgb failed");
        return rc;
    }
@@ -50,14 +50,14 @@ apr_status_t ajp_handle_cping_cpong(apr_socket_t *sock,
    rc = ajp_ilink_send(sock, msg);
    ajp_msg_log(r, msg, "ajp_handle_cping_cpong: ajp_ilink_send packet dump");
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_handle_cping_cpong: ajp_ilink_send failed");
        return rc;
    }

    rc = apr_socket_timeout_get(sock, &org);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_handle_cping_cpong: apr_socket_timeout_get failed");
        return rc;
    }
@@ -65,7 +65,7 @@ apr_status_t ajp_handle_cping_cpong(apr_socket_t *sock,
    /* Set CPING/CPONG response timeout */
    rc = apr_socket_timeout_set(sock, timeout);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_handle_cping_cpong: apr_socket_timeout_set failed");
        return rc;
    }
@@ -74,7 +74,7 @@ apr_status_t ajp_handle_cping_cpong(apr_socket_t *sock,
    /* Read CPONG reply */
    rv = ajp_ilink_receive(sock, msg);
    if (rv != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_handle_cping_cpong: ajp_ilink_receive failed");
        goto cleanup;
    }
@@ -82,12 +82,12 @@ apr_status_t ajp_handle_cping_cpong(apr_socket_t *sock,
    ajp_msg_log(r, msg, "ajp_handle_cping_cpong: ajp_ilink_receive packet dump");
    rv = ajp_msg_get_uint8(msg, &result);
    if (rv != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_handle_cping_cpong: invalid CPONG message");
        goto cleanup;
    }
    if (result != CMD_AJP13_CPONG) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_handle_cping_cpong: awaited CPONG, received %d ",
               result);
        rv = APR_EGENERAL;
@@ -98,12 +98,12 @@ cleanup:
    /* Restore original socket timeout */
    rc = apr_socket_timeout_set(sock, org);
    if (rc != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
               "ajp_handle_cping_cpong: apr_socket_timeout_set failed");
        return rc;
    }

    ap_log_error(APLOG_MARK, APLOG_TRACE8, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, r,
                         "ajp_handle_cping_cpong: Done");
    return rv;
}
+36 −44

File changed.

Preview size limit exceeded, changes collapsed.

+6 −7
Changes for modules/proxy/mod_proxy_express.c: 6 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -122,14 +122,13 @@ static int xlate_name(request_rec *r)
        return DECLINED;
    }

    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                 "proxy_express: Enabled");
    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "proxy_express: Enabled");
    if (!sconf->dbmfile || (r->filename && strncmp(r->filename, "proxy:", 6) == 0)) {
        /* it should be go on as an internal proxy request */
        return DECLINED;
    }

    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                  "proxy_express: Opening DBM file: %s (%s)",
                  sconf->dbmfile, sconf->dbmtype);
    rv = apr_dbm_open_ex(&db, sconf->dbmtype, sconf->dbmfile, APR_DBM_READONLY,
@@ -139,7 +138,7 @@ static int xlate_name(request_rec *r)
    }

    name = ap_get_server_name(r);
    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                  "proxy_express: looking for %s", name);
    key.dptr = (char *)name;
    key.dsize = strlen(key.dptr);
@@ -155,13 +154,13 @@ static int xlate_name(request_rec *r)
        return DECLINED;
    }

    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                  "proxy_express: found %s -> %s", name, backend);
    r->filename = apr_pstrcat(r->pool, "proxy:", backend, r->uri, NULL);
    r->handler = "proxy-server";
    r->proxyreq = PROXYREQ_REVERSE;

    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                  "proxy_express: rewritten as: %s", r->filename);

    ralias = (struct proxy_alias *)dconf->raliases->elts;
@@ -183,7 +182,7 @@ static int xlate_name(request_rec *r)

    /* Didn't find one... add it */
    if (!ralias) {
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                      "proxy_express: adding PPR entry");
        ralias = apr_array_push(dconf->raliases);
        ralias->fake = "/";