/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*/ package org.apache.coyote.ajp;
// Terminates list of attributes publicstaticfinalbyte SC_A_ARE_DONE = (byte) 0xFF;
/** * Default maximum total byte size for an AJP packet
*/ publicstaticfinalint MAX_PACKET_SIZE = 8192; /** * Size of basic packet header
*/ publicstaticfinalint H_SIZE = 4;
/** * Size of the header metadata
*/ publicstaticfinalint READ_HEAD_LEN = 6; publicstaticfinalint SEND_HEAD_LEN = 8;
/** * Default maximum size of data that can be sent in one packet
*/ publicstaticfinalint MAX_READ_SIZE = MAX_PACKET_SIZE - READ_HEAD_LEN; publicstaticfinalint MAX_SEND_SIZE = MAX_PACKET_SIZE - SEND_HEAD_LEN;
/** * Converts an AJP coded HTTP method to the method name. * * @param code the coded value * * @return the string value of the method
*/ publicstatic String getMethodForCode(finalint code) { return methodTransArray[code];
}
/** * Converts an AJP coded HTTP request header to the header name. * * @param code the coded value * * @return the string value of the header name
*/ publicstatic String getHeaderForCode(finalint code) { return headerTransArray[code];
}
/** * Converts an AJP coded response header name to the HTTP response header name. * * @param code the coded value * * @return the string value of the header
*/ publicstatic String getResponseHeaderForCode(finalint code) { return responseTransArray[code];
}
privatestaticfinal Map<String, Integer> responseTransMap = new HashMap<>(20);
static { try { for (int i = 0; i < SC_RESP_AJP13_MAX; i++) {
responseTransMap.put(getResponseHeaderForCode(i), Integer.valueOf(0xA001 + i));
}
} catch (Exception e) { // Do nothing
}
}
publicstaticint getResponseAjpIndex(String header) {
Integer i = responseTransMap.get(header); if (i == null) { return 0;
} else { return i.intValue();
}
}
}
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.