ajp_header.c revision 5cd4f796d242bd32ff29a924cf0a608eea1e464f
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/* Copyright 1999-2005 The Apache Software Foundation or its licensors, as
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * applicable.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Licensed under the Apache License, Version 2.0 (the "License");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * you may not use this file except in compliance with the License.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * You may obtain a copy of the License at
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * http://www.apache.org/licenses/LICENSE-2.0
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Unless required by applicable law or agreed to in writing, software
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * distributed under the License is distributed on an "AS IS" BASIS,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * See the License for the specific language governing permissions and
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * limitations under the License.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb#include "ajp_header.h"
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb#include "ajp.h"
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbstatic const char *response_trans_headers[] = {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Content-Type",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Content-Language",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Content-Length",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Date",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Last-Modified",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Location",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Set-Cookie",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Set-Cookie2",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Servlet-Engine",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Status",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "WWW-Authenticate"
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb};
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbstatic const char *long_res_header_for_sc(int sc)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const char *rc = NULL;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb sc = sc & 0X00FF;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if(sc <= SC_RES_HEADERS_NUM && sc > 0) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = response_trans_headers[sc - 1];
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb#define UNKNOWN_METHOD (-1)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbstatic int sc_for_req_header(const char *header_name)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb char header[16];
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_size_t len = strlen(header_name);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const char *p = header_name;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb int i = 0;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb /* ACCEPT-LANGUAGE is the longest headeer
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * that is of interest.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (len < 4 || len > 15)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb while (*p)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb header[i++] = apr_toupper(*p++);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb header[i] = '\0';
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb p = &header[1];
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb switch (header[0]) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb case 'A':
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (memcmp(p, "CCEPT", 5) == 0) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (!header[6])
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_ACCEPT;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else if (header[6] == '-') {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb p += 6;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (memcmp(p, "CHARSET", 7) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_ACCEPT_CHARSET;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else if (memcmp(p, "ENCODING", 8) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_ACCEPT_ENCODING;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else if (memcmp(p, "LANGUAGE", 8) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_ACCEPT_LANGUAGE;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else if (memcmp(p, "UTHORIZATION", 12) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_AUTHORIZATION;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb break;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb case 'C':
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (memcmp(p, "OOKIE", 5) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_COOKIE;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else if(memcmp(p, "ONNECTION", 9) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_CONNECTION;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else if(memcmp(p, "ONTENT-TYPE", 11) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_CONTENT_TYPE;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else if(memcmp(p, "ONTENT-LENGTH", 13) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_CONTENT_LENGTH;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else if(memcmp(p, "OOKIE2", 6) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_COOKIE2;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb break;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb case 'H':
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if(memcmp(p, "OST", 3) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_HOST;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb break;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb case 'P':
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if(memcmp(p, "RAGMA", 5) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_PRAGMA;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb break;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb case 'R':
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if(memcmp(p, "EFERER", 6) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_REFERER;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb break;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb case 'U':
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if(memcmp(p, "SER-AGENT", 9) == 0)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return SC_USER_AGENT;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb break;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb default:
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb /* NOTREACHED */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/* Apache method number to SC methods transform table */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbstatic const unsigned char sc_for_req_method_table[] = {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_GET,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_PUT,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_POST,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_DELETE,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb 0, /* M_DELETE */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_OPTIONS,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_TRACE,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb 0, /* M_PATCH */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_PROPFIND,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_PROPPATCH,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_MKCOL,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_COPY,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_MOVE,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_LOCK,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_UNLOCK,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_VERSION_CONTROL,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_CHECKOUT,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_UNCHECKOUT,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_CHECKIN,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_UPDATE,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_LABEL,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_REPORT,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_MKWORKSPACE,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_MKACTIVITY,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_BASELINE_CONTROL,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb SC_M_MERGE,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb 0 /* M_INVALID */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb};
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbstatic int sc_for_req_method_by_id(int method_id)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (method_id < 0 || method_id > M_INVALID)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return sc_for_req_method_table[method_id] ?
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb sc_for_req_method_table[method_id] : UNKNOWN_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/*
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Message structure
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbAJPV13_REQUEST/AJPV14_REQUEST=
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb request_prefix (1) (byte)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb method (byte)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb protocol (string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb req_uri (string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb remote_addr (string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb remote_host (string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb server_name (string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb server_port (short)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb is_ssl (boolean)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb num_headers (short)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb num_headers*(req_header_name header_value)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?context (byte)(string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?servlet_path (byte)(string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?remote_user (byte)(string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?auth_type (byte)(string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?query_string (byte)(string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?jvm_route (byte)(string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?ssl_cert (byte)(string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?ssl_cipher (byte)(string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?ssl_session (byte)(string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?ssl_key_size (byte)(int) via JkOptions +ForwardKeySize
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb request_terminator (byte)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ?body content_length*(var binary)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbstatic apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb request_rec *r,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_uri_t *uri)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb int method;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_uint32_t i, num_headers = 0;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_byte_t is_ssl;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb char *remote_host;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const char *session_route, *envvar;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const apr_array_header_t *arr = apr_table_elts(r->subprocess_env);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Into ajp_marshal_into_msgb");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if ((method = sc_for_req_method_by_id(r->method_number)) == UNKNOWN_METHOD) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb - No such method %s",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb r->method);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EBAD_METHOD;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb is_ssl = (apr_byte_t) ap_proxy_conn_is_https(r->connection);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (r->headers_in && apr_table_elts(r->headers_in)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const apr_array_header_t *t = apr_table_elts(r->headers_in);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb num_headers = t->nelts;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb remote_host = (char *)ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_HOST, NULL);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_reset(msg);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, CMD_AJP13_FORWARD_REQUEST) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_uint8(msg, method) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, r->protocol) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, uri->path) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, r->connection->remote_ip) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, remote_host) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, ap_get_server_name(r)) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_uint16(msg, (apr_uint16_t)r->connection->local_addr->port) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_uint8(msg, is_ssl) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_uint16(msg, (apr_uint16_t) num_headers)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the message begining");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return APR_EGENERAL;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb for (i = 0 ; i < num_headers ; i++) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb int sc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const apr_array_header_t *t = apr_table_elts(r->headers_in);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const apr_table_entry_t *elts = (apr_table_entry_t *)t->elts;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if ((sc = sc_for_req_header(elts[i].key)) != UNKNOWN_METHOD) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint16(msg, (apr_uint16_t)sc)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the header name");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_string(msg, elts[i].key)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the header name");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_string(msg, elts[i].val)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the header value");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: Header[%d] [%s] = [%s]",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb i, elts[i].key, elts[i].val);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/* XXXX need to figure out how to do this
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (s->secret) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_SECRET) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, s->secret)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error ajp_marshal_into_msgb - "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending secret");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return APR_EGENERAL;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (r->user) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_REMOTE_USER) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, r->user)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the remote user");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (r->ap_auth_type) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_AUTH_TYPE) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, r->ap_auth_type)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the auth type");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb /* XXXX ebcdic (args converted?) */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (uri->query) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_QUERY_STRING) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, uri->query)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the query string");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if ((session_route = apr_table_get(r->notes, "session-route"))) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_JVM_ROUTE) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, session_route)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the jvm route");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/* XXX: Is the subprocess_env a right place?
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * <Location /examples>
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * ProxyPass ajp://remote:8009/servlets-examples
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * SetEnv SSL_SESSION_ID CUSTOM_SSL_SESSION_ID
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * </Location>
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if ((envvar = ap_proxy_ssl_val(r->pool, r->server, r->connection, r,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb AJP13_SSL_CLIENT_CERT_INDICATOR))) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_SSL_CERT) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, envvar)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the SSL certificates");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if ((envvar = ap_proxy_ssl_val(r->pool, r->server, r->connection, r,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb AJP13_SSL_CIPHER_INDICATOR))) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_SSL_CIPHER) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, envvar)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the SSL ciphers");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if ((envvar = ap_proxy_ssl_val(r->pool, r->server, r->connection, r,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb AJP13_SSL_SESSION_INDICATOR))) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_SSL_SESSION) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, envvar)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the SSL session");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb /*
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * ssl_key_size is required by Servlet 2.3 API
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * added support only in ajp14 mode
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * JFC removed: ae->proto == AJP14_PROTO
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb /* XXXX ignored for the moment
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (s->ssl_key_size != -1) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_SSL_KEY_SIZE) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_uint16(msg, (unsigned short) s->ssl_key_size)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error ajp_marshal_into_msgb - "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the SSL key size");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return APR_EGENERAL;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb /* Use the environment vars prefixed with AJP_
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * and pass it to the header striping that prefix.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb for (i = 0; i < (apr_uint32_t)arr->nelts; i++) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (!strncmp(elts[i].key, "AJP_", 4)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_REQ_ATTRIBUTE) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, elts[i].key + 4) ||
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_append_string(msg, elts[i].val)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending attribute %s=%s",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb elts[i].key, elts[i].val);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (ajp_msg_append_uint8(msg, SC_A_ARE_DONE)) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Error appending the message end");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EOVERFLOW;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_marshal_into_msgb: Done");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return APR_SUCCESS;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/*
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbAJPV13_RESPONSE/AJPV14_RESPONSE:=
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb response_prefix (2)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb status (short)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb status_msg (short)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb num_headers (short)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb num_headers*(res_header_name header_value)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *body_chunk
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb terminator boolean <! -- recycle connection or not -->
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbreq_header_name :=
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb sc_req_header_name | (string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbres_header_name :=
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb sc_res_header_name | (string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbheader_value :=
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb (string)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbbody_chunk :=
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb length (short)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb body length*(var binary)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbstatic apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb request_rec *r,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb proxy_dir_conf *dconf)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_uint16_t status;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_status_t rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const char *ptr;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_uint16_t num_headers;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb int i;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_get_uint16(msg, &status);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_unmarshal_response: Null status");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb r->status = status;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_get_string(msg, &ptr);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc == APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb r->status_line = apr_psprintf(r->pool, "%d %s", status, ptr);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb#if defined(AS400) || defined(_OSD_POSIX)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_xlate_proto_from_ascii(r->status_line, strlen(r->status_line));
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb#endif
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb } else {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb r->status_line = NULL;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_unmarshal_response: status = %d", status);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_get_uint16(msg, &num_headers);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc == APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb r->headers_out = apr_table_make(r->pool, num_headers);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb } else {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb r->headers_out = NULL;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb num_headers = 0;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_unmarshal_response: Number of headers is = %d",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb num_headers);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb for(i = 0 ; i < (int) num_headers ; i++) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_uint16_t name;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const char *stringname;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb const char *value;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_peek_uint16(msg, &name);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if ((name & 0XFF00) == 0XA000) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_peek_uint16(msg, &name);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb stringname = long_res_header_for_sc(name);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (stringname == NULL) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_unmarshal_response: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "No such sc (%08x)",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb name);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EBAD_HEADER;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb } else {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb name = 0;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_get_string(msg, &stringname);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_unmarshal_response: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Null header name");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb#if defined(AS400) || defined(_OSD_POSIX)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_xlate_proto_from_ascii(stringname, strlen(stringname));
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb#endif
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_get_string(msg, &value);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_unmarshal_response: "
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "Null header value");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb /* Set-Cookie need additional processing */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (!strcasecmp(stringname, "Set-Cookie")) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb value = ap_proxy_cookie_reverse_map(r, dconf, value);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb /* Location, Content-Location, URI and Destination need additional
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * processing */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb else if (!strcasecmp(stringname, "Location")
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb || !strcasecmp(stringname, "Content-Location")
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb || !strcasecmp(stringname, "URI")
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb || !strcasecmp(stringname, "Destination"))
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb value = ap_proxy_location_reverse_map(r, dconf, value);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb#if defined(AS400) || defined(_OSD_POSIX)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_xlate_proto_from_ascii(value, strlen(value));
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb#endif
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_unmarshal_response: Header[%d] [%s] = [%s]",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb i, stringname, value);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_table_add(r->headers_out, stringname, value);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb /* Content-type needs an additional handling */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (memcmp(stringname, "Content-Type", 12) == 0) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb /* add corresponding filter */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_set_content_type(r, apr_pstrdup(r->pool, value));
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_unmarshal_response: ap_set_content_type done");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return APR_SUCCESS;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/*
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Build the ajp header message and send it
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbapr_status_t ajp_send_header(apr_socket_t *sock,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb request_rec *r,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_uri_t *uri)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_t *msg;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_status_t rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_create(r->pool, &msg);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_send_header: ajp_msg_create failed");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_marshal_into_msgb(msg, r, uri);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_send_header: ajp_marshal_into_msgb failed");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_ilink_send(sock, msg);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_send_header: ajp_ilink_send failed");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return APR_SUCCESS;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/*
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Read the ajp message and return the type of the message.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbapr_status_t ajp_read_header(apr_socket_t *sock,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb request_rec *r,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_t **msg)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_byte_t result;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_status_t rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_create(r->pool, msg);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_read_header: ajp_msg_create failed");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_reset(*msg);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_ilink_receive(sock, *msg);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_read_header: ajp_ilink_receive failed");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_peek_uint8(*msg, &result);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_read_header: ajp_ilink_received %02x", result);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return APR_SUCCESS;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/* parse the msg to read the type */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbint ajp_parse_type(request_rec *r, ajp_msg_t *msg)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_byte_t result;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_peek_uint8(msg, &result);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_parse_type: got %02x", result);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return (int) result;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/* parse the header */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbapr_status_t ajp_parse_header(request_rec *r, proxy_dir_conf *conf,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_t *msg)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_byte_t result;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_status_t rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_get_uint8(msg, &result);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_parse_headers: ajp_msg_get_byte failed");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (result != CMD_AJP13_SEND_HEADERS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_parse_headers: wrong type %02x expecting 0x04", result);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EBAD_HEADER;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return ajp_unmarshal_response(msg, r, conf);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/* parse the body and return data address and length */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbapr_status_t ajp_parse_data(request_rec *r, ajp_msg_t *msg,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_uint16_t *len, char **ptr)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_byte_t result;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_status_t rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_get_uint8(msg, &result);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_parse_data: ajp_msg_get_byte failed");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (result != CMD_AJP13_SEND_BODY_CHUNK) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "ajp_parse_data: wrong type %02x expecting 0x03", result);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return AJP_EBAD_HEADER;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb rc = ajp_msg_get_uint16(msg, len);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (rc != APR_SUCCESS) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb }
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *ptr = (char *)&(msg->buf[msg->pos]);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return APR_SUCCESS;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/*
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Allocate a msg to send data
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbapr_status_t ajp_alloc_data_msg(apr_pool_t *pool, char **ptr, apr_size_t *len,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_t **msg)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb apr_status_t rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if ((rc = ajp_msg_create(pool, msg)) != APR_SUCCESS)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return rc;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_reset(*msg);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *ptr = (char *)&((*msg)->buf[6]);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb *len = AJP_MSG_BUFFER_SZ-6;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return APR_SUCCESS;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/*
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Send the data message
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbapr_status_t ajp_send_data_msg(apr_socket_t *sock,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb ajp_msg_t *msg, apr_size_t len)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb{
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb msg->buf[4] = (apr_byte_t)((len >> 8) & 0xFF);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb msg->buf[5] = (apr_byte_t)(len & 0xFF);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb msg->len += len + 2; /* + 1 XXXX where is '\0' */
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb return ajp_ilink_send(sock, msg);
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb}
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb