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;
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;
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;
}
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;
}
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);
}
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;
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;
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;
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;
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;
&& 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,
- "ajp_marshal_into_msgb: "
- "Error appending the SSL certificates");
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ "ajp_marshal_into_msgb: "
+ "Error appending the SSL certificates");
return AJP_EOVERFLOW;
}
}
&& 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,
- "ajp_marshal_into_msgb: "
- "Error appending the SSL ciphers");
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ "ajp_marshal_into_msgb: "
+ "Error appending the SSL ciphers");
return AJP_EOVERFLOW;
}
}
&& 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,
- "ajp_marshal_into_msgb: "
- "Error appending the SSL session");
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ "ajp_marshal_into_msgb: "
+ "Error appending the SSL session");
return AJP_EOVERFLOW;
}
}
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 - "
- "Error appending the SSL key size");
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ "ajp_marshal_into_msgb: "
+ "Error appending the SSL key size");
return APR_EGENERAL;
}
}
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);
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);
}
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;
}
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;
}
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);
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);
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);
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;
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;
}
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);
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);
}
}
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;
}
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;
}
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;
}
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;
}
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;
{
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;
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);
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);
*/
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;
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);
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;
}
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;
}
/* 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;
}
/* 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;
}
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;
/* 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;
}
return DECLINED;
}
- ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, r->server,
- "AJP: canonicalising URL %s", url);
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "canonicalising URL %s", url);
/*
* do syntactic check.
*/
err = ap_proxy_canon_netloc(r->pool, &url, NULL, NULL, &host, &port);
if (err) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
- "error parsing URL %s: %s",
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "error parsing URL %s: %s",
url, err);
return HTTP_BAD_REQUEST;
}
status = ajp_send_header(conn->sock, r, maxsize, uri);
if (status != APR_SUCCESS) {
conn->close++;
- ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
- "AJP: request failed to %pI (%s)",
- conn->worker->cp->addr,
- conn->worker->s->hostname);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
+ "request failed to %pI (%s)",
+ conn->worker->cp->addr,
+ conn->worker->s->hostname);
if (status == AJP_EOVERFLOW)
return HTTP_BAD_REQUEST;
else if (status == AJP_EBAD_METHOD) {
if (status != APR_SUCCESS) {
/* We had a failure: Close connection to backend */
conn->close++;
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "ajp_alloc_data_msg failed");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "ajp_alloc_data_msg failed");
return HTTP_INTERNAL_SERVER_ERROR;
}
tenc = apr_table_get(r->headers_in, "Transfer-Encoding");
if (tenc && (strcasecmp(tenc, "chunked") == 0)) {
/* The AJP protocol does not want body data yet */
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "request is chunked");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "request is chunked");
} else {
/* Get client provided Content-Length header */
content_length = get_content_length(r);
if (status != APR_SUCCESS) {
/* We had a failure: Close connection to backend */
conn->close++;
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "ap_get_brigade failed");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "ap_get_brigade failed");
apr_brigade_destroy(input_brigade);
return HTTP_BAD_REQUEST;
}
/* have something */
if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "APR_BUCKET_IS_EOS");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "APR_BUCKET_IS_EOS");
}
/* Try to send something */
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "data to read (max %" APR_SIZE_T_FMT
- " at %" APR_SIZE_T_FMT ")", bufsiz, msg->pos);
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "data to read (max %" APR_SIZE_T_FMT
+ " at %" APR_SIZE_T_FMT ")", bufsiz, msg->pos);
status = apr_brigade_flatten(input_brigade, buff, &bufsiz);
if (status != APR_SUCCESS) {
/* We had a failure: Close connection to backend */
conn->close++;
apr_brigade_destroy(input_brigade);
- ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
- "apr_brigade_flatten");
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
+ "apr_brigade_flatten");
return HTTP_INTERNAL_SERVER_ERROR;
}
apr_brigade_cleanup(input_brigade);
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "got %" APR_SIZE_T_FMT " bytes of data", bufsiz);
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "got %" APR_SIZE_T_FMT " bytes of data", bufsiz);
if (bufsiz > 0) {
status = ajp_send_data_msg(conn->sock, msg, bufsiz);
ajp_msg_log(r, msg, "First ajp_send_data_msg: ajp_ilink_send packet dump");
/* We had a failure: Close connection to backend */
conn->close++;
apr_brigade_destroy(input_brigade);
- ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
- "send failed to %pI (%s)",
- conn->worker->cp->addr,
- conn->worker->s->hostname);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
+ "send failed to %pI (%s)",
+ conn->worker->cp->addr,
+ conn->worker->s->hostname);
/*
* It is fatal when we failed to send a (part) of the request
* body.
send_body = 1;
}
else if (content_length > 0) {
- ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
- "read zero bytes, expecting"
- " %" APR_OFF_T_FMT " bytes",
- content_length);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
+ "read zero bytes, expecting"
+ " %" APR_OFF_T_FMT " bytes",
+ content_length);
/*
* We can only get here if the client closed the connection
* to us without sending the body.
/* We had a failure: Close connection to backend */
conn->close++;
apr_brigade_destroy(input_brigade);
- ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
- "read response failed from %pI (%s)",
- conn->worker->cp->addr,
- conn->worker->s->hostname);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
+ "read response failed from %pI (%s)",
+ conn->worker->cp->addr,
+ conn->worker->s->hostname);
/* If we had a successful cping/cpong and then a timeout
* we assume it is a request that cause a back-end timeout,
/* This is the end */
bufsiz = 0;
havebody = 0;
- ap_log_error(APLOG_MARK, APLOG_DEBUG, status, r->server,
- "APR_BUCKET_IS_EOS");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r,
+ "APR_BUCKET_IS_EOS");
} else {
status = ap_get_brigade(r->input_filters, input_brigade,
AP_MODE_READBYTES,
APR_BLOCK_READ,
maxsize - AJP_HEADER_SZ);
if (status != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, status,
- r->server,
- "ap_get_brigade failed");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r,
+ "ap_get_brigade failed");
output_failed = 1;
break;
}
&bufsiz);
apr_brigade_cleanup(input_brigade);
if (status != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, status,
- r->server,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r,
"apr_brigade_flatten failed");
output_failed = 1;
break;
status = ajp_send_data_msg(conn->sock, msg, bufsiz);
ajp_msg_log(r, msg, "ajp_send_data_msg after CMD_AJP13_GET_BODY_CHUNK: ajp_ilink_send packet dump");
if (status != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, status, r->server,
- "ajp_send_data_msg failed");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r,
+ "ajp_send_data_msg failed");
backend_failed = 1;
break;
}
* something is wrong TC asks for more body but we are
* already at the end of the body data
*/
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "ap_proxy_ajp_request error read after end");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "ap_proxy_ajp_request error read after end");
backend_failed = 1;
}
break;
* Backend already send us the headers.
*/
backend_failed = 1;
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "Backend sent headers twice.");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "Backend sent headers twice.");
break;
}
/* AJP13_SEND_HEADERS: process them */
if ((buf = apr_table_get(r->headers_out, wa))) {
apr_table_set(r->err_headers_out, wa, buf);
} else {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "ap_proxy_ajp_request: origin server "
- "sent 401 without WWW-Authenticate header");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "ap_proxy_ajp_request: origin server "
+ "sent 401 without WWW-Authenticate header");
}
}
headers_sent = 1;
APR_BRIGADE_INSERT_TAIL(output_brigade, e);
}
else {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "Ignoring flush message received before headers");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "Ignoring flush message "
+ "received before headers");
}
}
else {
(ajp_msg_t **)&(conn->data));
if (status != APR_SUCCESS) {
backend_failed = 1;
- ap_log_error(APLOG_MARK, APLOG_DEBUG, status, r->server,
- "ajp_read_header failed");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r,
+ "ajp_read_header failed");
break;
}
result = ajp_parse_type(r, conn->data);
apr_brigade_cleanup(output_brigade);
if (backend_failed || output_failed) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "Processing of request failed backend: %i, "
- "output: %i", backend_failed, output_failed);
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "Processing of request failed backend: %i, "
+ "output: %i", backend_failed, output_failed);
/* We had a failure: Close connection to backend */
conn->close++;
/* Return DONE to avoid error messages being added to the stream */
}
}
else if (!request_ended) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "Processing of request didn't terminate cleanly");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "Processing of request didn't terminate cleanly");
/* We had a failure: Close connection to backend */
conn->close++;
backend_failed = 1;
conn->close++;
}
else {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "got response from %pI (%s)",
- conn->worker->cp->addr,
- conn->worker->s->hostname);
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "got response from %pI (%s)",
+ conn->worker->cp->addr,
+ conn->worker->s->hostname);
if (conf->error_override && ap_is_HTTP_ERROR(r->status)) {
/* clear r->status for override error, otherwise ErrorDocument
}
if (backend_failed) {
- ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
- "dialog to %pI (%s) failed",
- conn->worker->cp->addr,
- conn->worker->s->hostname);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
+ "dialog to %pI (%s) failed",
+ conn->worker->cp->addr,
+ conn->worker->s->hostname);
/*
* If we already send data, signal a broken backend connection
* upwards in the chain.
if (strncasecmp(url, "ajp:", 4) != 0) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "AJP: declining URL %s", url);
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "declining URL %s", url);
return DECLINED;
}
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "AJP: serving URL %s", url);
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "serving URL %s", url);
/* create space for state information */
status = ap_proxy_acquire_connection(scheme, &backend, worker,
/* Step Two: Make the Connection */
if (ap_proxy_connect_backend(scheme, backend, worker, r->server)) {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
- "AJP: failed to make connection to backend: %s",
- backend->hostname);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ "failed to make connection to backend: %s",
+ backend->hostname);
status = HTTP_SERVICE_UNAVAILABLE;
break;
}
*/
if (status != APR_SUCCESS) {
backend->close++;
- ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
- "AJP: cping/cpong failed to %pI (%s)",
- worker->cp->addr,
- worker->s->hostname);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
+ "cping/cpong failed to %pI (%s)",
+ worker->cp->addr, worker->s->hostname);
status = HTTP_SERVICE_UNAVAILABLE;
retry++;
continue;
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,
- "proxy_express: Opening DBM file: %s (%s)",
- sconf->dbmfile, sconf->dbmtype);
+ 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,
APR_OS_DEFAULT, r->pool);
if (rv != APR_SUCCESS) {
}
name = ap_get_server_name(r);
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "proxy_express: looking for %s", name);
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "proxy_express: looking for %s", name);
key.dptr = (char *)name;
key.dsize = strlen(key.dptr);
return DECLINED;
}
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "proxy_express: found %s -> %s", name, backend);
+ 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,
- "proxy_express: rewritten as: %s", r->filename);
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "proxy_express: rewritten as: %s", r->filename);
ralias = (struct proxy_alias *)dconf->raliases->elts;
/*
/* Didn't find one... add it */
if (!ralias) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "proxy_express: adding PPR entry");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "proxy_express: adding PPR entry");
ralias = apr_array_push(dconf->raliases);
ralias->fake = "/";
ralias->real = apr_pstrdup(dconf->raliases->pool, backend);