PageRenderTime 238ms CodeModel.GetById 36ms app.highlight 185ms RepoModel.GetById 1ms app.codeStats 0ms

/src/kilim/http/HttpRequestParser.java

http://github.com/kilim/kilim
Java | 1719 lines | 1424 code | 163 blank | 132 comment | 103 complexity | 97bc913f5d21af721e51bc51b78bfc43 MD5 | raw file
   1
   2// line 1 "HttpRequestParser.rl"
   3/* Copyright (c) 2006, Sriram Srinivasan
   4 *
   5 * You may distribute this software under the terms of the license 
   6 * specified in the file "License"
   7 */
   8
   9package kilim.http;
  10
  11/**
  12 * --- DO NOT EDIT -----
  13 * HttpRequestParser.java generated from RAGEL (http://www.complang.org/ragel/) from the
  14 * specification file HttpRequestParser.rl. All changes must be made in the .rl file.
  15 **/
  16
  17import java.util.TimeZone;
  18import java.util.GregorianCalendar;
  19import java.nio.charset.Charset;
  20import java.nio.ByteBuffer;
  21import java.io.UnsupportedEncodingException;
  22import java.io.IOException;
  23import java.net.URLDecoder;
  24
  25public class HttpRequestParser {
  26  public static final Charset UTF8 = Charset.forName("UTF-8");
  27
  28  
  29// line 135 "HttpRequestParser.rl"
  30
  31
  32  
  33// line 34 "HttpRequestParser.java"
  34private static byte[] init__http_parser_actions_0()
  35{
  36	return new byte [] {
  37	    0,    1,    0,    1,    1,    1,    2,    1,    3,    1,    4,    1,
  38	    5,    1,    6,    1,    7,    1,    8,    1,    9,    1,   10,    1,
  39	   11,    1,   12,    1,   13,    2,    0,    3,    2,    0,    6,    2,
  40	    1,    5
  41	};
  42}
  43
  44private static final byte _http_parser_actions[] = init__http_parser_actions_0();
  45
  46
  47private static short[] init__http_parser_key_offsets_0()
  48{
  49	return new short [] {
  50	    0,    0,   10,   12,   14,   16,   18,   20,   21,   31,   41,   50,
  51	   52,   53,   54,   55,   56,   58,   61,   63,   66,   67,   69,   70,
  52	   72,   73,   75,   84,   93,   99,  105,  111,  117,  121,  125,  135,
  53	  141,  147,  156,  165,  171,  177,  179,  181,  183,  185,  187,  189,
  54	  191,  193,  195,  197,  199,  203,  205,  207,  209
  55	};
  56}
  57
  58private static final short _http_parser_key_offsets[] = init__http_parser_key_offsets_0();
  59
  60
  61private static char[] init__http_parser_trans_keys_0()
  62{
  63	return new char [] {
  64	   68,   71,   72,   79,   80,  100,  103,  104,  111,  112,   69,  101,
  65	   76,  108,   69,  101,   84,  116,   69,  101,   32,   32,   43,   47,
  66	   58,   45,   57,   65,   90,   97,  122,   43,   58,   45,   46,   48,
  67	   57,   65,   90,   97,  122,   32,   34,   35,   37,   60,   62,  127,
  68	    0,   31,   32,   72,   84,   84,   80,   47,   48,   57,   46,   48,
  69	   57,   48,   57,   13,   48,   57,   10,   13,   58,   58,   13,   32,
  70	   13,   10,   58,   32,   37,   60,   62,  127,    0,   31,   34,   35,
  71	   32,   37,   60,   62,  127,    0,   31,   34,   35,   48,   57,   65,
  72	   70,   97,  102,   48,   57,   65,   70,   97,  102,   48,   57,   65,
  73	   70,   97,  102,   48,   57,   65,   70,   97,  102,   32,   35,   59,
  74	   63,   32,   35,   59,   63,   32,   34,   35,   37,   60,   62,   63,
  75	  127,    0,   31,   48,   57,   65,   70,   97,  102,   48,   57,   65,
  76	   70,   97,  102,   32,   34,   35,   37,   60,   62,  127,    0,   31,
  77	   32,   34,   35,   37,   60,   62,  127,    0,   31,   48,   57,   65,
  78	   70,   97,  102,   48,   57,   65,   70,   97,  102,   69,  101,   84,
  79	  116,   69,  101,   65,   97,   68,  100,   80,  112,   84,  116,   73,
  80	  105,   79,  111,   78,  110,   83,  115,   79,   85,  111,  117,   83,
  81	  115,   84,  116,   84,  116,   58,    0
  82	};
  83}
  84
  85private static final char _http_parser_trans_keys[] = init__http_parser_trans_keys_0();
  86
  87
  88private static byte[] init__http_parser_single_lengths_0()
  89{
  90	return new byte [] {
  91	    0,   10,    2,    2,    2,    2,    2,    1,    4,    2,    7,    2,
  92	    1,    1,    1,    1,    0,    1,    0,    1,    1,    2,    1,    2,
  93	    1,    2,    5,    5,    0,    0,    0,    0,    4,    4,    8,    0,
  94	    0,    7,    7,    0,    0,    2,    2,    2,    2,    2,    2,    2,
  95	    2,    2,    2,    2,    4,    2,    2,    2,    1
  96	};
  97}
  98
  99private static final byte _http_parser_single_lengths[] = init__http_parser_single_lengths_0();
 100
 101
 102private static byte[] init__http_parser_range_lengths_0()
 103{
 104	return new byte [] {
 105	    0,    0,    0,    0,    0,    0,    0,    0,    3,    4,    1,    0,
 106	    0,    0,    0,    0,    1,    1,    1,    1,    0,    0,    0,    0,
 107	    0,    0,    2,    2,    3,    3,    3,    3,    0,    0,    1,    3,
 108	    3,    1,    1,    3,    3,    0,    0,    0,    0,    0,    0,    0,
 109	    0,    0,    0,    0,    0,    0,    0,    0,    0
 110	};
 111}
 112
 113private static final byte _http_parser_range_lengths[] = init__http_parser_range_lengths_0();
 114
 115
 116private static short[] init__http_parser_index_offsets_0()
 117{
 118	return new short [] {
 119	    0,    0,   11,   14,   17,   20,   23,   26,   28,   36,   43,   52,
 120	   55,   57,   59,   61,   63,   65,   68,   70,   73,   75,   78,   80,
 121	   83,   85,   88,   96,  104,  108,  112,  116,  120,  125,  130,  140,
 122	  144,  148,  157,  166,  170,  174,  177,  180,  183,  186,  189,  192,
 123	  195,  198,  201,  204,  207,  212,  215,  218,  221
 124	};
 125}
 126
 127private static final short _http_parser_index_offsets[] = init__http_parser_index_offsets_0();
 128
 129
 130private static byte[] init__http_parser_indicies_0()
 131{
 132	return new byte [] {
 133	    0,    2,    3,    4,    5,    0,    2,    3,    4,    5,    1,    6,
 134	    6,    1,    7,    7,    1,    8,    8,    1,    9,    9,    1,   10,
 135	   10,    1,   11,    1,   11,   12,   13,   14,   12,   12,   12,    1,
 136	   15,   16,   15,   15,   15,   15,    1,   17,    1,   18,   19,    1,
 137	    1,    1,    1,   16,   17,   20,    1,   21,    1,   22,    1,   23,
 138	    1,   24,    1,   25,    1,   26,   27,    1,   28,    1,   29,   28,
 139	    1,   30,    1,   32,    1,   31,   34,   33,   36,   37,   35,   39,
 140	   38,   40,   34,   33,   41,   43,    1,    1,    1,    1,    1,   42,
 141	   44,   46,    1,    1,    1,    1,    1,   45,   47,   47,   47,    1,
 142	   45,   45,   45,    1,   48,   48,   48,    1,   16,   16,   16,    1,
 143	   17,   18,   50,   51,   49,   52,   53,   54,   55,   49,   17,    1,
 144	   18,   56,    1,    1,   51,    1,    1,   50,   57,   57,   57,    1,
 145	   50,   50,   50,    1,   58,    1,   60,   61,    1,    1,    1,    1,
 146	   59,   62,    1,   64,   65,    1,    1,    1,    1,   63,   66,   66,
 147	   66,    1,   63,   63,   63,    1,   67,   67,    1,   68,   68,    1,
 148	   69,   69,    1,   70,   70,    1,   71,   71,    1,   72,   72,    1,
 149	   73,   73,    1,   74,   74,    1,   75,   75,    1,   76,   76,    1,
 150	   77,   77,    1,   78,   79,   78,   79,    1,   80,   80,    1,   81,
 151	   81,    1,   82,   82,    1,   34,   33,    0
 152	};
 153}
 154
 155private static final byte _http_parser_indicies[] = init__http_parser_indicies_0();
 156
 157
 158private static byte[] init__http_parser_trans_targs_0()
 159{
 160	return new byte [] {
 161	    2,    0,   41,   43,   46,   52,    3,    4,    5,    6,    7,    8,
 162	    9,   32,   10,    9,   10,   11,   26,   30,   12,   13,   14,   15,
 163	   16,   17,   18,   17,   19,   20,   21,   22,   25,   22,   23,   24,
 164	   20,   23,   24,   20,   56,   11,   27,   28,   11,   27,   28,   29,
 165	   31,   33,   34,   37,   11,   26,   34,   37,   35,   36,   11,   38,
 166	   26,   39,   11,   38,   26,   39,   40,   42,    7,   44,   45,    7,
 167	   47,   48,   49,   50,   51,    7,   53,   55,   54,    7,    7
 168	};
 169}
 170
 171private static final byte _http_parser_trans_targs[] = init__http_parser_trans_targs_0();
 172
 173
 174private static byte[] init__http_parser_trans_actions_0()
 175{
 176	return new byte [] {
 177	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,   21,    0,
 178	    1,    1,    1,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 179	    0,    1,    0,    0,    0,   15,    0,    1,    1,    0,    5,    1,
 180	   29,    1,    0,    7,    0,   32,    1,    1,   13,    0,    0,    0,
 181	    0,    0,    0,    0,    9,    9,    9,    9,    0,    0,   35,    3,
 182	   35,    3,   11,    0,   11,    0,    0,    0,   17,    0,    0,   23,
 183	    0,    0,    0,    0,    0,   27,    0,    0,    0,   19,   25
 184	};
 185}
 186
 187private static final byte _http_parser_trans_actions[] = init__http_parser_trans_actions_0();
 188
 189
 190static final int http_parser_start = 1;
 191static final int http_parser_first_final = 56;
 192static final int http_parser_error = 0;
 193
 194static final int http_parser_en_main = 1;
 195
 196
 197// line 138 "HttpRequestParser.rl"
 198
 199  public static void err(String msg) throws IOException{
 200    throw new IOException(msg);
 201  }
 202
 203  public static void initHeader(HttpRequest req, int headerLength) throws IOException {
 204    ByteBuffer bb = req.buffer;
 205    /* required variables */
 206    byte[] data = bb.array();
 207    int p = 0;
 208    int pe = headerLength;
 209//  int eof = pe;
 210    int cs = 0;
 211
 212    // variables used by actions in http_req_parser machine above.
 213    int query_start = 0;
 214    int mark = 0;
 215    String field_name = "";
 216
 217    
 218// line 219 "HttpRequestParser.java"
 219	{
 220	cs = http_parser_start;
 221	}
 222
 223// line 158 "HttpRequestParser.rl"
 224    
 225// line 226 "HttpRequestParser.java"
 226	{
 227	int _klen;
 228	int _trans = 0;
 229	int _acts;
 230	int _nacts;
 231	int _keys;
 232	int _goto_targ = 0;
 233
 234	_goto: while (true) {
 235	switch ( _goto_targ ) {
 236	case 0:
 237	if ( p == pe ) {
 238		_goto_targ = 4;
 239		continue _goto;
 240	}
 241	if ( cs == 0 ) {
 242		_goto_targ = 5;
 243		continue _goto;
 244	}
 245case 1:
 246	_match: do {
 247	_keys = _http_parser_key_offsets[cs];
 248	_trans = _http_parser_index_offsets[cs];
 249	_klen = _http_parser_single_lengths[cs];
 250	if ( _klen > 0 ) {
 251		int _lower = _keys;
 252		int _mid;
 253		int _upper = _keys + _klen - 1;
 254		while (true) {
 255			if ( _upper < _lower )
 256				break;
 257
 258			_mid = _lower + ((_upper-_lower) >> 1);
 259			if ( data[p] < _http_parser_trans_keys[_mid] )
 260				_upper = _mid - 1;
 261			else if ( data[p] > _http_parser_trans_keys[_mid] )
 262				_lower = _mid + 1;
 263			else {
 264				_trans += (_mid - _keys);
 265				break _match;
 266			}
 267		}
 268		_keys += _klen;
 269		_trans += _klen;
 270	}
 271
 272	_klen = _http_parser_range_lengths[cs];
 273	if ( _klen > 0 ) {
 274		int _lower = _keys;
 275		int _mid;
 276		int _upper = _keys + (_klen<<1) - 2;
 277		while (true) {
 278			if ( _upper < _lower )
 279				break;
 280
 281			_mid = _lower + (((_upper-_lower) >> 1) & ~1);
 282			if ( data[p] < _http_parser_trans_keys[_mid] )
 283				_upper = _mid - 2;
 284			else if ( data[p] > _http_parser_trans_keys[_mid+1] )
 285				_lower = _mid + 2;
 286			else {
 287				_trans += ((_mid - _keys)>>1);
 288				break _match;
 289			}
 290		}
 291		_trans += _klen;
 292	}
 293	} while (false);
 294
 295	_trans = _http_parser_indicies[_trans];
 296	cs = _http_parser_trans_targs[_trans];
 297
 298	if ( _http_parser_trans_actions[_trans] != 0 ) {
 299		_acts = _http_parser_trans_actions[_trans];
 300		_nacts = (int) _http_parser_actions[_acts++];
 301		while ( _nacts-- > 0 )
 302	{
 303			switch ( _http_parser_actions[_acts++] )
 304			{
 305	case 0:
 306// line 31 "HttpRequestParser.rl"
 307	{mark = p; }
 308	break;
 309	case 1:
 310// line 33 "HttpRequestParser.rl"
 311	{query_start = p; }
 312	break;
 313	case 2:
 314// line 35 "HttpRequestParser.rl"
 315	{ 
 316      field_name = kw_lookup(data, mark, p);
 317      if (field_name == null) {// not a known keyword
 318        field_name = req.extractRange(mark, p);
 319      }
 320    }
 321	break;
 322	case 3:
 323// line 42 "HttpRequestParser.rl"
 324	{
 325      int value = encodeRange(mark, p);
 326      req.addField(field_name, value);
 327    }
 328	break;
 329	case 4:
 330// line 47 "HttpRequestParser.rl"
 331	{
 332      req.uriPath = req.extractRange(mark, p);
 333      String s = req.uriPath;
 334      int len = s.length();
 335      boolean need_decode;
 336      // Scan the string to see if the string requires any conversion.
 337      for (int i = 0; i < len; i++) {
 338         char c = s.charAt(i);
 339         if (c == '%' || c > 0x7F) {
 340           try {
 341              // TODO: Correct this. URLDecoder is broken for path (upto
 342              // JDK1.6): it converts'+' to ' ', which should
 343              // be done only for the query part of the url.
 344              req.uriPath = URLDecoder.decode(req.uriPath, "UTF-8");
 345              break;
 346           } catch (UnsupportedEncodingException ignore){}
 347         }
 348      }
 349    }
 350	break;
 351	case 5:
 352// line 72 "HttpRequestParser.rl"
 353	{
 354      req.queryStringRange = encodeRange(query_start, p);
 355    }
 356	break;
 357	case 6:
 358// line 76 "HttpRequestParser.rl"
 359	{ 
 360      req.uriFragmentRange = encodeRange(mark, p);
 361    }
 362	break;
 363	case 7:
 364// line 80 "HttpRequestParser.rl"
 365	{
 366      req.versionRange = encodeRange(mark, p);
 367    }
 368	break;
 369	case 8:
 370// line 119 "HttpRequestParser.rl"
 371	{req.method = "GET";}
 372	break;
 373	case 9:
 374// line 120 "HttpRequestParser.rl"
 375	{req.method = "POST";}
 376	break;
 377	case 10:
 378// line 121 "HttpRequestParser.rl"
 379	{req.method = "DELETE";}
 380	break;
 381	case 11:
 382// line 122 "HttpRequestParser.rl"
 383	{req.method = "HEAD";}
 384	break;
 385	case 12:
 386// line 123 "HttpRequestParser.rl"
 387	{req.method = "PUT";}
 388	break;
 389	case 13:
 390// line 124 "HttpRequestParser.rl"
 391	{req.method = "OPTIONS";}
 392	break;
 393// line 394 "HttpRequestParser.java"
 394			}
 395		}
 396	}
 397
 398case 2:
 399	if ( cs == 0 ) {
 400		_goto_targ = 5;
 401		continue _goto;
 402	}
 403	if ( ++p != pe ) {
 404		_goto_targ = 1;
 405		continue _goto;
 406	}
 407case 4:
 408case 5:
 409	}
 410	break; }
 411	}
 412
 413// line 159 "HttpRequestParser.rl"
 414    
 415    if (cs == http_parser_error) {
 416      throw new IOException("Malformed HTTP Header. p = " + p +", cs = " + cs);
 417    }
 418  }
 419
 420  /**
 421   * encode the start pos and length as ints;
 422   */
 423  public static int encodeRange(int start, int end) {
 424    return (start << 16) + end ;
 425  }
 426
 427  
 428// line 429 "HttpRequestParser.java"
 429private static byte[] init__http_keywords_actions_0()
 430{
 431	return new byte [] {
 432	    0,    1,    0,    1,    1,    1,    2,    1,    3,    1,    4,    1,
 433	    5,    1,    6,    1,    7,    1,    8,    1,    9,    1,   10,    1,
 434	   11,    1,   12,    1,   13,    1,   14,    1,   15,    1,   16,    1,
 435	   17,    1,   18,    1,   19,    1,   20,    1,   21,    1,   22,    1,
 436	   23,    1,   24,    1,   25,    1,   26,    1,   27,    1,   28,    1,
 437	   29,    1,   30,    1,   31,    1,   32,    1,   33,    1,   34,    1,
 438	   35,    1,   36,    1,   37,    1,   38,    1,   39,    1,   40,    1,
 439	   41,    1,   42,    1,   43,    1,   44,    1,   45,    1,   46,    1,
 440	   47,    1,   48,    1,   49,    1,   50
 441	};
 442}
 443
 444private static final byte _http_keywords_actions[] = init__http_keywords_actions_0();
 445
 446
 447private static short[] init__http_keywords_key_offsets_0()
 448{
 449	return new short [] {
 450	    0,    0,    8,   10,   12,   14,   16,   24,   26,   28,   30,   32,
 451	   34,   36,   38,   40,   42,   44,   46,   48,   50,   52,   54,   56,
 452	   58,   60,   62,   64,   66,   68,   70,   72,   74,   76,   78,   80,
 453	   82,   84,   86,   88,   90,   92,   94,   96,   98,  100,  102,  104,
 454	  108,  110,  112,  114,  115,  117,  119,  121,  123,  125,  127,  129,
 455	  131,  135,  137,  139,  141,  143,  145,  147,  149,  151,  153,  154,
 456	  164,  166,  168,  170,  172,  174,  176,  178,  184,  186,  188,  190,
 457	  192,  194,  196,  198,  200,  202,  204,  206,  208,  210,  212,  214,
 458	  216,  218,  219,  221,  223,  225,  227,  229,  231,  233,  235,  237,
 459	  239,  243,  245,  247,  249,  253,  255,  257,  259,  261,  263,  265,
 460	  267,  269,  271,  273,  275,  277,  278,  286,  290,  292,  294,  296,
 461	  298,  300,  302,  304,  306,  308,  309,  311,  313,  315,  317,  319,
 462	  321,  323,  325,  326,  328,  330,  332,  334,  336,  338,  340,  342,
 463	  344,  346,  348,  350,  352,  354,  356,  358,  360,  362,  363,  365,
 464	  367,  369,  371,  373,  377,  379,  381,  382,  384,  386,  388,  390,
 465	  392,  394,  396,  398,  400,  402,  404,  406,  408,  410,  412,  414,
 466	  415,  417,  419,  421,  423,  425,  427,  429,  431,  433,  437,  439,
 467	  441,  443,  445,  447,  448,  450,  452,  454,  456,  460,  462,  464,
 468	  466,  468,  470,  472,  474,  476,  478,  480,  482,  484,  486,  488,
 469	  490,  494,  496,  498,  500,  504,  506,  508,  510,  512,  514,  516,
 470	  517,  519,  521,  523,  525,  527,  529,  531,  533,  535,  537,  541,
 471	  543,  547,  549,  551,  553,  555,  557,  559,  561,  562,  564,  566,
 472	  568,  570,  572,  574,  576,  578,  582,  584,  586,  588,  590,  592,
 473	  594,  596,  597,  599,  601,  603,  605,  607,  611,  613,  615,  617,
 474	  621,  623,  625,  627,  629,  631,  633,  634,  636,  638,  640,  642,
 475	  644,  646,  648,  650,  652,  654,  656,  658,  690
 476	};
 477}
 478
 479private static final short _http_keywords_key_offsets[] = init__http_keywords_key_offsets_0();
 480
 481
 482private static char[] init__http_keywords_trans_keys_0()
 483{
 484	return new char [] {
 485	   67,   71,   76,   85,   99,  103,  108,  117,   67,   99,   69,  101,
 486	   80,  112,   84,  116,   67,   69,   76,   82,   99,  101,  108,  114,
 487	   72,  104,   65,   97,   82,  114,   83,  115,   69,  101,   84,  116,
 488	   78,  110,   67,   99,   79,  111,   68,  100,   73,  105,   78,  110,
 489	   71,  103,   65,   97,   78,  110,   71,  103,   85,  117,   65,   97,
 490	   71,  103,   69,  101,   65,   97,   78,  110,   71,  103,   69,  101,
 491	   83,  115,   69,  101,   76,  108,   79,  111,   87,  119,   84,  116,
 492	   72,  104,   79,  111,   82,  114,   73,  105,   90,  122,   65,   97,
 493	   84,  116,   73,  105,   79,  111,   78,  110,   65,   79,   97,  111,
 494	   67,   99,   72,  104,   69,  101,   45,   67,   99,   79,  111,   78,
 495	  110,   84,  116,   82,  114,   79,  111,   76,  108,   78,  110,   78,
 496	   84,  110,  116,   69,  101,   67,   99,   84,  116,   73,  105,   79,
 497	  111,   78,  110,   69,  101,   78,  110,   84,  116,   45,   69,   76,
 498	   77,   82,   84,  101,  108,  109,  114,  116,   78,  110,   67,   99,
 499	   79,  111,   68,  100,   73,  105,   78,  110,   71,  103,   65,   69,
 500	   79,   97,  101,  111,   78,  110,   71,  103,   85,  117,   65,   97,
 501	   71,  103,   69,  101,   78,  110,   71,  103,   84,  116,   72,  104,
 502	   67,   99,   65,   97,   84,  116,   73,  105,   79,  111,   78,  110,
 503	   68,  100,   53,   65,   97,   78,  110,   71,  103,   69,  101,   89,
 504	  121,   80,  112,   69,  101,   65,   97,   84,  116,   69,  101,   84,
 505	   88,  116,  120,   65,   97,   71,  103,   80,  112,   69,   73,  101,
 506	  105,   67,   99,   84,  116,   82,  114,   69,  101,   83,  115,   82,
 507	  114,   79,  111,   77,  109,   79,  111,   83,  115,   84,  116,   70,
 508	  102,   45,   77,   78,   82,   85,  109,  110,  114,  117,   65,   79,
 509	   97,  111,   84,  116,   67,   99,   72,  104,   68,  100,   73,  105,
 510	   70,  102,   73,  105,   69,  101,   68,  100,   45,   83,  115,   73,
 511	  105,   78,  110,   67,   99,   69,  101,   79,  111,   78,  110,   69,
 512	  101,   45,   77,  109,   65,   97,   84,  116,   67,   99,   72,  104,
 513	   65,   97,   78,  110,   71,  103,   69,  101,   78,  110,   77,  109,
 514	   79,  111,   68,  100,   73,  105,   70,  102,   73,  105,   69,  101,
 515	   68,  100,   45,   83,  115,   73,  105,   78,  110,   67,   99,   69,
 516	  101,   65,   79,   97,  111,   83,  115,   84,  116,   45,   77,  109,
 517	   79,  111,   68,  100,   73,  105,   70,  102,   73,  105,   69,  101,
 518	   68,  100,   67,   99,   65,   97,   84,  116,   73,  105,   79,  111,
 519	   78,  110,   65,   97,   88,  120,   45,   70,  102,   79,  111,   82,
 520	  114,   87,  119,   65,   97,   82,  114,   68,  100,   83,  115,   82,
 521	  114,   65,   79,   97,  111,   71,  103,   77,  109,   65,   97,   88,
 522	  120,   89,  121,   45,   65,   97,   85,  117,   84,  116,   72,  104,
 523	   69,   79,  101,  111,   78,  110,   84,  116,   73,  105,   67,   99,
 524	   65,   97,   84,  116,   69,  101,   82,  114,   73,  105,   90,  122,
 525	   65,   97,   84,  116,   73,  105,   79,  111,   78,  110,   65,   69,
 526	   97,  101,   78,  110,   71,  103,   69,  101,   70,   84,  102,  116,
 527	   69,  101,   82,  114,   69,  101,   82,  114,   82,  114,   89,  121,
 528	   45,   65,   97,   70,  102,   84,  116,   69,  101,   82,  114,   69,
 529	  101,   82,  114,   86,  118,   69,  101,   82,  114,   69,   82,  101,
 530	  114,   65,   97,   73,   78,  105,  110,   76,  108,   69,  101,   82,
 531	  114,   83,  115,   70,  102,   69,  101,   82,  114,   45,   69,  101,
 532	   78,  110,   67,   99,   79,  111,   68,  100,   73,  105,   78,  110,
 533	   71,  103,   80,   83,  112,  115,   71,  103,   82,  114,   65,   97,
 534	   68,  100,   69,  101,   69,  101,   82,  114,   45,   65,   97,   71,
 535	  103,   69,  101,   78,  110,   84,  116,   65,   73,   97,  105,   82,
 536	  114,   89,  121,   65,   97,   65,   87,   97,  119,   82,  114,   78,
 537	  110,   73,  105,   78,  110,   71,  103,   87,  119,   45,   65,   97,
 538	   85,  117,   84,  116,   72,  104,   69,  101,   78,  110,   84,  116,
 539	   73,  105,   67,   99,   65,   97,   84,  116,   69,  101,   65,   67,
 540	   68,   69,   70,   72,   73,   76,   77,   80,   82,   83,   84,   85,
 541	   86,   87,   97,   99,  100,  101,  102,  104,  105,  108,  109,  112,
 542	  114,  115,  116,  117,  118,  119,   45,    0
 543	};
 544}
 545
 546private static final char _http_keywords_trans_keys[] = init__http_keywords_trans_keys_0();
 547
 548
 549private static byte[] init__http_keywords_single_lengths_0()
 550{
 551	return new byte [] {
 552	    0,    8,    2,    2,    2,    2,    8,    2,    2,    2,    2,    2,
 553	    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 554	    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 555	    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    4,
 556	    2,    2,    2,    1,    2,    2,    2,    2,    2,    2,    2,    2,
 557	    4,    2,    2,    2,    2,    2,    2,    2,    2,    2,    1,   10,
 558	    2,    2,    2,    2,    2,    2,    2,    6,    2,    2,    2,    2,
 559	    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 560	    2,    1,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 561	    4,    2,    2,    2,    4,    2,    2,    2,    2,    2,    2,    2,
 562	    2,    2,    2,    2,    2,    1,    8,    4,    2,    2,    2,    2,
 563	    2,    2,    2,    2,    2,    1,    2,    2,    2,    2,    2,    2,
 564	    2,    2,    1,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 565	    2,    2,    2,    2,    2,    2,    2,    2,    2,    1,    2,    2,
 566	    2,    2,    2,    4,    2,    2,    1,    2,    2,    2,    2,    2,
 567	    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    1,
 568	    2,    2,    2,    2,    2,    2,    2,    2,    2,    4,    2,    2,
 569	    2,    2,    2,    1,    2,    2,    2,    2,    4,    2,    2,    2,
 570	    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 571	    4,    2,    2,    2,    4,    2,    2,    2,    2,    2,    2,    1,
 572	    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    4,    2,
 573	    4,    2,    2,    2,    2,    2,    2,    2,    1,    2,    2,    2,
 574	    2,    2,    2,    2,    2,    4,    2,    2,    2,    2,    2,    2,
 575	    2,    1,    2,    2,    2,    2,    2,    4,    2,    2,    2,    4,
 576	    2,    2,    2,    2,    2,    2,    1,    2,    2,    2,    2,    2,
 577	    2,    2,    2,    2,    2,    2,    2,   32,    1
 578	};
 579}
 580
 581private static final byte _http_keywords_single_lengths[] = init__http_keywords_single_lengths_0();
 582
 583
 584private static byte[] init__http_keywords_range_lengths_0()
 585{
 586	return new byte [] {
 587	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 588	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 589	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 590	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 591	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 592	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 593	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 594	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 595	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 596	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 597	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 598	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 599	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 600	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 601	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 602	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 603	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 604	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 605	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 606	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 607	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 608	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 609	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 610	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 611	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 612	    0,    0,    0,    0,    0,    0,    0,    0,    0
 613	};
 614}
 615
 616private static final byte _http_keywords_range_lengths[] = init__http_keywords_range_lengths_0();
 617
 618
 619private static short[] init__http_keywords_index_offsets_0()
 620{
 621	return new short [] {
 622	    0,    0,    9,   12,   15,   18,   21,   30,   33,   36,   39,   42,
 623	   45,   48,   51,   54,   57,   60,   63,   66,   69,   72,   75,   78,
 624	   81,   84,   87,   90,   93,   96,   99,  102,  105,  108,  111,  114,
 625	  117,  120,  123,  126,  129,  132,  135,  138,  141,  144,  147,  150,
 626	  155,  158,  161,  164,  166,  169,  172,  175,  178,  181,  184,  187,
 627	  190,  195,  198,  201,  204,  207,  210,  213,  216,  219,  222,  224,
 628	  235,  238,  241,  244,  247,  250,  253,  256,  263,  266,  269,  272,
 629	  275,  278,  281,  284,  287,  290,  293,  296,  299,  302,  305,  308,
 630	  311,  314,  316,  319,  322,  325,  328,  331,  334,  337,  340,  343,
 631	  346,  351,  354,  357,  360,  365,  368,  371,  374,  377,  380,  383,
 632	  386,  389,  392,  395,  398,  401,  403,  412,  417,  420,  423,  426,
 633	  429,  432,  435,  438,  441,  444,  446,  449,  452,  455,  458,  461,
 634	  464,  467,  470,  472,  475,  478,  481,  484,  487,  490,  493,  496,
 635	  499,  502,  505,  508,  511,  514,  517,  520,  523,  526,  528,  531,
 636	  534,  537,  540,  543,  548,  551,  554,  556,  559,  562,  565,  568,
 637	  571,  574,  577,  580,  583,  586,  589,  592,  595,  598,  601,  604,
 638	  606,  609,  612,  615,  618,  621,  624,  627,  630,  633,  638,  641,
 639	  644,  647,  650,  653,  655,  658,  661,  664,  667,  672,  675,  678,
 640	  681,  684,  687,  690,  693,  696,  699,  702,  705,  708,  711,  714,
 641	  717,  722,  725,  728,  731,  736,  739,  742,  745,  748,  751,  754,
 642	  756,  759,  762,  765,  768,  771,  774,  777,  780,  783,  786,  791,
 643	  794,  799,  802,  805,  808,  811,  814,  817,  820,  822,  825,  828,
 644	  831,  834,  837,  840,  843,  846,  851,  854,  857,  860,  863,  866,
 645	  869,  872,  874,  877,  880,  883,  886,  889,  894,  897,  900,  903,
 646	  908,  911,  914,  917,  920,  923,  926,  928,  931,  934,  937,  940,
 647	  943,  946,  949,  952,  955,  958,  961,  964,  997
 648	};
 649}
 650
 651private static final short _http_keywords_index_offsets[] = init__http_keywords_index_offsets_0();
 652
 653
 654private static short[] init__http_keywords_trans_targs_0()
 655{
 656	return new short [] {
 657	    2,   32,   33,   36,    2,   32,   33,   36,    0,    3,    3,    0,
 658	    4,    4,    0,    5,    5,    0,  308,  308,    0,    7,   13,   20,
 659	   27,    7,   13,   20,   27,  307,    8,    8,  307,    9,    9,  307,
 660	   10,   10,  307,   11,   11,  307,   12,   12,  307,  307,  307,  307,
 661	   14,   14,  307,   15,   15,  307,   16,   16,  307,   17,   17,  307,
 662	   18,   18,  307,   19,   19,  307,  307,  307,  307,   21,   21,  307,
 663	   22,   22,  307,   23,   23,  307,   24,   24,  307,   25,   25,  307,
 664	   26,   26,  307,  307,  307,  307,   28,   28,  307,   29,   29,  307,
 665	   30,   30,  307,   31,   31,  307,  307,  307,  307,  307,  307,    0,
 666	   34,   34,    0,   35,   35,    0,  307,  307,    0,   37,   37,    0,
 667	   38,   38,    0,   39,   39,    0,   40,   40,    0,   41,   41,    0,
 668	   42,   42,    0,   43,   43,    0,   44,   44,    0,   45,   45,    0,
 669	   46,   46,    0,  307,  307,    0,   48,   59,   48,   59,    0,   49,
 670	   49,    0,   50,   50,    0,   51,   51,    0,   52,    0,   53,   53,
 671	    0,   54,   54,    0,   55,   55,    0,   56,   56,    0,   57,   57,
 672	    0,   58,   58,    0,  307,  307,    0,   60,   60,    0,   61,   67,
 673	   61,   67,    0,   62,   62,    0,   63,   63,    0,   64,   64,    0,
 674	   65,   65,    0,   66,   66,    0,  307,  307,    0,   68,   68,    0,
 675	   69,   69,    0,   70,   70,    0,   71,    0,   72,   79,   96,   98,
 676	  102,   72,   79,   96,   98,  102,    0,   73,   73,    0,   74,   74,
 677	    0,   75,   75,    0,   76,   76,    0,   77,   77,    0,   78,   78,
 678	    0,  307,  307,    0,   80,   86,   90,   80,   86,   90,    0,   81,
 679	   81,    0,   82,   82,    0,   83,   83,    0,   84,   84,    0,   85,
 680	   85,    0,  307,  307,    0,   87,   87,    0,   88,   88,    0,   89,
 681	   89,    0,  307,  307,    0,   91,   91,    0,   92,   92,    0,   93,
 682	   93,    0,   94,   94,    0,   95,   95,    0,  307,  307,    0,   97,
 683	   97,    0,  307,    0,   99,   99,    0,  100,  100,    0,  101,  101,
 684	    0,  307,  307,    0,  103,  103,    0,  104,  104,    0,  307,  307,
 685	    0,  106,  106,    0,  107,  107,    0,  307,  307,    0,  109,  111,
 686	  109,  111,    0,  110,  110,    0,  307,  307,    0,  112,  112,    0,
 687	  113,  115,  113,  115,    0,  114,  114,    0,  307,  307,    0,  116,
 688	  116,    0,  117,  117,    0,  307,  307,    0,  119,  119,    0,  120,
 689	  120,    0,  307,  307,    0,  122,  122,    0,  123,  123,    0,  307,
 690	  307,    0,  125,  125,    0,  126,    0,  127,  143,  152,  156,  127,
 691	  143,  152,  156,    0,  128,  131,  128,  131,    0,  129,  129,    0,
 692	  130,  130,    0,  307,  307,    0,  132,  132,    0,  133,  133,    0,
 693	  134,  134,    0,  135,  135,    0,  136,  136,    0,  137,  137,    0,
 694	  138,    0,  139,  139,    0,  140,  140,    0,  141,  141,    0,  142,
 695	  142,    0,  307,  307,    0,  144,  144,    0,  145,  145,    0,  146,
 696	  146,    0,  147,    0,  148,  148,    0,  149,  149,    0,  150,  150,
 697	    0,  151,  151,    0,  307,  307,    0,  153,  153,    0,  154,  154,
 698	    0,  155,  155,    0,  307,  307,    0,  157,  157,    0,  158,  158,
 699	    0,  159,  159,    0,  160,  160,    0,  161,  161,    0,  162,  162,
 700	    0,  163,  163,    0,  164,  164,    0,  165,  165,    0,  166,    0,
 701	  167,  167,    0,  168,  168,    0,  169,  169,    0,  170,  170,    0,
 702	  307,  307,    0,  172,  183,  172,  183,    0,  173,  173,    0,  174,
 703	  174,    0,  175,    0,  176,  176,    0,  177,  177,    0,  178,  178,
 704	    0,  179,  179,    0,  180,  180,    0,  181,  181,    0,  182,  182,
 705	    0,  307,  307,    0,  184,  184,    0,  185,  185,    0,  186,  186,
 706	    0,  187,  187,    0,  188,  188,    0,  307,  307,    0,  190,  190,
 707	    0,  191,  191,    0,  192,    0,  193,  193,    0,  194,  194,    0,
 708	  195,  195,    0,  196,  196,    0,  197,  197,    0,  198,  198,    0,
 709	  199,  199,    0,  307,  307,    0,  201,  201,    0,  202,  205,  202,
 710	  205,    0,  203,  203,    0,  204,  204,    0,  307,  307,    0,  206,
 711	  206,    0,  207,  207,    0,  208,    0,  209,  209,    0,  210,  210,
 712	    0,  211,  211,    0,  212,  212,    0,  213,  220,  213,  220,    0,
 713	  214,  214,    0,  215,  215,    0,  216,  216,    0,  217,  217,    0,
 714	  218,  218,    0,  219,  219,    0,  307,  307,    0,  221,  221,    0,
 715	  222,  222,    0,  223,  223,    0,  224,  224,    0,  225,  225,    0,
 716	  226,  226,    0,  227,  227,    0,  307,  307,    0,  229,  232,  229,
 717	  232,    0,  230,  230,    0,  231,  231,    0,  307,  307,    0,  233,
 718	  237,  233,  237,    0,  234,  234,    0,  235,  235,    0,  236,  236,
 719	    0,  307,  307,    0,  238,  238,    0,  239,  239,    0,  240,    0,
 720	  241,  241,    0,  242,  242,    0,  243,  243,    0,  244,  244,    0,
 721	  307,  307,    0,  246,  246,    0,  247,  247,    0,  248,  248,    0,
 722	  249,  249,    0,  307,  307,    0,  307,  251,  307,  251,    0,  252,
 723	  252,    0,  253,  256,  253,  256,    0,  254,  254,    0,  255,  255,
 724	    0,  307,  307,    0,  257,  257,    0,  258,  258,    0,  259,  259,
 725	    0,  260,  260,    0,  261,    0,  262,  262,    0,  263,  263,    0,
 726	  264,  264,    0,  265,  265,    0,  266,  266,    0,  267,  267,    0,
 727	  268,  268,    0,  307,  307,    0,  270,  275,  270,  275,    0,  271,
 728	  271,    0,  272,  272,    0,  273,  273,    0,  274,  274,    0,  307,
 729	  307,    0,  276,  276,    0,  277,  277,    0,  278,    0,  279,  279,
 730	    0,  280,  280,    0,  281,  281,    0,  282,  282,    0,  307,  307,
 731	    0,  284,  286,  284,  286,    0,  285,  285,    0,  307,  307,    0,
 732	  307,  307,    0,  288,  293,  288,  293,    0,  289,  289,    0,  290,
 733	  290,    0,  291,  291,    0,  292,  292,    0,  307,  307,    0,  294,
 734	  294,    0,  295,    0,  296,  296,    0,  297,  297,    0,  298,  298,
 735	    0,  299,  299,    0,  300,  300,    0,  301,  301,    0,  302,  302,
 736	    0,  303,  303,    0,  304,  304,    0,  305,  305,    0,  306,  306,
 737	    0,  307,  307,    0,    1,   47,  105,  108,  118,  121,  124,  171,
 738	  189,  200,  228,  245,  250,  269,  283,  287,    1,   47,  105,  108,
 739	  118,  121,  124,  171,  189,  200,  228,  245,  250,  269,  283,  287,
 740	    0,    6,  307,  307,  307,  307,  307,  307,  307,  307,  307,  307,
 741	  307,  307,  307,  307,  307,  307,  307,  307,  307,  307,  307,  307,
 742	  307,  307,  307,  307,  307,  307,    0
 743	};
 744}
 745
 746private static final short _http_keywords_trans_targs[] = init__http_keywords_trans_targs_0();
 747
 748
 749private static byte[] init__http_keywords_trans_actions_0()
 750{
 751	return new byte [] {
 752	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 753	    0,    0,    0,    0,    0,    0,    5,    5,    0,    0,    0,    0,
 754	    0,    0,    0,    0,    0,  101,    0,    0,  101,    0,    0,  101,
 755	    0,    0,  101,    0,    0,  101,    0,    0,  101,    7,    7,  101,
 756	    0,    0,  101,    0,    0,  101,    0,    0,  101,    0,    0,  101,
 757	    0,    0,  101,    0,    0,  101,    9,    9,  101,    0,    0,  101,
 758	    0,    0,  101,    0,    0,  101,    0,    0,  101,    0,    0,  101,
 759	    0,    0,  101,   11,   11,  101,    0,    0,  101,    0,    0,  101,
 760	    0,    0,  101,    0,    0,  101,   13,   13,  101,   15,   15,    0,
 761	    0,    0,    0,    0,    0,    0,   17,   17,    0,    0,    0,    0,
 762	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 763	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 764	    0,    0,    0,   19,   19,    0,    0,    0,    0,    0,    0,    0,
 765	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 766	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 767	    0,    0,    0,    0,   21,   21,    0,    0,    0,    0,    0,    0,
 768	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 769	    0,    0,    0,    0,    0,    0,   23,   23,    0,    0,    0,    0,
 770	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 771	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 772	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 773	    0,   25,   25,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 774	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 775	    0,    0,   27,   27,    0,    0,    0,    0,    0,    0,    0,    0,
 776	    0,    0,   29,   29,    0,    0,    0,    0,    0,    0,    0,    0,
 777	    0,    0,    0,    0,    0,    0,    0,    0,   31,   31,    0,    0,
 778	    0,    0,   33,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 779	    0,   35,   35,    0,    0,    0,    0,    0,    0,    0,   37,   37,
 780	    0,    0,    0,    0,    0,    0,    0,   39,   39,    0,    0,    0,
 781	    0,    0,    0,    0,    0,    0,   41,   41,    0,    0,    0,    0,
 782	    0,    0,    0,    0,    0,    0,    0,    0,   43,   43,    0,    0,
 783	    0,    0,    0,    0,    0,   45,   45,    0,    0,    0,    0,    0,
 784	    0,    0,   47,   47,    0,    0,    0,    0,    0,    0,    0,   49,
 785	   49,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 786	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 787	    0,    0,    0,   51,   51,    0,    0,    0,    0,    0,    0,    0,
 788	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 789	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 790	    0,    0,   53,   53,    0,    0,    0,    0,    0,    0,    0,    0,
 791	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 792	    0,    0,    0,    0,   55,   55,    0,    0,    0,    0,    0,    0,
 793	    0,    0,    0,    0,   57,   57,    0,    0,    0,    0,    0,    0,
 794	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 795	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 796	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 797	   59,   59,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 798	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 799	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 800	    0,   61,   61,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 801	    0,    0,    0,    0,    0,    0,    0,   63,   63,    0,    0,    0,
 802	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 803	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 804	    0,    0,    0,   65,   65,    0,    0,    0,    0,    0,    0,    0,
 805	    0,    0,    0,    0,    0,    0,    0,    0,   67,   67,    0,    0,
 806	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 807	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 808	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 809	    0,    0,    0,    0,    0,    0,   69,   69,    0,    0,    0,    0,
 810	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 811	    0,    0,    0,    0,    0,    0,   71,   71,    0,    0,    0,    0,
 812	    0,    0,    0,    0,    0,    0,    0,    0,   73,   73,    0,    0,
 813	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 814	    0,   75,   75,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 815	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 816	   77,   77,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 817	    0,    0,    0,   79,   79,    0,   81,    0,   81,    0,    0,    0,
 818	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 819	    0,   83,   83,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 820	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 821	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 822	    0,    0,    0,   85,   85,    0,    0,    0,    0,    0,    0,    0,
 823	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,   87,
 824	   87,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 825	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,   89,   89,
 826	    0,    0,    0,    0,    0,    0,    0,    0,    0,   91,   91,    0,
 827	   93,   93,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 828	    0,    0,    0,    0,    0,    0,    0,    0,   95,   95,    0,    0,
 829	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 830	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 831	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 832	    0,   97,   97,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 833	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 834	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 835	    0,    0,   99,  101,  101,  101,  101,  101,  101,  101,  101,  101,
 836	  101,  101,  101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
 837	  101,  101,  101,  101,  101,   99,    0
 838	};
 839}
 840
 841private static final byte _http_keywords_trans_actions[] = init__http_keywords_trans_actions_0();
 842
 843
 844private static byte[] init__http_keywords_to_state_actions_0()
 845{
 846	return new byte [] {
 847	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 848	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 849	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 850	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 851	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 852	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 853	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 854	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 855	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 856	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 857	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 858	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 859	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 860	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 861	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 862	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 863	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 864	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 865	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 866	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 867	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 868	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 869	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 870	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 871	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 872	    0,    0,    0,    0,    0,    0,    0,    1,    0
 873	};
 874}
 875
 876private static final byte _http_keywords_to_state_actions[] = init__http_keywords_to_state_actions_0();
 877
 878
 879private static byte[] init__http_keywords_from_state_actions_0()
 880{
 881	return new byte [] {
 882	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 883	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 884	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 885	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 886	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 887	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 888	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 889	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 890	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 891	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 892	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 893	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 894	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 895	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 896	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 897	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 898	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 899	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 900	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 901	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 902	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 903	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 904	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 905	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 906	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 907	    0,    0,    0,    0,    0,    0,    0,    3,    0
 908	};
 909}
 910
 911private static final byte _http_keywords_from_state_actions[] = init__http_keywords_from_state_actions_0();
 912
 913
 914private static short[] init__http_keywords_eof_trans_0()
 915{
 916	return new short [] {
 917	    0,    0,    0,    0,    0,    0, 1025, 1025, 1025, 1025, 1025, 1025,
 918	 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025,
 919	 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025,    0,    0,    0,    0,
 920	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 921	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 922	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 923	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 924	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 925	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 926	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 927	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 928	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 929	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 930	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 931	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 932	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 933	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 934	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 935	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 936	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 937	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 938	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 939	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 940	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 941	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 942	    0,    0,    0,    0,    0,    0,    0,    0, 1026
 943	};
 944}
 945
 946private static final short _http_keywords_eof_trans[] = init__http_keywords_eof_trans_0();
 947
 948
 949static final int http_keywords_start = 307;
 950static final int http_keywords_first_final = 307;
 951static final int http_keywords_error = 0;
 952
 953static final int http_keywords_en_main = 307;
 954
 955
 956// line 226 "HttpRequestParser.rl"
 957
 958
 959  @SuppressWarnings("unused")
 960  public static String kw_lookup(byte[] data, int start, int len) {
 961//    String req = null;
 962    int ts, te, act;
 963
 964//    int wb = 0;
 965    int p = start;
 966    int pe = start + len;
 967    int eof = pe;
 968    int cs;
 969    String kw = null;
 970    
 971// line 972 "HttpRequestParser.java"
 972	{
 973	cs = http_keywords_start;
 974	ts = -1;
 975	te = -1;
 976	act = 0;
 977	}
 978
 979// line 240 "HttpRequestParser.rl"
 980    
 981// line 982 "HttpRequestParser.java"
 982	{
 983	int _klen;
 984	int _trans = 0;
 985	int _acts;
 986	int _nacts;
 987	int _keys;
 988	int _goto_targ = 0;
 989
 990	_goto: while (true) {
 991	switch ( _goto_targ ) {
 992	case 0:
 993	if ( p == pe ) {
 994		_goto_targ = 4;
 995		continue _goto;
 996	}
 997	if ( cs == 0 ) {
 998		_goto_targ = 5;
 999		continue _goto;
1000	}
1001case 1:
1002	_acts = _http_keywords_from_state_actions[cs];
1003	_nacts = (int) _http_keywords_actions[_acts++];
1004	while ( _nacts-- > 0 ) {
1005		switch ( _http_keywords_actions[_acts++] ) {
1006	case 1:
1007// line 1 "HttpRequestParser.rl"
1008	{ts = p;}
1009	break;
1010// line 1011 "HttpRequestParser.java"
1011		}
1012	}
1013
1014	_match: do {
1015	_keys = _http_keywords_key_offsets[cs];
1016	_trans = _http_keywords_index_offsets[cs];
1017	_klen = _http_keywords_single_lengths[cs];
1018	if ( _klen > 0 ) {
1019		int _lower = _keys;
1020		int _mid;
1021		int _upper = _keys + _klen - 1;
1022		while (true) {
1023			if ( _upper < _lower )
1024				break;
1025
1026			_mid = _lower + ((_upper-_lower) >> 1);
1027			if ( data[p] < _http_keywords_trans_keys[_mid] )
1028				_upper = _mid - 1;
1029			else if ( data[p] > _http_keywords_trans_keys[_mid] )
1030				_lower = _mid + 1;
1031			else {
1032				_trans += (_mid - _keys);
1033				break _match;
1034			}
1035		}
1036		_keys += _klen;
1037		_trans += _klen;
1038	}
1039
1040	_klen = _http_keywords_range_lengths[cs];
1041	if ( _klen > 0 ) {
1042		int _lower = _keys;
1043		int _mid;
1044		int _upper = _keys + (_klen<<1) - 2;
1045		while (true) {
1046			if ( _upper < _lower )
1047				break;
1048
1049			_mid = _lower + (((_upper-_lower) >> 1) & ~1);
1050			if ( data[p] < _http_keywords_trans_keys[_mid] )
1051				_upper = _mid - 2;
1052			else if ( data[p] > _http_keywords_trans_keys[_mid+1] )
1053				_lower = _mid + 2;
1054			else {
1055				_trans += ((_mid - _keys)>>1);
1056				break _match;
1057			}
1058		}
1059		_trans += _klen;
1060	}
1061	} while (false);
1062
1063case 3:
1064	cs = _http_keywords_trans_targs[_trans];
1065
1066	if ( _http_keywords_trans_actions[_trans] != 0 ) {
1067		_acts = _http_keywords_trans_actions[_trans];
1068		_nacts = (int) _http_keywords_actions[_acts++];
1069		while ( _nacts-- > 0 )
1070	{
1071			switch ( _http_keywords_actions[_acts++] )
1072			{
1073	case 2:
1074// line 1 "HttpRequestParser.rl"
1075	{te = p+1;}
1076	break;
1077	case 3:
1078// line 177 "HttpRequestParser.rl"
1079	{te = p+1;{ kw = "Accept-Charset";}}
1080	break;
1081	case 4:
1082// line 178 "HttpRequestParser.rl"
1083	{te = p+1;{ kw = "Accept-Encoding";}}
1084	break;
1085	case 5:
1086// line 179 "HttpRequestParser.rl"
1087	{te = p+1;{ kw = "Accept-Language";}}
1088	break;
1089	case 6:
1090// line 180 "HttpRequestParser.rl"
1091	{te = p+1;{ kw = "Accept-Ranges";}}
1092	break;
1093	case 7:
1094// line 181 "HttpRequestParser.rl"
1095	{te = p+1;{ kw = "Age";}}
1096	break;
1097	case 8:
1098// line 182 "HttpRequestParser.rl"
1099	{te = p+1;{ kw = "Allow";}}
1100	break;
1101	case 9:
1102// line 183 "HttpRequestParser.rl"
1103	{te = p+1;{ kw = "Authorization";}}
1104	break;
1105	case 10:
1106// line 184 "HttpRequestParser.rl"
1107	{te = p+1;{ kw = "Cache-Control";}}
1108	break;
1109	case 11:
1110// line 185 "HttpRequestParser.rl"
1111	{te = p+1;{ kw = "Connection";}}
1112	break;
1113	case 12:
1114// line 186 "HttpRequestParser.rl"
1115	{te = p+1;{ kw = "Content-Encoding";}}
1116	break;
1117	case 13:
1118// line 187 "HttpRequestParser.rl"
1119	{te = p+1;{ kw = "Content-Language";}}
1120	break;
1121	case 14:
1122// line 188 "HttpRequestParser.rl"
1123	{te = p+1;{ kw = "Content-Length";}}
1124	break;
1125	case 15:
1126// line 189 "HttpRequestParser.rl"
1127	{te = p+1;{ kw = "Content-Location";}}
1128	break;
1129	case 16:
1130// line 190 "HttpRequestParser.rl"
1131	{te = p+1;{ kw = "Content-MD5";}}
1132	break;
1133	case 17:
1134// line 191 "HttpRequestParser.rl"
1135	{te = p+1;{ kw = "Content-Range";}}
1136	break;
1137	case 18:
1138// line 192 "HttpRequestParser.rl"
1139	{te = p+1;{ kw = "Content-Type";}}
1140	break;
1141	case 19:
1142// line 193 "HttpRequestParser.rl"
1143	{te = p+1;{ kw = "Date";}}
1144	break;
1145	case 20:
1146// line 194 "HttpRequestParser.rl"
1147	{te = p+1;{ kw = "ETag";}}
1148	break;
1149	case 21:
1150// line 195 "HttpRequestParser.rl"
1151	{te = p+1;{ kw = "Expect";}}
1152	break;
1153	case 22:
1154// line 196 "HttpRequestParser.rl"
1155	{te = p+1;{ kw = "Expires";}}
1156	break;
1157	case 23:
1158// line 197 "HttpRequestParser.rl"
1159	{te = p+1;{ kw = "From";}}
1160	break;
1161	case 24:
1162// line 198 "HttpRequestParser.rl"
1163	{te = p+1;{ kw = "Host";}}
1164	break;
1165	case 25:
1166// line 199 "HttpRequestParser.rl"
1167	{te = p+1;{ kw = "If-Match";}}
1168	break;
1169	case 26:
1170// line 200 "HttpRequestParser.rl"
1171	{te = p+1;{ kw = "If-Modified-Since";}}
1172	break;
1173	case 27:
1174// line 201 "HttpRequestParser.rl"
1175	{te = p+1;{ kw = "If-None-Match";}}
1176	break;
1177	case 28:
1178// line 202 "HttpRequestParser.rl"
1179	{te = p+1;{ kw = "If-Range";}}
1180	break;
1181	case 29:
1182// line 203 "HttpRequestParser.rl"
1183	{te = p+1;{ kw = "If-Unmodified-Since";}}
1184	break;
1185	case 30:
1186// line 204 "HttpRequestParser.rl"
1187	{te = p+1;{ kw = "Last-Modified";}}
1188	break;
1189	case 31:
1190// line 205 "HttpRequestParser.rl"
1191	{te = p+1;{ kw = "Location";}}
1192	break;
1193	case 32:
1194// line 206 "HttpRequestParser.rl"
1195	{te = p+1;{ kw = "Max-Forwards";}}
1196	break;
1197	case 33:
1198// line 207 "HttpRequestParser.rl"
1199	{te = p+1;{ kw = "Pragma";}}
1200	break;
1201	case 34:
1202// line 208 "HttpRequestParser.rl"
1203	{te = p+1;{ kw = "Proxy-Authenticate";}}
1204	break;
1205	case 35:
1206// line 209 "HttpRequestParser.rl"
1207	{te = p+1;{ kw = "Proxy-Authorization";}}
1208	break;
1209	case 36:
1210// line 210 "HttpRequestParser.rl"
1211	{te = p+1;{ kw = "Range";}}
1212	break;
1213	case 37:
1214// line 211 "HttpRequestParser.rl"
1215	{te = p+1;{ kw = "Referer";}}
1216	break;
1217	case 38:
1218// line 212 "HttpRequestParser.rl"
1219	{te = p+1;{ kw = "Retry-After";}}
1220	break;
1221	case 39:
1222// line 213 "HttpRequestParser.rl"
1223	{te = p+1;{ kw = "Server";}}
1224	break;
1225	case 40:
1226// line 214 "HttpRequestParser.rl"
1227	{te = p+1;{ kw = "TE";}}
1228	break;
1229	case 41:
1230// line 215 "HttpRequestParser.rl"
1231	{te = p+1;{ kw = "Trailer";}}
1232	break;
1233	case 42:
1234// line 216 "HttpRequestParser.rl"
1235	{te = p+1;{ kw = "Transfer-Encoding";}}
1236	break;
1237	case 43:
1238// line 217 "HttpRequestParser.rl"
1239	{te = p+1;{ kw = "Upgrade";}}
1240	break;
1241	case 44:
1242// line 218 "HttpRequestParser.rl"
1243	{te = p+1;{ kw = "User-Agent";}}
1244	break;
1245	case 45:
1246// line 219 "HttpRequestParser.rl"
1247	{te = p+1;{ kw = "Vary";}}
1248	break;
1249	case 46:
1250// line 220 "HttpRequestParser.rl"
1251	{te = p+1;{ kw = "Via";}}
1252	break;
1253	case 47:
1254// line 221 "HttpRequestParser.rl"
1255	{te = p+1;{ kw = "Warning";}}
1256	break;
1257	case 48:
1258// line 222 "HttpRequestParser.rl"
1259	{te = p+1;{ kw = "WWW-Authenticate";}}
1260	break;
1261	case 49:
1262// line 176 "HttpRequestParser.rl"
1263	{te = p;p--;{ kw = "Accept";}}
1264	break;
1265	case 50:
1266// line 176 "HttpRequestParser.rl"
1267	{{p = ((te))-1;}{ kw = "Accept";}}
1268	break;
1269// line 1270 "HttpRequestParser.java"
1270			}
1271		}
1272	}
1273
1274case 2:
1275	_acts = _http_keywords_to_state_actions[cs];
1276	_nacts = (int) _http_keywords_actions[_acts++];
1277	while ( _nacts-- > 0 ) {
1278		switch ( _http_keywords_actions[_acts++] ) {
1279	case 0:
1280// line 1 "HttpRequestParser.rl"
1281	{ts = -1;}
1282	break;
1283// line 1284 "HttpRequestParser.java"
1284		}
1285	}
1286
1287	if ( cs == 0 ) {
1288		_goto_targ = 5;
1289		continue _goto;
1290	}
1291	if ( ++p != pe ) {
1292		_goto_targ = 1;
1293		continue _goto;
1294	}
1295case 4:
1296	if ( p == eof )
1297	{
1298	if ( _http_keywords_eof_trans[cs] > 0 ) {
1299		_trans = _http_keywords_eof_trans[cs] - 1;
1300		_goto_targ = 3;
1301		continue _goto;
1302	}
1303	}
1304
1305case 5:
1306	}
1307	break; }
1308	}
1309
1310// line 241 "HttpRequestParser.rl"
1311
1312    return kw;
1313  }
1314
1315  
1316// line 1317 "HttpRequestParser.java"
1317private static byte[] init__http_date_actions_0()
1318{
1319	return new byte [] {
1320	    0,    1,    0,    1,    1,    1,    2,    1,    3,    1,    4,    1,
1321	    5,    1,    6,    1,    7,    1,    8,    1,    9,    1,   10,    1,
1322	   11,    1,   12,    1,   13,    1,   14,    1,   15,    1,   16
1323	};
1324}
1325
1326private static final byte _http_date_actions[] = init__http_date_actions_0();
1327
1328
1329private static short[] init__http_date_key_offsets_0()
1330{
1331	return new short [] {
1332	    0,    0,    5,    6,    7,    9,   18,   20,   21,   22,   25,   28,
1333	   31,   34,   36,   39,   41,   44,   47,   48,   49,   50,   51,   52,
1334	   54,   55,   57,   58,   60,   61,   62,   63,   64,   65,   66,   67,
1335	   70,   74,   83,   85,   86,   87,   90,   93,   96,   99,  101,  104,
1336	  106,  109,  111,  112,  113,  114,  115,  116,  117,  118,  120,  121,
1337	  123,  124,  126,  127,  128,  129,  130,  131,  132,  140,  142,  143,
1338	  144,  146,  147,  148,  149,  150,  151,  153,  154,  156,  157,  159,
1339	  160,  161,  162,  163,  164,  165,  166,  167,  169,  170,  172,  173,
1340	  174,  175,  176,  178
1341	};
1342}
1343
1344private static final short _http_date_key_offsets[] = init__http_date_key_offsets_0();
1345
1346
1347private static char[] init__http_date_trans_keys_0()
1348{
1349	return new char [] {
1350	   70,   77,   83,   84,   87,  114,  105,   32,   44,   32,   65,   68,
1351	   70,   74,   77,   78,   79,   83,  112,  117,  114,   32,   32,   48,
1352	   57,   32,   48,   57,   32,   48,   57,   58,   48,   57,   48,   57,
1353	   58,   48,   57,   48,   57,   32,   48,   57,   32,   48,   57,  103,
1354	  101,   99,  101,   98,   97,  117,  110,  108,  110,   97,  114,  121,
1355	  111,  118,   99,  116,  101,  112,   32,   32,   48,   57,   32,   45,
1356	   48,   57,   32,   65,   68,   70,   74,   77,   78,   79,   83,  112,
1357	  117,  114,   32,   32,   48,   57,   32,   48,   57,   32,   48,   57,
1358	   58,   48,   57,   48,   57,   58,   48,   57,   48,   57,   32,   48,
1359	   57,   32,   71,   77,   84,  103,  101,   99,  101,   98,   97,  117,
1360	  110,  108,  110,   97,  114,  121,  111,  118,   99,  116,  101,  112,
1361	   65,   68,   70,   74,   77,   78,   79,   83,  112,  117,  114,   45,
1362	   48,   57,  103,  101,   99,  101,   98,   97,  117,  110,  108,  110,
1363	   97,  114,  121,  111,  118,   99,  116,  101,  112,  111,  110,   97,
1364	  117,  116,  104,  117,  117,  101,  101,  100,   48,   57,    0
1365	};
1366}
1367
1368private static final char _http_date_trans_keys[] = init__http_date_trans_keys_0();
1369
1370
1371private static byte[] init__http_date_single_lengths_0()
1372{
1373	return new byte [] {
1374	    0,    5,    1,    1,    2,    9,    2,    1,    1,    1,    1,    1,
1375	    1,    0,    1,    0,    1,    1,    1,    1,    1,    1,    1,    2,
1376	    1,    2,    1,    2,    1,    1,    1,    1,    1,    1,    1,    1,
1377	    2,    9,    2,    1,    1,    1,    1,    1,    1,    0,    1,    0,
1378	    1,    2,    1,    1,    1,    1,    1,    1,    1,    2,    1,    2,
1379	    1,    2,    1,    1,    1,    1,    1,    1,    8,    2,    1,    1,
1380	    0,    1,    1,    1,    1,    1,    2,    1,    2,    1,    2,    1,
1381	    1,    1,    1,    1,    1,    1,    1,    2,    1,    2,    1,    1,
1382	    1,    1,    0,    0
1383	};
1384}
1385
1386private static final byte _http_date_single_lengths[] = init__http_date_single_lengths_0();
1387
1388
1389private static byte[] init__http_date_range_lengths_0()
1390{
1391	return new byte [] {
1392	    0,    0,    0,    0,    0,    0,    0,    0,    0,    1,    1,    1,
1393	    1,    1,    1,    1,    1,    1,    0,    0,    0,    0,    0,    0,
1394	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    1,
1395	    1,    0,    0,    0,    0,    1,    1,    1,    1,    1,    1,    1,
1396	    1,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1397	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1398	    1,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1399	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1400	    0,    0,    1,    0
1401	};
1402}
1403
1404private static final byte _http_date_range_lengths[] = init__http_date_range_lengths_0();
1405
1406
1407private static short[] init__http_date_index_offsets_0()
1408{
1409	return new short [] {
1410	    0,    0,    6,    8,   10,   13,   23,   26,   28,   30,   33,   36,
1411	   39,   42,   44,   47,   49,   52,   55,   57,   59,   61,   63,   65,
1412	   68,   70,   73,   75,   78,   80,   82,   84,   86,   88,   90,   92,
1413	   95,   99,  109,  112,  114,  116,  119,  122,  125,  128,  130,  133,
1414	  135,  138,  141,  143,  145,  147,  149,  151,  153,  155,  158,  160,
1415	  163,  165,  168,  170,  172,  174,  176,  178,  180,  189,  192,  194,
1416	  196,  198,  200,  202,  204,  206,  208,  211,  213,  216,  218,  221,
1417	  223,  225,  227,  229,  231,  233,  235,  237,  240,  242,  245,  247,
1418	  249,  251,  253,  255
1419	};
1420}
1421
1422private static final short _http_date_index_offsets[] = init__http_date_index_offsets_0();
1423
1424
1425private static byte[] init__http_date_trans_targs_0()
1426{
1427	return new byte [] {
1428	    2,   89,   91,   93,   96,    0,    3,    0,    4,    0,    5,   34,
1429	    0,    5,    6,   19,   21,   23,   26,   28,   30,   32,    0,    7,
1430	   18,    0,    8,    0,    9,    0,    9,   10,    0,   11,   10,    0,
1431	   11,   12,    0,   13,   12,    0,   14,    0,   15,   14,    0,   16,
1432	    0,   17,   16,    0,   17,   98,    0,    8,    0,   20,    0,    8,
1433	    0,   22,    0,    8,    0,   24,   25,    0,    8,    0,    8,    8,
1434	    0,   27,    0,    8,    8,    0,   29,    0,    8,    0,   31,    0,
1435	    8,    0,   33,    0,    8,    0,   35,    0,   35,   36,    0,   37,
1436	   68,   36,    0,   37,   38,   53,   55,   57,   60,   62,   64,   66,
1437	    0,   39,   52,    0,   40,    0,   41,    0,   41,   42,    0,   43,
1438	   42,    0,   43,   44,    0,   45,   44,    0,   46,    0,   47,   46,
1439	    0,   48,    0,   49,   48,    0,   49,   50,    0,   51,    0,   99,
1440	    0,   40,    0,   54,    0,   40,    0,   56,    0,   40,    0,   58,
1441	   59,    0,   40,    0,   40,   40,    0,   61,    0,   40,   40,    0,
1442	   63,    0,   40,    0,   65,    0,   40,    0,   67,    0,   40,    0,
1443	   69,   74,   76,   78,   81,   83,   85,   87,    0,   70,   73,    0,
1444	   71,    0,   72,    0,   42,    0,   71,    0,   75,    0,   71,    0,
1445	   77,    0,   71,    0,   79,   80,    0,   71,    0,   71,   71,    0,
1446	   82,    0,   71,   71,    0,   84,    0,   71,    0,   86,    0,   71,
1447	    0,   88,    0,   71,    0,   90,    0,    4,    0,   92,   90,    0,
1448	    4,    0,   94,   95,    0,    4,    0,    4,    0,   97,    0,    4,
1449	    0,   98,    0,    0,    0
1450	};
1451}
1452
1453private static final byte _http_date_trans_targs[] = init__http_date_trans_targs_0();
1454
1455
1456private static byte[] init__http_date_trans_actions_0()
1457{
1458	return new byte [] {
1459	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1460	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1461	    0,    0,   17,    0,    0,    0,    0,    1,    0,    0,    1,    0,
1462	    0,    5,    0,    0,    5,    0,    7,    0,    0,    7,    0,    9,
1463	    0,    0,    9,    0,    0,    3,    0,   25,    0,    0,    0,   33,
1464	    0,    0,    0,   13,    0,    0,    0,    0,   11,    0,   23,   21,
1465	    0,    0,    0,   15,   19,    0,    0,    0,   31,    0,    0,    0,
1466	   29,    0,    0,    0,   27,    0,    0,    0,    0,    1,    0,    0,
1467	    0,    1,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1468	    0,    0,    0,    0,   17,    0,    0,    0,    0,    3,    0,    0,
1469	    3,    0,    0,    5,    0,    0,    5,    0,    7,    0,    0,    7,
1470	    0,    9,    0,    0,    9,    0,    0,    0,    0,    0,    0,    0,
1471	    0,   25,    0,    0,    0,   33,    0,    0,    0,   13,    0,    0,
1472	    0,    0,   11,    0,   23,   21,    0,    0,    0,   15,   19,    0,
1473	    0,    0,   31,    0,    0,    0,   29,    0,    0,    0,   27,    0,
1474	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1475	   17,    0,    0,    0,    3,    0,   25,    0,    0,    0,   33,    0,
1476	    0,    0,   13,    0,    0,    0,    0,   11,    0,   23,   21,    0,
1477	    0,    0,   15,   19,    0,    0,    0,   31,    0,    0,    0,   29,
1478	    0,    0,    0,   27,    0,    0,    0,    0,    0,    0,    0,    0,
1479	    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1480	    0,    3,    0,    0,    0
1481	};
1482}
1483
1484private static final byte _http_date_trans_actions[] = init__http_date_trans_actions_0();
1485
1486
1487static final int http_date_start = 1;
1488static final int http_date_first_final = 98;
1489static final int http_date_error = 0;
1490
1491static final int http_date_en_main = 1;
1492
1493
1494// line 285 "HttpRequestParser.rl"
1495
1496
1497    public static TimeZone GMT = TimeZone.getTimeZone("GMT");
1498
1499  public static long parseDate(byte[] data, int pos, int len) {
1500    int p = 0;
1501    int pe = len;
1502//    int eof = pe;
1503    int cs;
1504//    int wkday = 0;
1505    int day = 0, month = 0, year = 0;
1506    int hh = 0, mm = 0, ss = 0;
1507        
1508    
1509// line 1510 "HttpRequestParser.java"
1510	{
1511	cs = http_date_start;
1512	}
1513
1514// line 299 "HttpRequestParser.rl"
1515    
1516// line 1517 "HttpRequestParser.java"
1517	{
1518	int _klen;
1519	int _trans = 0;
1520	int _acts;
1521	int _nacts;
1522	int _keys;
1523	int _goto_targ = 0;
1524
1525	_goto: while (true) {
1526	switch ( _goto_targ ) {
1527	case 0:
1528	if ( p == pe ) {
1529		_goto_targ = 4;
1530		continue _goto;
1531	}
1532	if ( cs == 0 ) {
1533		_goto_targ = 5;
1534		continue _goto;
1535	}
1536case 1:
1537	_match: do {
1538	_keys = _http_date_key_offsets[cs];
1539	_trans = _http_date_index_offsets[cs];
1540	_klen = _http_date_single_lengths[cs];
1541	if ( _klen > 0 ) {
1542		int _lower = _keys;
1543		int _mid;
1544		int _upper = _keys + _klen - 1;
1545		while (true) {
1546			if ( _upper < _lower )
1547				break;
1548
1549			_mid = _lower + ((_upper-_lower) >> 1);
1550			if ( data[p] < _http_date_trans_keys[_mid] )
1551				_upper = _mid - 1;
1552			else if ( data[p] > _http_date_trans_keys[_mid] )
1553				_lower = _mid + 1;
1554			else {
1555				_trans += (_mid - _keys);
1556				break _match;
1557			}
1558		}
1559		_keys += _klen;
1560		_trans += _klen;
1561	}
1562
1563	_klen = _http_date_range_lengths[cs];
1564	if ( _klen > 0 ) {
1565		int _lower = _keys;
1566		int _mid;
1567		int _upper = _keys + (_klen<<1) - 2;
1568		while (true) {
1569			if ( _upper < _lower )
1570				break;
1571
1572			_mid = _lower + (((_upper-_lower) >> 1) & ~1);
1573			if ( data[p] < _http_date_trans_keys[_mid] )
1574				_upper = _mid - 2;
1575			else if ( data[p] > _http_date_trans_keys[_mid+1] )
1576				_lower = _mid + 2;
1577			else {
1578				_trans += ((_mid - _keys)>>1);
1579				break _match;
1580			}
1581		}
1582		_trans += _klen;
1583	}
1584	} while (false);
1585
1586	cs = _http_date_trans_targs[_trans];
1587
1588	if ( _http_date_trans_actions[_trans] != 0 ) {
1589		_acts = _http_date_trans_actions[_trans];
1590		_nacts = (int) _http_date_actions[_acts++];
1591		while ( _nacts-- > 0 )
1592	{
1593			switch ( _http_date_actions[_acts++] )
1594			{
1595	case 0:
1596// line 254 "HttpRequestParser.rl"
1597	{day = day * 10 + (data[p] - 48);}
1598	break;
1599	case 1:
1600// line 255 "HttpRequestParser.rl"
1601	{year = year * 10 + (data[p] - 48);}
1602	break;
1603	case 2:
1604// line 256 "HttpRequestParser.rl"
1605	{hh = hh * 10 + (data[p] - 48) ;}
1606	break;
1607	case 3:
1608// line 257 "HttpRequestParser.rl"
1609	{mm = mm * 10 + (data[p] - 48) ;}
1610	break;
1611	case 4:
1612// line 258 "HttpRequestParser.rl"
1613	{ss = ss * 10 + (data[p] - 48) ;}
1614	break;
1615	case 5:
1616// line 262 "HttpRequestParser.rl"
1617	{ month = 0;}
1618	break;
1619	case 6:
1620// line 263 "HttpRequestParser.rl"
1621	{ month = 1;}
1622	break;
1623	case 7:
1624// line 264 "HttpRequestParser.rl"
1625	{ month = 2;}
1626	break;
1627	case 8:
1628// line 265 "HttpRequestParser.rl"
1629	{ month = 3;}
1630	break;
1631	case 9:
1632// line 266 "HttpRequestParser.rl"
1633	{ month = 4;}
1634	break;
1635	case 10:
1636// line 267 "HttpRequestParser.rl"
1637	{ month = 5;}
1638	break;
1639	case 11:
1640// line 268 "HttpRequestParser.rl"
1641	{ month = 6;}
1642	break;
1643	case 12:
1644// line 269 "HttpRequestParser.rl"
1645	{ month = 7;}
1646	break;
1647	case 13:
1648// line 270 "HttpRequestParser.rl"
1649	{ month = 8;}
1650	break;
1651	case 14:
1652// line 271 "HttpRequestParser.rl"
1653	{ month = 90;}
1654	break;
1655	case 15:
1656// line 272 "HttpRequestParser.rl"
1657	{ month = 10;}
1658	break;
1659	case 16:
1660// line 273 "HttpRequestParser.rl"
1661	{ month = 11;}
1662	break;
1663// line 1664 "HttpRequestParser.java"
1664			}
1665		}
1666	}
1667
1668case 2:
1669	if ( cs == 0 ) {
1670		_goto_targ = 5;
1671		continue _goto;
1672	}
1673	if ( ++p != pe ) {
1674		_goto_targ = 1;
1675		continue _goto;
1676	}
1677case 4:
1678case 5:
1679	}
1680	break; }
1681	}
1682
1683// line 300 "HttpRequestParser.rl"
1684
1685    if (year < 100) {year += 1900;}
1686
1687    GregorianCalendar gc = new GregorianCalendar();
1688    gc.set(year, month, day, hh, mm, ss);
1689    gc.setTimeZone(GMT);
1690    return gc.getTimeInMillis();
1691  }
1692
1693
1694  public static String crlf = "\r\n";
1695  public static void main(String args[]) throws Exception {
1696    /// Testing
1697    String s = 
1698      "GET /favicon.ico#test HTTP/1.1\r\n" +
1699      "Host: localhost:7262\r\n" +
1700      "User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.10) Gecko/2009042315 Firefox/3.0.10 Ubiquity/0.1.5\r\n" +
1701      "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" +
1702      "Accept-Language: en-us,en;q=0.5\r\n" +
1703      "Accept-Encoding: gzip,deflate\r\n" +
1704      "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n" +
1705      "Keep-Alive: 300\r\n" +
1706      "Connection: keep-alive\r\n\r\n";
1707    System.out.println("Input Request: (" + s.length() + " bytes)");System.out.println(s);
1708    byte[] data = s.getBytes();
1709    int len = data.length;
1710    
1711    System.out.println("=============================================================");
1712    HttpRequest req = new HttpRequest();
1713    req.buffer = ByteBuffer.allocate(2048);
1714    req.buffer.put(data);
1715    initHeader(req, len);
1716    System.out.println(req);
1717  }
1718}
1719