1 17 18 package org.apache.coyote.ajp; 19 20 import org.apache.tomcat.util.buf.ByteChunk; 21 22 23 28 public final class Constants { 29 30 31 33 34 37 public static final String Package = "org.apache.coyote.ajp"; 38 39 public static final int DEFAULT_CONNECTION_LINGER = -1; 40 public static final int DEFAULT_CONNECTION_TIMEOUT = -1; 41 public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000; 42 public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0; 43 public static final boolean DEFAULT_TCP_NO_DELAY = true; 44 45 public static final byte JK_AJP13_FORWARD_REQUEST = 2; 47 public static final byte JK_AJP13_SHUTDOWN = 7; 48 public static final byte JK_AJP13_PING_REQUEST = 8; 49 public static final byte JK_AJP13_CPING_REQUEST = 10; 50 51 public static final byte JK_AJP13_SEND_BODY_CHUNK = 3; 53 public static final byte JK_AJP13_SEND_HEADERS = 4; 54 public static final byte JK_AJP13_END_RESPONSE = 5; 55 public static final byte JK_AJP13_GET_BODY_CHUNK = 6; 56 public static final byte JK_AJP13_CPONG_REPLY = 9; 57 58 public static final int SC_RESP_CONTENT_TYPE = 0xA001; 60 public static final int SC_RESP_CONTENT_LANGUAGE = 0xA002; 61 public static final int SC_RESP_CONTENT_LENGTH = 0xA003; 62 public static final int SC_RESP_DATE = 0xA004; 63 public static final int SC_RESP_LAST_MODIFIED = 0xA005; 64 public static final int SC_RESP_LOCATION = 0xA006; 65 public static final int SC_RESP_SET_COOKIE = 0xA007; 66 public static final int SC_RESP_SET_COOKIE2 = 0xA008; 67 public static final int SC_RESP_SERVLET_ENGINE = 0xA009; 68 public static final int SC_RESP_STATUS = 0xA00A; 69 public static final int SC_RESP_WWW_AUTHENTICATE = 0xA00B; 70 71 public static final byte SC_A_CONTEXT = 1; public static final byte SC_A_SERVLET_PATH = 2; public static final byte SC_A_REMOTE_USER = 3; 75 public static final byte SC_A_AUTH_TYPE = 4; 76 public static final byte SC_A_QUERY_STRING = 5; 77 public static final byte SC_A_JVM_ROUTE = 6; 78 public static final byte SC_A_SSL_CERT = 7; 79 public static final byte SC_A_SSL_CIPHER = 8; 80 public static final byte SC_A_SSL_SESSION = 9; 81 public static final byte SC_A_SSL_KEYSIZE = 11; 82 public static final byte SC_A_SECRET = 12; 83 public static final byte SC_A_STORED_METHOD = 13; 84 85 public static final byte SC_A_REQ_ATTRIBUTE = 10; 87 88 public static final byte SC_A_ARE_DONE = (byte)0xFF; 90 91 93 96 public static final int MAX_PACKET_SIZE = 8192; 97 100 public static final int H_SIZE = 4; 101 102 105 public static final int READ_HEAD_LEN = 6; 106 public static final int SEND_HEAD_LEN = 8; 107 108 111 public static final int MAX_READ_SIZE = MAX_PACKET_SIZE - READ_HEAD_LEN; 112 public static final int MAX_SEND_SIZE = MAX_PACKET_SIZE - SEND_HEAD_LEN; 113 114 public static final String []methodTransArray = { 116 "OPTIONS", 117 "GET", 118 "HEAD", 119 "POST", 120 "PUT", 121 "DELETE", 122 "TRACE", 123 "PROPFIND", 124 "PROPPATCH", 125 "MKCOL", 126 "COPY", 127 "MOVE", 128 "LOCK", 129 "UNLOCK", 130 "ACL", 131 "REPORT", 132 "VERSION-CONTROL", 133 "CHECKIN", 134 "CHECKOUT", 135 "UNCHECKOUT", 136 "SEARCH", 137 "MKWORKSPACE", 138 "UPDATE", 139 "LABEL", 140 "MERGE", 141 "BASELINE-CONTROL", 142 "MKACTIVITY" 143 }; 144 public static final int SC_M_JK_STORED = (byte) 0xFF; 145 146 public static final int SC_REQ_ACCEPT = 1; 148 public static final int SC_REQ_ACCEPT_CHARSET = 2; 149 public static final int SC_REQ_ACCEPT_ENCODING = 3; 150 public static final int SC_REQ_ACCEPT_LANGUAGE = 4; 151 public static final int SC_REQ_AUTHORIZATION = 5; 152 public static final int SC_REQ_CONNECTION = 6; 153 public static final int SC_REQ_CONTENT_TYPE = 7; 154 public static final int SC_REQ_CONTENT_LENGTH = 8; 155 public static final int SC_REQ_COOKIE = 9; 156 public static final int SC_REQ_COOKIE2 = 10; 157 public static final int SC_REQ_HOST = 11; 158 public static final int SC_REQ_PRAGMA = 12; 159 public static final int SC_REQ_REFERER = 13; 160 public static final int SC_REQ_USER_AGENT = 14; 161 public static final byte SC_A_SSL_KEY_SIZE = 11; 164 public static final String []headerTransArray = { 166 "accept", 167 "accept-charset", 168 "accept-encoding", 169 "accept-language", 170 "authorization", 171 "connection", 172 "content-type", 173 "content-length", 174 "cookie", 175 "cookie2", 176 "host", 177 "pragma", 178 "referer", 179 "user-agent" 180 }; 181 182 183 186 public static final String CRLF = "\r\n"; 187 188 189 192 public static final byte[] SERVER_BYTES = 193 ByteChunk.convertToBytes("Server: Apache-Coyote/1.1" + CRLF); 194 195 196 199 public static final byte CR = (byte) '\r'; 200 201 202 205 public static final byte LF = (byte) '\n'; 206 207 208 211 public static final byte SP = (byte) ' '; 212 213 214 217 public static final byte HT = (byte) '\t'; 218 219 220 223 public static final byte COLON = (byte) ':'; 224 225 226 229 public static final byte A = (byte) 'A'; 230 231 232 235 public static final byte a = (byte) 'a'; 236 237 238 241 public static final byte Z = (byte) 'Z'; 242 243 244 247 public static final byte QUESTION = (byte) '?'; 248 249 250 253 public static final byte LC_OFFSET = A - a; 254 255 256 259 public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE = 48 * 1024; 260 261 262 263 public static final byte[] CRLF_BYTES = ByteChunk.convertToBytes(CRLF); 264 public static final byte[] COLON_BYTES = ByteChunk.convertToBytes(": "); 265 public static final String CONNECTION = "Connection"; 266 public static final String CLOSE = "close"; 267 public static final byte[] CLOSE_BYTES = 268 ByteChunk.convertToBytes(CLOSE); 269 public static final String KEEPALIVE = "keep-alive"; 270 public static final byte[] KEEPALIVE_BYTES = 271 ByteChunk.convertToBytes(KEEPALIVE); 272 public static final String CHUNKED = "chunked"; 273 public static final byte[] ACK_BYTES = 274 ByteChunk.convertToBytes("HTTP/1.1 100 Continue" + CRLF + CRLF); 275 public static final String TRANSFERENCODING = "Transfer-Encoding"; 276 public static final byte[] _200_BYTES = 277 ByteChunk.convertToBytes("200"); 278 public static final byte[] _400_BYTES = 279 ByteChunk.convertToBytes("400"); 280 public static final byte[] _404_BYTES = 281 ByteChunk.convertToBytes("404"); 282 283 284 287 public static final int IDENTITY_FILTER = 0; 288 289 290 293 public static final int CHUNKED_FILTER = 1; 294 295 296 299 public static final int VOID_FILTER = 2; 300 301 302 305 public static final int GZIP_FILTER = 3; 306 307 308 311 public static final int BUFFERED_FILTER = 3; 312 313 314 317 public static final String HTTP_10 = "HTTP/1.0"; 318 319 320 323 public static final String HTTP_11 = "HTTP/1.1"; 324 public static final byte[] HTTP_11_BYTES = 325 ByteChunk.convertToBytes(HTTP_11); 326 327 328 331 public static final String GET = "GET"; 332 333 334 337 public static final String HEAD = "HEAD"; 338 339 340 343 public static final String POST = "POST"; 344 345 346 } 347 | Popular Tags |