1 17 18 package org.apache.coyote.http11; 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.http11"; 38 39 public static final int DEFAULT_CONNECTION_LINGER = -1; 40 public static final int DEFAULT_CONNECTION_TIMEOUT = 60000; 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 46 49 public static final String CRLF = "\r\n"; 50 51 52 55 public static final byte[] SERVER_BYTES = 56 ByteChunk.convertToBytes("Server: Apache-Coyote/1.1" + CRLF); 57 58 59 62 public static final byte CR = (byte) '\r'; 63 64 65 68 public static final byte LF = (byte) '\n'; 69 70 71 74 public static final byte SP = (byte) ' '; 75 76 77 80 public static final byte HT = (byte) '\t'; 81 82 83 86 public static final byte COLON = (byte) ':'; 87 88 91 public static final byte SEMI_COLON = (byte) ';'; 92 93 94 95 98 public static final byte A = (byte) 'A'; 99 100 101 104 public static final byte a = (byte) 'a'; 105 106 107 110 public static final byte Z = (byte) 'Z'; 111 112 113 116 public static final byte QUESTION = (byte) '?'; 117 118 119 122 public static final byte LC_OFFSET = A - a; 123 124 125 128 public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE = 48 * 1024; 129 130 131 132 public static final byte[] CRLF_BYTES = ByteChunk.convertToBytes(CRLF); 133 public static final byte[] COLON_BYTES = ByteChunk.convertToBytes(": "); 134 public static final String CONNECTION = "Connection"; 135 public static final String CLOSE = "close"; 136 public static final byte[] CLOSE_BYTES = 137 ByteChunk.convertToBytes(CLOSE); 138 public static final String KEEPALIVE = "keep-alive"; 139 public static final byte[] KEEPALIVE_BYTES = 140 ByteChunk.convertToBytes(KEEPALIVE); 141 public static final String CHUNKED = "chunked"; 142 public static final byte[] ACK_BYTES = 143 ByteChunk.convertToBytes("HTTP/1.1 100 Continue" + CRLF + CRLF); 144 public static final String TRANSFERENCODING = "Transfer-Encoding"; 145 public static final byte[] _200_BYTES = 146 ByteChunk.convertToBytes("200"); 147 public static final byte[] _400_BYTES = 148 ByteChunk.convertToBytes("400"); 149 public static final byte[] _404_BYTES = 150 ByteChunk.convertToBytes("404"); 151 152 153 156 public static final int IDENTITY_FILTER = 0; 157 158 159 162 public static final int CHUNKED_FILTER = 1; 163 164 165 168 public static final int VOID_FILTER = 2; 169 170 171 174 public static final int GZIP_FILTER = 3; 175 176 177 180 public static final int BUFFERED_FILTER = 3; 181 182 183 186 public static final String HTTP_10 = "HTTP/1.0"; 187 188 189 192 public static final String HTTP_11 = "HTTP/1.1"; 193 public static final byte[] HTTP_11_BYTES = 194 ByteChunk.convertToBytes(HTTP_11); 195 196 197 200 public static final String GET = "GET"; 201 202 203 206 public static final String HEAD = "HEAD"; 207 208 209 212 public static final String POST = "POST"; 213 214 215 } 216 | Popular Tags |