parser.c
changeset 12 191b3c25974a
parent 11 9aa5114326e8
child 13 23a242d7b7fa
equal deleted inserted replaced
11:9aa5114326e8 12:191b3c25974a
     1 
       
     2 #line 1 "parser.rl"
       
     3 /* vim: set noet nosta sw=4 ts=4 ft=ragel : */
       
     4 /*
       
     5 Copyright (c) 2011, Mahlon E. Smith <mahlon@martini.nu>
       
     6 All rights reserved.
       
     7 Redistribution and use in source and binary forms, with or without
       
     8 modification, are permitted provided that the following conditions are met:
       
     9 
       
    10     * Redistributions of source code must retain the above copyright
       
    11       notice, this list of conditions and the following disclaimer.
       
    12 
       
    13     * Redistributions in binary form must reproduce the above copyright
       
    14       notice, this list of conditions and the following disclaimer in the
       
    15       documentation and/or other materials provided with the distribution.
       
    16 
       
    17     * Neither the name of Mahlon E. Smith nor the names of his
       
    18       contributors may be used to endorse or promote products derived
       
    19       from this software without specific prior written permission.
       
    20 
       
    21 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
       
    22 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
    23 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
       
    24 DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
       
    25 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
       
    26 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
       
    27 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
       
    28 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
       
    29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
       
    30 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
    31 */
       
    32 
       
    33 #include "volta.h"
       
    34 
       
    35 
       
    36 #line 141 "parser.rl"
       
    37 
       
    38 
       
    39 #line 40 "parser.c"
       
    40 static const int redirector_start = 1;
       
    41 static const int redirector_first_final = 85;
       
    42 static const int redirector_error = 0;
       
    43 
       
    44 static const int redirector_en_main = 1;
       
    45 
       
    46 
       
    47 #line 143 "parser.rl"
       
    48 
       
    49 /* 
       
    50  * Tokenize an incoming line from squid, returning a parsed and populated
       
    51  * structure to make redirection decisions against.  This pointer should
       
    52  * be freed using cleanup_request() after use.
       
    53  * 
       
    54  * Squid documentation about redirectors:
       
    55  * ---------------------------------------------------------------------------
       
    56  * TAG: url_rewrite_program
       
    57  * Specify the location of the executable for the URL rewriter.
       
    58  * Since they can perform almost any function there isn't one included.
       
    59  * 
       
    60  * For each requested URL rewriter will receive on line with the format
       
    61  * 
       
    62  * URL <SP> client_ip "/" fqdn <SP> user <SP> method [<SP> kvpairs]<NL>
       
    63  * 
       
    64  * In the future, the rewriter interface will be extended with
       
    65  * key=value pairs ("kvpairs" shown above).  Rewriter programs
       
    66  * should be prepared to receive and possibly ignore additional
       
    67  * whitespace-separated tokens on each input line.
       
    68  * 
       
    69  * And the rewriter may return a rewritten URL. The other components of
       
    70  * the request line does not need to be returned (ignored if they are).
       
    71  * 
       
    72  * The rewriter can also indicate that a client-side redirect should
       
    73  * be performed to the new URL. This is done by prefixing the returned
       
    74  * URL with "301:" (moved permanently) or 302: (moved temporarily).
       
    75  * 
       
    76  * By default, a URL rewriter is not used.
       
    77  * ---------------------------------------------------------------------------
       
    78 */
       
    79 request *
       
    80 parse( char *line )
       
    81 {
       
    82    	/* machine required vars */
       
    83 	int  cs   = 0;
       
    84 	char *p   = line;
       
    85 	char *pe  = p + strlen(p);
       
    86 	char *eof = NULL;
       
    87 
       
    88 	/* the client request pointer */
       
    89 	unsigned char valid = 0;
       
    90 	request *p_request = init_request();
       
    91 
       
    92 	/* enter state machine */
       
    93 	
       
    94 #line 95 "parser.c"
       
    95 	{
       
    96 	cs = redirector_start;
       
    97 	}
       
    98 
       
    99 #line 189 "parser.rl"
       
   100 	
       
   101 #line 102 "parser.c"
       
   102 	{
       
   103 	if ( p == pe )
       
   104 		goto _test_eof;
       
   105 	switch ( cs )
       
   106 	{
       
   107 case 1:
       
   108 	if ( (*p) < 65 ) {
       
   109 		if ( 48 <= (*p) && (*p) <= 57 )
       
   110 			goto tr1;
       
   111 	} else if ( (*p) > 90 ) {
       
   112 		if ( 97 <= (*p) && (*p) <= 122 )
       
   113 			goto tr2;
       
   114 	} else
       
   115 		goto tr2;
       
   116 	goto tr0;
       
   117 tr0:
       
   118 #line 46 "parser.rl"
       
   119 	{ debug( 3, LOC, "Unable to parse scheme.\n" ); }
       
   120 #line 50 "parser.rl"
       
   121 	{ debug( 3, LOC, "Unable to parse hostname.\n" ); }
       
   122 #line 37 "parser.rl"
       
   123 	{ valid = 0; }
       
   124 	goto st0;
       
   125 tr3:
       
   126 #line 37 "parser.rl"
       
   127 	{ valid = 0; }
       
   128 	goto st0;
       
   129 tr11:
       
   130 #line 46 "parser.rl"
       
   131 	{ debug( 3, LOC, "Unable to parse scheme.\n" ); }
       
   132 #line 50 "parser.rl"
       
   133 	{ debug( 3, LOC, "Unable to parse hostname.\n" ); }
       
   134 #line 64 "parser.rl"
       
   135 	{ debug( 3, LOC, "Unable to parse the client IP address.\n" ); }
       
   136 #line 37 "parser.rl"
       
   137 	{ valid = 0; }
       
   138 	goto st0;
       
   139 tr14:
       
   140 #line 64 "parser.rl"
       
   141 	{ debug( 3, LOC, "Unable to parse the client IP address.\n" ); }
       
   142 #line 37 "parser.rl"
       
   143 	{ valid = 0; }
       
   144 	goto st0;
       
   145 tr35:
       
   146 #line 60 "parser.rl"
       
   147 	{ debug( 3, LOC, "Unable to parse method.\n" ); }
       
   148 #line 37 "parser.rl"
       
   149 	{ valid = 0; }
       
   150 	goto st0;
       
   151 tr49:
       
   152 #line 50 "parser.rl"
       
   153 	{ debug( 3, LOC, "Unable to parse hostname.\n" ); }
       
   154 #line 37 "parser.rl"
       
   155 	{ valid = 0; }
       
   156 	goto st0;
       
   157 tr92:
       
   158 #line 46 "parser.rl"
       
   159 	{ debug( 3, LOC, "Unable to parse scheme.\n" ); }
       
   160 #line 37 "parser.rl"
       
   161 	{ valid = 0; }
       
   162 	goto st0;
       
   163 #line 164 "parser.c"
       
   164 st0:
       
   165 cs = 0;
       
   166 	goto _out;
       
   167 tr1:
       
   168 #line 48 "parser.rl"
       
   169 	{ p_request->tokens.host_start  = p; }
       
   170 	goto st2;
       
   171 st2:
       
   172 	if ( ++p == pe )
       
   173 		goto _test_eof2;
       
   174 case 2:
       
   175 #line 176 "parser.c"
       
   176 	switch( (*p) ) {
       
   177 		case 32: goto tr4;
       
   178 		case 45: goto st32;
       
   179 		case 46: goto st34;
       
   180 		case 47: goto tr7;
       
   181 		case 58: goto tr9;
       
   182 		case 95: goto st32;
       
   183 	}
       
   184 	if ( (*p) < 48 ) {
       
   185 		if ( 9 <= (*p) && (*p) <= 13 )
       
   186 			goto tr4;
       
   187 	} else if ( (*p) > 57 ) {
       
   188 		if ( (*p) > 90 ) {
       
   189 			if ( 97 <= (*p) && (*p) <= 122 )
       
   190 				goto st33;
       
   191 		} else if ( (*p) >= 65 )
       
   192 			goto st33;
       
   193 	} else
       
   194 		goto st2;
       
   195 	goto tr3;
       
   196 tr4:
       
   197 #line 49 "parser.rl"
       
   198 	{ p_request->tokens.host_length = p - ( *pe + p_request->tokens.host_start ); }
       
   199 #line 55 "parser.rl"
       
   200 	{ p_request->tokens.path_start  = p; }
       
   201 #line 56 "parser.rl"
       
   202 	{ p_request->tokens.path_length = p - ( *pe + p_request->tokens.path_start ); }
       
   203 	goto st3;
       
   204 st3:
       
   205 	if ( ++p == pe )
       
   206 		goto _test_eof3;
       
   207 case 3:
       
   208 #line 209 "parser.c"
       
   209 	if ( (*p) < 65 ) {
       
   210 		if ( 48 <= (*p) && (*p) <= 57 )
       
   211 			goto tr12;
       
   212 	} else if ( (*p) > 90 ) {
       
   213 		if ( 97 <= (*p) && (*p) <= 122 )
       
   214 			goto tr13;
       
   215 	} else
       
   216 		goto tr13;
       
   217 	goto tr11;
       
   218 tr12:
       
   219 #line 39 "parser.rl"
       
   220 	{
       
   221 		debug( 1, LOC, "Channel ID found in redirector input.  Set 'url_rewrite_concurrency' to '0' in squid.\n" );
       
   222 		{p++; cs = 4; goto _out;}
       
   223 	}
       
   224 #line 48 "parser.rl"
       
   225 	{ p_request->tokens.host_start  = p; }
       
   226 #line 62 "parser.rl"
       
   227 	{ p_request->tokens.c_ip_start  = p; }
       
   228 	goto st4;
       
   229 st4:
       
   230 	if ( ++p == pe )
       
   231 		goto _test_eof4;
       
   232 case 4:
       
   233 #line 234 "parser.c"
       
   234 	switch( (*p) ) {
       
   235 		case 32: goto tr15;
       
   236 		case 45: goto st32;
       
   237 		case 46: goto st42;
       
   238 		case 47: goto tr7;
       
   239 		case 58: goto tr9;
       
   240 		case 95: goto st32;
       
   241 	}
       
   242 	if ( (*p) < 48 ) {
       
   243 		if ( 9 <= (*p) && (*p) <= 13 )
       
   244 			goto tr15;
       
   245 	} else if ( (*p) > 57 ) {
       
   246 		if ( (*p) > 90 ) {
       
   247 			if ( 97 <= (*p) && (*p) <= 122 )
       
   248 				goto st33;
       
   249 		} else if ( (*p) >= 65 )
       
   250 			goto st33;
       
   251 	} else
       
   252 		goto st75;
       
   253 	goto tr14;
       
   254 tr15:
       
   255 #line 49 "parser.rl"
       
   256 	{ p_request->tokens.host_length = p - ( *pe + p_request->tokens.host_start ); }
       
   257 #line 55 "parser.rl"
       
   258 	{ p_request->tokens.path_start  = p; }
       
   259 #line 56 "parser.rl"
       
   260 	{ p_request->tokens.path_length = p - ( *pe + p_request->tokens.path_start ); }
       
   261 	goto st5;
       
   262 tr51:
       
   263 #line 56 "parser.rl"
       
   264 	{ p_request->tokens.path_length = p - ( *pe + p_request->tokens.path_start ); }
       
   265 	goto st5;
       
   266 tr53:
       
   267 #line 53 "parser.rl"
       
   268 	{ p_request->tokens.port_length = p - ( *pe + p_request->tokens.port_start ); }
       
   269 #line 55 "parser.rl"
       
   270 	{ p_request->tokens.path_start  = p; }
       
   271 #line 56 "parser.rl"
       
   272 	{ p_request->tokens.path_length = p - ( *pe + p_request->tokens.path_start ); }
       
   273 	goto st5;
       
   274 st5:
       
   275 	if ( ++p == pe )
       
   276 		goto _test_eof5;
       
   277 case 5:
       
   278 #line 279 "parser.c"
       
   279 	if ( 48 <= (*p) && (*p) <= 57 )
       
   280 		goto tr18;
       
   281 	goto tr14;
       
   282 tr18:
       
   283 #line 62 "parser.rl"
       
   284 	{ p_request->tokens.c_ip_start  = p; }
       
   285 	goto st6;
       
   286 st6:
       
   287 	if ( ++p == pe )
       
   288 		goto _test_eof6;
       
   289 case 6:
       
   290 #line 291 "parser.c"
       
   291 	if ( (*p) == 46 )
       
   292 		goto st7;
       
   293 	if ( 48 <= (*p) && (*p) <= 57 )
       
   294 		goto st30;
       
   295 	goto tr14;
       
   296 st7:
       
   297 	if ( ++p == pe )
       
   298 		goto _test_eof7;
       
   299 case 7:
       
   300 	if ( 48 <= (*p) && (*p) <= 57 )
       
   301 		goto st8;
       
   302 	goto tr14;
       
   303 st8:
       
   304 	if ( ++p == pe )
       
   305 		goto _test_eof8;
       
   306 case 8:
       
   307 	if ( (*p) == 46 )
       
   308 		goto st9;
       
   309 	if ( 48 <= (*p) && (*p) <= 57 )
       
   310 		goto st28;
       
   311 	goto tr14;
       
   312 st9:
       
   313 	if ( ++p == pe )
       
   314 		goto _test_eof9;
       
   315 case 9:
       
   316 	if ( 48 <= (*p) && (*p) <= 57 )
       
   317 		goto st10;
       
   318 	goto tr14;
       
   319 st10:
       
   320 	if ( ++p == pe )
       
   321 		goto _test_eof10;
       
   322 case 10:
       
   323 	if ( (*p) == 46 )
       
   324 		goto st11;
       
   325 	if ( 48 <= (*p) && (*p) <= 57 )
       
   326 		goto st26;
       
   327 	goto tr14;
       
   328 st11:
       
   329 	if ( ++p == pe )
       
   330 		goto _test_eof11;
       
   331 case 11:
       
   332 	if ( 48 <= (*p) && (*p) <= 57 )
       
   333 		goto st12;
       
   334 	goto tr14;
       
   335 st12:
       
   336 	if ( ++p == pe )
       
   337 		goto _test_eof12;
       
   338 case 12:
       
   339 	if ( (*p) == 47 )
       
   340 		goto tr28;
       
   341 	if ( 48 <= (*p) && (*p) <= 57 )
       
   342 		goto st24;
       
   343 	goto tr3;
       
   344 tr28:
       
   345 #line 63 "parser.rl"
       
   346 	{ p_request->tokens.c_ip_length = p - ( *pe + p_request->tokens.c_ip_start ); }
       
   347 	goto st13;
       
   348 st13:
       
   349 	if ( ++p == pe )
       
   350 		goto _test_eof13;
       
   351 case 13:
       
   352 #line 353 "parser.c"
       
   353 	if ( (*p) == 45 )
       
   354 		goto st14;
       
   355 	if ( (*p) < 65 ) {
       
   356 		if ( 48 <= (*p) && (*p) <= 57 )
       
   357 			goto st21;
       
   358 	} else if ( (*p) > 90 ) {
       
   359 		if ( 97 <= (*p) && (*p) <= 122 )
       
   360 			goto st21;
       
   361 	} else
       
   362 		goto st21;
       
   363 	goto tr3;
       
   364 st14:
       
   365 	if ( ++p == pe )
       
   366 		goto _test_eof14;
       
   367 case 14:
       
   368 	if ( (*p) == 32 )
       
   369 		goto st15;
       
   370 	if ( 9 <= (*p) && (*p) <= 13 )
       
   371 		goto st15;
       
   372 	goto tr3;
       
   373 st15:
       
   374 	if ( ++p == pe )
       
   375 		goto _test_eof15;
       
   376 case 15:
       
   377 	switch( (*p) ) {
       
   378 		case 33: goto st16;
       
   379 		case 59: goto st16;
       
   380 		case 61: goto st16;
       
   381 		case 95: goto st16;
       
   382 		case 126: goto st16;
       
   383 	}
       
   384 	if ( (*p) < 48 ) {
       
   385 		if ( 36 <= (*p) && (*p) <= 46 )
       
   386 			goto st16;
       
   387 	} else if ( (*p) > 57 ) {
       
   388 		if ( (*p) > 90 ) {
       
   389 			if ( 97 <= (*p) && (*p) <= 122 )
       
   390 				goto st16;
       
   391 		} else if ( (*p) >= 65 )
       
   392 			goto st16;
       
   393 	} else
       
   394 		goto st16;
       
   395 	goto tr3;
       
   396 st16:
       
   397 	if ( ++p == pe )
       
   398 		goto _test_eof16;
       
   399 case 16:
       
   400 	switch( (*p) ) {
       
   401 		case 32: goto st17;
       
   402 		case 33: goto st16;
       
   403 		case 59: goto st16;
       
   404 		case 61: goto st16;
       
   405 		case 95: goto st16;
       
   406 		case 126: goto st16;
       
   407 	}
       
   408 	if ( (*p) < 48 ) {
       
   409 		if ( (*p) > 13 ) {
       
   410 			if ( 36 <= (*p) && (*p) <= 46 )
       
   411 				goto st16;
       
   412 		} else if ( (*p) >= 9 )
       
   413 			goto st17;
       
   414 	} else if ( (*p) > 57 ) {
       
   415 		if ( (*p) > 90 ) {
       
   416 			if ( 97 <= (*p) && (*p) <= 122 )
       
   417 				goto st16;
       
   418 		} else if ( (*p) >= 65 )
       
   419 			goto st16;
       
   420 	} else
       
   421 		goto st16;
       
   422 	goto tr3;
       
   423 st17:
       
   424 	if ( ++p == pe )
       
   425 		goto _test_eof17;
       
   426 case 17:
       
   427 	if ( 65 <= (*p) && (*p) <= 90 )
       
   428 		goto tr36;
       
   429 	goto tr35;
       
   430 tr36:
       
   431 #line 58 "parser.rl"
       
   432 	{ p_request->tokens.meth_start  = p; }
       
   433 	goto st18;
       
   434 st18:
       
   435 	if ( ++p == pe )
       
   436 		goto _test_eof18;
       
   437 case 18:
       
   438 #line 439 "parser.c"
       
   439 	switch( (*p) ) {
       
   440 		case 10: goto tr39;
       
   441 		case 32: goto tr37;
       
   442 	}
       
   443 	if ( (*p) > 13 ) {
       
   444 		if ( 65 <= (*p) && (*p) <= 90 )
       
   445 			goto st18;
       
   446 	} else if ( (*p) >= 9 )
       
   447 		goto tr37;
       
   448 	goto st0;
       
   449 tr37:
       
   450 #line 59 "parser.rl"
       
   451 	{ p_request->tokens.meth_length = p - ( *pe + p_request->tokens.meth_start ); }
       
   452 	goto st19;
       
   453 st19:
       
   454 	if ( ++p == pe )
       
   455 		goto _test_eof19;
       
   456 case 19:
       
   457 #line 458 "parser.c"
       
   458 	goto st20;
       
   459 st20:
       
   460 	if ( ++p == pe )
       
   461 		goto _test_eof20;
       
   462 case 20:
       
   463 	if ( (*p) == 10 )
       
   464 		goto tr42;
       
   465 	goto st20;
       
   466 tr42:
       
   467 #line 36 "parser.rl"
       
   468 	{ valid = 1; }
       
   469 	goto st85;
       
   470 st85:
       
   471 	if ( ++p == pe )
       
   472 		goto _test_eof85;
       
   473 case 85:
       
   474 #line 475 "parser.c"
       
   475 	if ( (*p) == 10 )
       
   476 		goto tr42;
       
   477 	goto st20;
       
   478 tr39:
       
   479 #line 59 "parser.rl"
       
   480 	{ p_request->tokens.meth_length = p - ( *pe + p_request->tokens.meth_start ); }
       
   481 #line 36 "parser.rl"
       
   482 	{ valid = 1; }
       
   483 	goto st86;
       
   484 st86:
       
   485 	if ( ++p == pe )
       
   486 		goto _test_eof86;
       
   487 case 86:
       
   488 #line 489 "parser.c"
       
   489 	goto st20;
       
   490 st21:
       
   491 	if ( ++p == pe )
       
   492 		goto _test_eof21;
       
   493 case 21:
       
   494 	switch( (*p) ) {
       
   495 		case 32: goto st15;
       
   496 		case 45: goto st22;
       
   497 		case 46: goto st23;
       
   498 		case 95: goto st22;
       
   499 	}
       
   500 	if ( (*p) < 48 ) {
       
   501 		if ( 9 <= (*p) && (*p) <= 13 )
       
   502 			goto st15;
       
   503 	} else if ( (*p) > 57 ) {
       
   504 		if ( (*p) > 90 ) {
       
   505 			if ( 97 <= (*p) && (*p) <= 122 )
       
   506 				goto st21;
       
   507 		} else if ( (*p) >= 65 )
       
   508 			goto st21;
       
   509 	} else
       
   510 		goto st21;
       
   511 	goto tr3;
       
   512 st22:
       
   513 	if ( ++p == pe )
       
   514 		goto _test_eof22;
       
   515 case 22:
       
   516 	switch( (*p) ) {
       
   517 		case 45: goto st22;
       
   518 		case 95: goto st22;
       
   519 	}
       
   520 	if ( (*p) < 65 ) {
       
   521 		if ( 48 <= (*p) && (*p) <= 57 )
       
   522 			goto st21;
       
   523 	} else if ( (*p) > 90 ) {
       
   524 		if ( 97 <= (*p) && (*p) <= 122 )
       
   525 			goto st21;
       
   526 	} else
       
   527 		goto st21;
       
   528 	goto tr3;
       
   529 st23:
       
   530 	if ( ++p == pe )
       
   531 		goto _test_eof23;
       
   532 case 23:
       
   533 	if ( (*p) == 32 )
       
   534 		goto st15;
       
   535 	if ( (*p) < 48 ) {
       
   536 		if ( 9 <= (*p) && (*p) <= 13 )
       
   537 			goto st15;
       
   538 	} else if ( (*p) > 57 ) {
       
   539 		if ( (*p) > 90 ) {
       
   540 			if ( 97 <= (*p) && (*p) <= 122 )
       
   541 				goto st21;
       
   542 		} else if ( (*p) >= 65 )
       
   543 			goto st21;
       
   544 	} else
       
   545 		goto st21;
       
   546 	goto tr3;
       
   547 st24:
       
   548 	if ( ++p == pe )
       
   549 		goto _test_eof24;
       
   550 case 24:
       
   551 	if ( (*p) == 47 )
       
   552 		goto tr28;
       
   553 	if ( 48 <= (*p) && (*p) <= 57 )
       
   554 		goto st25;
       
   555 	goto tr3;
       
   556 st25:
       
   557 	if ( ++p == pe )
       
   558 		goto _test_eof25;
       
   559 case 25:
       
   560 	if ( (*p) == 47 )
       
   561 		goto tr28;
       
   562 	goto tr3;
       
   563 st26:
       
   564 	if ( ++p == pe )
       
   565 		goto _test_eof26;
       
   566 case 26:
       
   567 	if ( (*p) == 46 )
       
   568 		goto st11;
       
   569 	if ( 48 <= (*p) && (*p) <= 57 )
       
   570 		goto st27;
       
   571 	goto tr14;
       
   572 st27:
       
   573 	if ( ++p == pe )
       
   574 		goto _test_eof27;
       
   575 case 27:
       
   576 	if ( (*p) == 46 )
       
   577 		goto st11;
       
   578 	goto tr14;
       
   579 st28:
       
   580 	if ( ++p == pe )
       
   581 		goto _test_eof28;
       
   582 case 28:
       
   583 	if ( (*p) == 46 )
       
   584 		goto st9;
       
   585 	if ( 48 <= (*p) && (*p) <= 57 )
       
   586 		goto st29;
       
   587 	goto tr14;
       
   588 st29:
       
   589 	if ( ++p == pe )
       
   590 		goto _test_eof29;
       
   591 case 29:
       
   592 	if ( (*p) == 46 )
       
   593 		goto st9;
       
   594 	goto tr14;
       
   595 st30:
       
   596 	if ( ++p == pe )
       
   597 		goto _test_eof30;
       
   598 case 30:
       
   599 	if ( (*p) == 46 )
       
   600 		goto st7;
       
   601 	if ( 48 <= (*p) && (*p) <= 57 )
       
   602 		goto st31;
       
   603 	goto tr14;
       
   604 st31:
       
   605 	if ( ++p == pe )
       
   606 		goto _test_eof31;
       
   607 case 31:
       
   608 	if ( (*p) == 46 )
       
   609 		goto st7;
       
   610 	goto tr14;
       
   611 st32:
       
   612 	if ( ++p == pe )
       
   613 		goto _test_eof32;
       
   614 case 32:
       
   615 	switch( (*p) ) {
       
   616 		case 45: goto st32;
       
   617 		case 95: goto st32;
       
   618 	}
       
   619 	if ( (*p) < 65 ) {
       
   620 		if ( 48 <= (*p) && (*p) <= 57 )
       
   621 			goto st33;
       
   622 	} else if ( (*p) > 90 ) {
       
   623 		if ( 97 <= (*p) && (*p) <= 122 )
       
   624 			goto st33;
       
   625 	} else
       
   626 		goto st33;
       
   627 	goto tr49;
       
   628 tr99:
       
   629 #line 45 "parser.rl"
       
   630 	{ p_request->tokens.scheme_length = p - ( *pe + p_request->tokens.scheme_start ); }
       
   631 #line 48 "parser.rl"
       
   632 	{ p_request->tokens.host_start  = p; }
       
   633 	goto st33;
       
   634 st33:
       
   635 	if ( ++p == pe )
       
   636 		goto _test_eof33;
       
   637 case 33:
       
   638 #line 639 "parser.c"
       
   639 	switch( (*p) ) {
       
   640 		case 32: goto tr15;
       
   641 		case 45: goto st32;
       
   642 		case 46: goto st34;
       
   643 		case 47: goto tr7;
       
   644 		case 58: goto tr9;
       
   645 		case 95: goto st32;
       
   646 	}
       
   647 	if ( (*p) < 48 ) {
       
   648 		if ( 9 <= (*p) && (*p) <= 13 )
       
   649 			goto tr15;
       
   650 	} else if ( (*p) > 57 ) {
       
   651 		if ( (*p) > 90 ) {
       
   652 			if ( 97 <= (*p) && (*p) <= 122 )
       
   653 				goto st33;
       
   654 		} else if ( (*p) >= 65 )
       
   655 			goto st33;
       
   656 	} else
       
   657 		goto st33;
       
   658 	goto tr3;
       
   659 st34:
       
   660 	if ( ++p == pe )
       
   661 		goto _test_eof34;
       
   662 case 34:
       
   663 	switch( (*p) ) {
       
   664 		case 32: goto tr15;
       
   665 		case 47: goto tr7;
       
   666 		case 58: goto tr9;
       
   667 	}
       
   668 	if ( (*p) < 48 ) {
       
   669 		if ( 9 <= (*p) && (*p) <= 13 )
       
   670 			goto tr15;
       
   671 	} else if ( (*p) > 57 ) {
       
   672 		if ( (*p) > 90 ) {
       
   673 			if ( 97 <= (*p) && (*p) <= 122 )
       
   674 				goto st33;
       
   675 		} else if ( (*p) >= 65 )
       
   676 			goto st33;
       
   677 	} else
       
   678 		goto st33;
       
   679 	goto tr3;
       
   680 tr7:
       
   681 #line 49 "parser.rl"
       
   682 	{ p_request->tokens.host_length = p - ( *pe + p_request->tokens.host_start ); }
       
   683 #line 55 "parser.rl"
       
   684 	{ p_request->tokens.path_start  = p; }
       
   685 	goto st35;
       
   686 tr54:
       
   687 #line 53 "parser.rl"
       
   688 	{ p_request->tokens.port_length = p - ( *pe + p_request->tokens.port_start ); }
       
   689 #line 55 "parser.rl"
       
   690 	{ p_request->tokens.path_start  = p; }
       
   691 	goto st35;
       
   692 st35:
       
   693 	if ( ++p == pe )
       
   694 		goto _test_eof35;
       
   695 case 35:
       
   696 #line 697 "parser.c"
       
   697 	if ( (*p) == 32 )
       
   698 		goto tr51;
       
   699 	if ( 9 <= (*p) && (*p) <= 13 )
       
   700 		goto tr51;
       
   701 	goto st35;
       
   702 tr9:
       
   703 #line 49 "parser.rl"
       
   704 	{ p_request->tokens.host_length = p - ( *pe + p_request->tokens.host_start ); }
       
   705 #line 52 "parser.rl"
       
   706 	{ p_request->tokens.port_start  = p; }
       
   707 	goto st36;
       
   708 st36:
       
   709 	if ( ++p == pe )
       
   710 		goto _test_eof36;
       
   711 case 36:
       
   712 #line 713 "parser.c"
       
   713 	if ( 48 <= (*p) && (*p) <= 57 )
       
   714 		goto st37;
       
   715 	goto tr3;
       
   716 st37:
       
   717 	if ( ++p == pe )
       
   718 		goto _test_eof37;
       
   719 case 37:
       
   720 	switch( (*p) ) {
       
   721 		case 32: goto tr53;
       
   722 		case 47: goto tr54;
       
   723 	}
       
   724 	if ( (*p) > 13 ) {
       
   725 		if ( 48 <= (*p) && (*p) <= 57 )
       
   726 			goto st38;
       
   727 	} else if ( (*p) >= 9 )
       
   728 		goto tr53;
       
   729 	goto tr3;
       
   730 st38:
       
   731 	if ( ++p == pe )
       
   732 		goto _test_eof38;
       
   733 case 38:
       
   734 	switch( (*p) ) {
       
   735 		case 32: goto tr53;
       
   736 		case 47: goto tr54;
       
   737 	}
       
   738 	if ( (*p) > 13 ) {
       
   739 		if ( 48 <= (*p) && (*p) <= 57 )
       
   740 			goto st39;
       
   741 	} else if ( (*p) >= 9 )
       
   742 		goto tr53;
       
   743 	goto tr3;
       
   744 st39:
       
   745 	if ( ++p == pe )
       
   746 		goto _test_eof39;
       
   747 case 39:
       
   748 	switch( (*p) ) {
       
   749 		case 32: goto tr53;
       
   750 		case 47: goto tr54;
       
   751 	}
       
   752 	if ( (*p) > 13 ) {
       
   753 		if ( 48 <= (*p) && (*p) <= 57 )
       
   754 			goto st40;
       
   755 	} else if ( (*p) >= 9 )
       
   756 		goto tr53;
       
   757 	goto tr3;
       
   758 st40:
       
   759 	if ( ++p == pe )
       
   760 		goto _test_eof40;
       
   761 case 40:
       
   762 	switch( (*p) ) {
       
   763 		case 32: goto tr53;
       
   764 		case 47: goto tr54;
       
   765 	}
       
   766 	if ( (*p) > 13 ) {
       
   767 		if ( 48 <= (*p) && (*p) <= 57 )
       
   768 			goto st41;
       
   769 	} else if ( (*p) >= 9 )
       
   770 		goto tr53;
       
   771 	goto tr3;
       
   772 st41:
       
   773 	if ( ++p == pe )
       
   774 		goto _test_eof41;
       
   775 case 41:
       
   776 	switch( (*p) ) {
       
   777 		case 32: goto tr53;
       
   778 		case 47: goto tr54;
       
   779 	}
       
   780 	if ( 9 <= (*p) && (*p) <= 13 )
       
   781 		goto tr53;
       
   782 	goto tr3;
       
   783 st42:
       
   784 	if ( ++p == pe )
       
   785 		goto _test_eof42;
       
   786 case 42:
       
   787 	switch( (*p) ) {
       
   788 		case 32: goto tr15;
       
   789 		case 47: goto tr7;
       
   790 		case 58: goto tr9;
       
   791 	}
       
   792 	if ( (*p) < 48 ) {
       
   793 		if ( 9 <= (*p) && (*p) <= 13 )
       
   794 			goto tr15;
       
   795 	} else if ( (*p) > 57 ) {
       
   796 		if ( (*p) > 90 ) {
       
   797 			if ( 97 <= (*p) && (*p) <= 122 )
       
   798 				goto st33;
       
   799 		} else if ( (*p) >= 65 )
       
   800 			goto st33;
       
   801 	} else
       
   802 		goto st43;
       
   803 	goto tr14;
       
   804 st43:
       
   805 	if ( ++p == pe )
       
   806 		goto _test_eof43;
       
   807 case 43:
       
   808 	switch( (*p) ) {
       
   809 		case 32: goto tr15;
       
   810 		case 45: goto st32;
       
   811 		case 46: goto st44;
       
   812 		case 47: goto tr7;
       
   813 		case 58: goto tr9;
       
   814 		case 95: goto st32;
       
   815 	}
       
   816 	if ( (*p) < 48 ) {
       
   817 		if ( 9 <= (*p) && (*p) <= 13 )
       
   818 			goto tr15;
       
   819 	} else if ( (*p) > 57 ) {
       
   820 		if ( (*p) > 90 ) {
       
   821 			if ( 97 <= (*p) && (*p) <= 122 )
       
   822 				goto st33;
       
   823 		} else if ( (*p) >= 65 )
       
   824 			goto st33;
       
   825 	} else
       
   826 		goto st73;
       
   827 	goto tr14;
       
   828 st44:
       
   829 	if ( ++p == pe )
       
   830 		goto _test_eof44;
       
   831 case 44:
       
   832 	switch( (*p) ) {
       
   833 		case 32: goto tr15;
       
   834 		case 47: goto tr7;
       
   835 		case 58: goto tr9;
       
   836 	}
       
   837 	if ( (*p) < 48 ) {
       
   838 		if ( 9 <= (*p) && (*p) <= 13 )
       
   839 			goto tr15;
       
   840 	} else if ( (*p) > 57 ) {
       
   841 		if ( (*p) > 90 ) {
       
   842 			if ( 97 <= (*p) && (*p) <= 122 )
       
   843 				goto st33;
       
   844 		} else if ( (*p) >= 65 )
       
   845 			goto st33;
       
   846 	} else
       
   847 		goto st45;
       
   848 	goto tr14;
       
   849 st45:
       
   850 	if ( ++p == pe )
       
   851 		goto _test_eof45;
       
   852 case 45:
       
   853 	switch( (*p) ) {
       
   854 		case 32: goto tr15;
       
   855 		case 45: goto st32;
       
   856 		case 46: goto st46;
       
   857 		case 47: goto tr7;
       
   858 		case 58: goto tr9;
       
   859 		case 95: goto st32;
       
   860 	}
       
   861 	if ( (*p) < 48 ) {
       
   862 		if ( 9 <= (*p) && (*p) <= 13 )
       
   863 			goto tr15;
       
   864 	} else if ( (*p) > 57 ) {
       
   865 		if ( (*p) > 90 ) {
       
   866 			if ( 97 <= (*p) && (*p) <= 122 )
       
   867 				goto st33;
       
   868 		} else if ( (*p) >= 65 )
       
   869 			goto st33;
       
   870 	} else
       
   871 		goto st71;
       
   872 	goto tr14;
       
   873 st46:
       
   874 	if ( ++p == pe )
       
   875 		goto _test_eof46;
       
   876 case 46:
       
   877 	switch( (*p) ) {
       
   878 		case 32: goto tr15;
       
   879 		case 47: goto tr7;
       
   880 		case 58: goto tr9;
       
   881 	}
       
   882 	if ( (*p) < 48 ) {
       
   883 		if ( 9 <= (*p) && (*p) <= 13 )
       
   884 			goto tr15;
       
   885 	} else if ( (*p) > 57 ) {
       
   886 		if ( (*p) > 90 ) {
       
   887 			if ( 97 <= (*p) && (*p) <= 122 )
       
   888 				goto st33;
       
   889 		} else if ( (*p) >= 65 )
       
   890 			goto st33;
       
   891 	} else
       
   892 		goto st47;
       
   893 	goto tr14;
       
   894 st47:
       
   895 	if ( ++p == pe )
       
   896 		goto _test_eof47;
       
   897 case 47:
       
   898 	switch( (*p) ) {
       
   899 		case 32: goto tr15;
       
   900 		case 45: goto st32;
       
   901 		case 46: goto st34;
       
   902 		case 47: goto tr66;
       
   903 		case 58: goto tr9;
       
   904 		case 95: goto st32;
       
   905 	}
       
   906 	if ( (*p) < 48 ) {
       
   907 		if ( 9 <= (*p) && (*p) <= 13 )
       
   908 			goto tr15;
       
   909 	} else if ( (*p) > 57 ) {
       
   910 		if ( (*p) > 90 ) {
       
   911 			if ( 97 <= (*p) && (*p) <= 122 )
       
   912 				goto st33;
       
   913 		} else if ( (*p) >= 65 )
       
   914 			goto st33;
       
   915 	} else
       
   916 		goto st69;
       
   917 	goto tr3;
       
   918 tr66:
       
   919 #line 49 "parser.rl"
       
   920 	{ p_request->tokens.host_length = p - ( *pe + p_request->tokens.host_start ); }
       
   921 #line 55 "parser.rl"
       
   922 	{ p_request->tokens.path_start  = p; }
       
   923 #line 63 "parser.rl"
       
   924 	{ p_request->tokens.c_ip_length = p - ( *pe + p_request->tokens.c_ip_start ); }
       
   925 	goto st48;
       
   926 st48:
       
   927 	if ( ++p == pe )
       
   928 		goto _test_eof48;
       
   929 case 48:
       
   930 #line 931 "parser.c"
       
   931 	switch( (*p) ) {
       
   932 		case 32: goto tr51;
       
   933 		case 45: goto st49;
       
   934 	}
       
   935 	if ( (*p) < 48 ) {
       
   936 		if ( 9 <= (*p) && (*p) <= 13 )
       
   937 			goto tr51;
       
   938 	} else if ( (*p) > 57 ) {
       
   939 		if ( (*p) > 90 ) {
       
   940 			if ( 97 <= (*p) && (*p) <= 122 )
       
   941 				goto st66;
       
   942 		} else if ( (*p) >= 65 )
       
   943 			goto st66;
       
   944 	} else
       
   945 		goto st66;
       
   946 	goto st35;
       
   947 st49:
       
   948 	if ( ++p == pe )
       
   949 		goto _test_eof49;
       
   950 case 49:
       
   951 	if ( (*p) == 32 )
       
   952 		goto tr70;
       
   953 	if ( 9 <= (*p) && (*p) <= 13 )
       
   954 		goto tr70;
       
   955 	goto st35;
       
   956 tr70:
       
   957 #line 56 "parser.rl"
       
   958 	{ p_request->tokens.path_length = p - ( *pe + p_request->tokens.path_start ); }
       
   959 	goto st50;
       
   960 st50:
       
   961 	if ( ++p == pe )
       
   962 		goto _test_eof50;
       
   963 case 50:
       
   964 #line 965 "parser.c"
       
   965 	switch( (*p) ) {
       
   966 		case 33: goto st16;
       
   967 		case 59: goto st16;
       
   968 		case 61: goto st16;
       
   969 		case 95: goto st16;
       
   970 		case 126: goto st16;
       
   971 	}
       
   972 	if ( (*p) < 48 ) {
       
   973 		if ( 36 <= (*p) && (*p) <= 46 )
       
   974 			goto st16;
       
   975 	} else if ( (*p) > 57 ) {
       
   976 		if ( (*p) > 90 ) {
       
   977 			if ( 97 <= (*p) && (*p) <= 122 )
       
   978 				goto st16;
       
   979 		} else if ( (*p) >= 65 )
       
   980 			goto st16;
       
   981 	} else
       
   982 		goto tr71;
       
   983 	goto tr14;
       
   984 tr71:
       
   985 #line 62 "parser.rl"
       
   986 	{ p_request->tokens.c_ip_start  = p; }
       
   987 	goto st51;
       
   988 st51:
       
   989 	if ( ++p == pe )
       
   990 		goto _test_eof51;
       
   991 case 51:
       
   992 #line 993 "parser.c"
       
   993 	switch( (*p) ) {
       
   994 		case 32: goto st17;
       
   995 		case 33: goto st16;
       
   996 		case 46: goto st52;
       
   997 		case 59: goto st16;
       
   998 		case 61: goto st16;
       
   999 		case 95: goto st16;
       
  1000 		case 126: goto st16;
       
  1001 	}
       
  1002 	if ( (*p) < 48 ) {
       
  1003 		if ( (*p) > 13 ) {
       
  1004 			if ( 36 <= (*p) && (*p) <= 45 )
       
  1005 				goto st16;
       
  1006 		} else if ( (*p) >= 9 )
       
  1007 			goto st17;
       
  1008 	} else if ( (*p) > 57 ) {
       
  1009 		if ( (*p) > 90 ) {
       
  1010 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1011 				goto st16;
       
  1012 		} else if ( (*p) >= 65 )
       
  1013 			goto st16;
       
  1014 	} else
       
  1015 		goto st64;
       
  1016 	goto tr14;
       
  1017 st52:
       
  1018 	if ( ++p == pe )
       
  1019 		goto _test_eof52;
       
  1020 case 52:
       
  1021 	switch( (*p) ) {
       
  1022 		case 32: goto st17;
       
  1023 		case 33: goto st16;
       
  1024 		case 59: goto st16;
       
  1025 		case 61: goto st16;
       
  1026 		case 95: goto st16;
       
  1027 		case 126: goto st16;
       
  1028 	}
       
  1029 	if ( (*p) < 48 ) {
       
  1030 		if ( (*p) > 13 ) {
       
  1031 			if ( 36 <= (*p) && (*p) <= 46 )
       
  1032 				goto st16;
       
  1033 		} else if ( (*p) >= 9 )
       
  1034 			goto st17;
       
  1035 	} else if ( (*p) > 57 ) {
       
  1036 		if ( (*p) > 90 ) {
       
  1037 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1038 				goto st16;
       
  1039 		} else if ( (*p) >= 65 )
       
  1040 			goto st16;
       
  1041 	} else
       
  1042 		goto st53;
       
  1043 	goto tr14;
       
  1044 st53:
       
  1045 	if ( ++p == pe )
       
  1046 		goto _test_eof53;
       
  1047 case 53:
       
  1048 	switch( (*p) ) {
       
  1049 		case 32: goto st17;
       
  1050 		case 33: goto st16;
       
  1051 		case 46: goto st54;
       
  1052 		case 59: goto st16;
       
  1053 		case 61: goto st16;
       
  1054 		case 95: goto st16;
       
  1055 		case 126: goto st16;
       
  1056 	}
       
  1057 	if ( (*p) < 48 ) {
       
  1058 		if ( (*p) > 13 ) {
       
  1059 			if ( 36 <= (*p) && (*p) <= 45 )
       
  1060 				goto st16;
       
  1061 		} else if ( (*p) >= 9 )
       
  1062 			goto st17;
       
  1063 	} else if ( (*p) > 57 ) {
       
  1064 		if ( (*p) > 90 ) {
       
  1065 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1066 				goto st16;
       
  1067 		} else if ( (*p) >= 65 )
       
  1068 			goto st16;
       
  1069 	} else
       
  1070 		goto st62;
       
  1071 	goto tr14;
       
  1072 st54:
       
  1073 	if ( ++p == pe )
       
  1074 		goto _test_eof54;
       
  1075 case 54:
       
  1076 	switch( (*p) ) {
       
  1077 		case 32: goto st17;
       
  1078 		case 33: goto st16;
       
  1079 		case 59: goto st16;
       
  1080 		case 61: goto st16;
       
  1081 		case 95: goto st16;
       
  1082 		case 126: goto st16;
       
  1083 	}
       
  1084 	if ( (*p) < 48 ) {
       
  1085 		if ( (*p) > 13 ) {
       
  1086 			if ( 36 <= (*p) && (*p) <= 46 )
       
  1087 				goto st16;
       
  1088 		} else if ( (*p) >= 9 )
       
  1089 			goto st17;
       
  1090 	} else if ( (*p) > 57 ) {
       
  1091 		if ( (*p) > 90 ) {
       
  1092 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1093 				goto st16;
       
  1094 		} else if ( (*p) >= 65 )
       
  1095 			goto st16;
       
  1096 	} else
       
  1097 		goto st55;
       
  1098 	goto tr14;
       
  1099 st55:
       
  1100 	if ( ++p == pe )
       
  1101 		goto _test_eof55;
       
  1102 case 55:
       
  1103 	switch( (*p) ) {
       
  1104 		case 32: goto st17;
       
  1105 		case 33: goto st16;
       
  1106 		case 46: goto st56;
       
  1107 		case 59: goto st16;
       
  1108 		case 61: goto st16;
       
  1109 		case 95: goto st16;
       
  1110 		case 126: goto st16;
       
  1111 	}
       
  1112 	if ( (*p) < 48 ) {
       
  1113 		if ( (*p) > 13 ) {
       
  1114 			if ( 36 <= (*p) && (*p) <= 45 )
       
  1115 				goto st16;
       
  1116 		} else if ( (*p) >= 9 )
       
  1117 			goto st17;
       
  1118 	} else if ( (*p) > 57 ) {
       
  1119 		if ( (*p) > 90 ) {
       
  1120 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1121 				goto st16;
       
  1122 		} else if ( (*p) >= 65 )
       
  1123 			goto st16;
       
  1124 	} else
       
  1125 		goto st60;
       
  1126 	goto tr14;
       
  1127 st56:
       
  1128 	if ( ++p == pe )
       
  1129 		goto _test_eof56;
       
  1130 case 56:
       
  1131 	switch( (*p) ) {
       
  1132 		case 32: goto st17;
       
  1133 		case 33: goto st16;
       
  1134 		case 59: goto st16;
       
  1135 		case 61: goto st16;
       
  1136 		case 95: goto st16;
       
  1137 		case 126: goto st16;
       
  1138 	}
       
  1139 	if ( (*p) < 48 ) {
       
  1140 		if ( (*p) > 13 ) {
       
  1141 			if ( 36 <= (*p) && (*p) <= 46 )
       
  1142 				goto st16;
       
  1143 		} else if ( (*p) >= 9 )
       
  1144 			goto st17;
       
  1145 	} else if ( (*p) > 57 ) {
       
  1146 		if ( (*p) > 90 ) {
       
  1147 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1148 				goto st16;
       
  1149 		} else if ( (*p) >= 65 )
       
  1150 			goto st16;
       
  1151 	} else
       
  1152 		goto st57;
       
  1153 	goto tr14;
       
  1154 st57:
       
  1155 	if ( ++p == pe )
       
  1156 		goto _test_eof57;
       
  1157 case 57:
       
  1158 	switch( (*p) ) {
       
  1159 		case 32: goto st17;
       
  1160 		case 33: goto st16;
       
  1161 		case 47: goto tr28;
       
  1162 		case 59: goto st16;
       
  1163 		case 61: goto st16;
       
  1164 		case 95: goto st16;
       
  1165 		case 126: goto st16;
       
  1166 	}
       
  1167 	if ( (*p) < 48 ) {
       
  1168 		if ( (*p) > 13 ) {
       
  1169 			if ( 36 <= (*p) && (*p) <= 46 )
       
  1170 				goto st16;
       
  1171 		} else if ( (*p) >= 9 )
       
  1172 			goto st17;
       
  1173 	} else if ( (*p) > 57 ) {
       
  1174 		if ( (*p) > 90 ) {
       
  1175 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1176 				goto st16;
       
  1177 		} else if ( (*p) >= 65 )
       
  1178 			goto st16;
       
  1179 	} else
       
  1180 		goto st58;
       
  1181 	goto tr3;
       
  1182 st58:
       
  1183 	if ( ++p == pe )
       
  1184 		goto _test_eof58;
       
  1185 case 58:
       
  1186 	switch( (*p) ) {
       
  1187 		case 32: goto st17;
       
  1188 		case 33: goto st16;
       
  1189 		case 47: goto tr28;
       
  1190 		case 59: goto st16;
       
  1191 		case 61: goto st16;
       
  1192 		case 95: goto st16;
       
  1193 		case 126: goto st16;
       
  1194 	}
       
  1195 	if ( (*p) < 48 ) {
       
  1196 		if ( (*p) > 13 ) {
       
  1197 			if ( 36 <= (*p) && (*p) <= 46 )
       
  1198 				goto st16;
       
  1199 		} else if ( (*p) >= 9 )
       
  1200 			goto st17;
       
  1201 	} else if ( (*p) > 57 ) {
       
  1202 		if ( (*p) > 90 ) {
       
  1203 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1204 				goto st16;
       
  1205 		} else if ( (*p) >= 65 )
       
  1206 			goto st16;
       
  1207 	} else
       
  1208 		goto st59;
       
  1209 	goto tr3;
       
  1210 st59:
       
  1211 	if ( ++p == pe )
       
  1212 		goto _test_eof59;
       
  1213 case 59:
       
  1214 	switch( (*p) ) {
       
  1215 		case 32: goto st17;
       
  1216 		case 33: goto st16;
       
  1217 		case 47: goto tr28;
       
  1218 		case 59: goto st16;
       
  1219 		case 61: goto st16;
       
  1220 		case 95: goto st16;
       
  1221 		case 126: goto st16;
       
  1222 	}
       
  1223 	if ( (*p) < 36 ) {
       
  1224 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1225 			goto st17;
       
  1226 	} else if ( (*p) > 57 ) {
       
  1227 		if ( (*p) > 90 ) {
       
  1228 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1229 				goto st16;
       
  1230 		} else if ( (*p) >= 65 )
       
  1231 			goto st16;
       
  1232 	} else
       
  1233 		goto st16;
       
  1234 	goto tr3;
       
  1235 st60:
       
  1236 	if ( ++p == pe )
       
  1237 		goto _test_eof60;
       
  1238 case 60:
       
  1239 	switch( (*p) ) {
       
  1240 		case 32: goto st17;
       
  1241 		case 33: goto st16;
       
  1242 		case 46: goto st56;
       
  1243 		case 59: goto st16;
       
  1244 		case 61: goto st16;
       
  1245 		case 95: goto st16;
       
  1246 		case 126: goto st16;
       
  1247 	}
       
  1248 	if ( (*p) < 48 ) {
       
  1249 		if ( (*p) > 13 ) {
       
  1250 			if ( 36 <= (*p) && (*p) <= 45 )
       
  1251 				goto st16;
       
  1252 		} else if ( (*p) >= 9 )
       
  1253 			goto st17;
       
  1254 	} else if ( (*p) > 57 ) {
       
  1255 		if ( (*p) > 90 ) {
       
  1256 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1257 				goto st16;
       
  1258 		} else if ( (*p) >= 65 )
       
  1259 			goto st16;
       
  1260 	} else
       
  1261 		goto st61;
       
  1262 	goto tr14;
       
  1263 st61:
       
  1264 	if ( ++p == pe )
       
  1265 		goto _test_eof61;
       
  1266 case 61:
       
  1267 	switch( (*p) ) {
       
  1268 		case 32: goto st17;
       
  1269 		case 33: goto st16;
       
  1270 		case 46: goto st56;
       
  1271 		case 59: goto st16;
       
  1272 		case 61: goto st16;
       
  1273 		case 95: goto st16;
       
  1274 		case 126: goto st16;
       
  1275 	}
       
  1276 	if ( (*p) < 48 ) {
       
  1277 		if ( (*p) > 13 ) {
       
  1278 			if ( 36 <= (*p) && (*p) <= 45 )
       
  1279 				goto st16;
       
  1280 		} else if ( (*p) >= 9 )
       
  1281 			goto st17;
       
  1282 	} else if ( (*p) > 57 ) {
       
  1283 		if ( (*p) > 90 ) {
       
  1284 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1285 				goto st16;
       
  1286 		} else if ( (*p) >= 65 )
       
  1287 			goto st16;
       
  1288 	} else
       
  1289 		goto st16;
       
  1290 	goto tr14;
       
  1291 st62:
       
  1292 	if ( ++p == pe )
       
  1293 		goto _test_eof62;
       
  1294 case 62:
       
  1295 	switch( (*p) ) {
       
  1296 		case 32: goto st17;
       
  1297 		case 33: goto st16;
       
  1298 		case 46: goto st54;
       
  1299 		case 59: goto st16;
       
  1300 		case 61: goto st16;
       
  1301 		case 95: goto st16;
       
  1302 		case 126: goto st16;
       
  1303 	}
       
  1304 	if ( (*p) < 48 ) {
       
  1305 		if ( (*p) > 13 ) {
       
  1306 			if ( 36 <= (*p) && (*p) <= 45 )
       
  1307 				goto st16;
       
  1308 		} else if ( (*p) >= 9 )
       
  1309 			goto st17;
       
  1310 	} else if ( (*p) > 57 ) {
       
  1311 		if ( (*p) > 90 ) {
       
  1312 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1313 				goto st16;
       
  1314 		} else if ( (*p) >= 65 )
       
  1315 			goto st16;
       
  1316 	} else
       
  1317 		goto st63;
       
  1318 	goto tr14;
       
  1319 st63:
       
  1320 	if ( ++p == pe )
       
  1321 		goto _test_eof63;
       
  1322 case 63:
       
  1323 	switch( (*p) ) {
       
  1324 		case 32: goto st17;
       
  1325 		case 33: goto st16;
       
  1326 		case 46: goto st54;
       
  1327 		case 59: goto st16;
       
  1328 		case 61: goto st16;
       
  1329 		case 95: goto st16;
       
  1330 		case 126: goto st16;
       
  1331 	}
       
  1332 	if ( (*p) < 48 ) {
       
  1333 		if ( (*p) > 13 ) {
       
  1334 			if ( 36 <= (*p) && (*p) <= 45 )
       
  1335 				goto st16;
       
  1336 		} else if ( (*p) >= 9 )
       
  1337 			goto st17;
       
  1338 	} else if ( (*p) > 57 ) {
       
  1339 		if ( (*p) > 90 ) {
       
  1340 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1341 				goto st16;
       
  1342 		} else if ( (*p) >= 65 )
       
  1343 			goto st16;
       
  1344 	} else
       
  1345 		goto st16;
       
  1346 	goto tr14;
       
  1347 st64:
       
  1348 	if ( ++p == pe )
       
  1349 		goto _test_eof64;
       
  1350 case 64:
       
  1351 	switch( (*p) ) {
       
  1352 		case 32: goto st17;
       
  1353 		case 33: goto st16;
       
  1354 		case 46: goto st52;
       
  1355 		case 59: goto st16;
       
  1356 		case 61: goto st16;
       
  1357 		case 95: goto st16;
       
  1358 		case 126: goto st16;
       
  1359 	}
       
  1360 	if ( (*p) < 48 ) {
       
  1361 		if ( (*p) > 13 ) {
       
  1362 			if ( 36 <= (*p) && (*p) <= 45 )
       
  1363 				goto st16;
       
  1364 		} else if ( (*p) >= 9 )
       
  1365 			goto st17;
       
  1366 	} else if ( (*p) > 57 ) {
       
  1367 		if ( (*p) > 90 ) {
       
  1368 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1369 				goto st16;
       
  1370 		} else if ( (*p) >= 65 )
       
  1371 			goto st16;
       
  1372 	} else
       
  1373 		goto st65;
       
  1374 	goto tr14;
       
  1375 st65:
       
  1376 	if ( ++p == pe )
       
  1377 		goto _test_eof65;
       
  1378 case 65:
       
  1379 	switch( (*p) ) {
       
  1380 		case 32: goto st17;
       
  1381 		case 33: goto st16;
       
  1382 		case 46: goto st52;
       
  1383 		case 59: goto st16;
       
  1384 		case 61: goto st16;
       
  1385 		case 95: goto st16;
       
  1386 		case 126: goto st16;
       
  1387 	}
       
  1388 	if ( (*p) < 48 ) {
       
  1389 		if ( (*p) > 13 ) {
       
  1390 			if ( 36 <= (*p) && (*p) <= 45 )
       
  1391 				goto st16;
       
  1392 		} else if ( (*p) >= 9 )
       
  1393 			goto st17;
       
  1394 	} else if ( (*p) > 57 ) {
       
  1395 		if ( (*p) > 90 ) {
       
  1396 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1397 				goto st16;
       
  1398 		} else if ( (*p) >= 65 )
       
  1399 			goto st16;
       
  1400 	} else
       
  1401 		goto st16;
       
  1402 	goto tr14;
       
  1403 st66:
       
  1404 	if ( ++p == pe )
       
  1405 		goto _test_eof66;
       
  1406 case 66:
       
  1407 	switch( (*p) ) {
       
  1408 		case 32: goto tr70;
       
  1409 		case 45: goto st67;
       
  1410 		case 46: goto st68;
       
  1411 		case 95: goto st67;
       
  1412 	}
       
  1413 	if ( (*p) < 48 ) {
       
  1414 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1415 			goto tr70;
       
  1416 	} else if ( (*p) > 57 ) {
       
  1417 		if ( (*p) > 90 ) {
       
  1418 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1419 				goto st66;
       
  1420 		} else if ( (*p) >= 65 )
       
  1421 			goto st66;
       
  1422 	} else
       
  1423 		goto st66;
       
  1424 	goto st35;
       
  1425 st67:
       
  1426 	if ( ++p == pe )
       
  1427 		goto _test_eof67;
       
  1428 case 67:
       
  1429 	switch( (*p) ) {
       
  1430 		case 32: goto tr51;
       
  1431 		case 45: goto st67;
       
  1432 		case 95: goto st67;
       
  1433 	}
       
  1434 	if ( (*p) < 48 ) {
       
  1435 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1436 			goto tr51;
       
  1437 	} else if ( (*p) > 57 ) {
       
  1438 		if ( (*p) > 90 ) {
       
  1439 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1440 				goto st66;
       
  1441 		} else if ( (*p) >= 65 )
       
  1442 			goto st66;
       
  1443 	} else
       
  1444 		goto st66;
       
  1445 	goto st35;
       
  1446 st68:
       
  1447 	if ( ++p == pe )
       
  1448 		goto _test_eof68;
       
  1449 case 68:
       
  1450 	if ( (*p) == 32 )
       
  1451 		goto tr70;
       
  1452 	if ( (*p) < 48 ) {
       
  1453 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1454 			goto tr70;
       
  1455 	} else if ( (*p) > 57 ) {
       
  1456 		if ( (*p) > 90 ) {
       
  1457 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1458 				goto st66;
       
  1459 		} else if ( (*p) >= 65 )
       
  1460 			goto st66;
       
  1461 	} else
       
  1462 		goto st66;
       
  1463 	goto st35;
       
  1464 st69:
       
  1465 	if ( ++p == pe )
       
  1466 		goto _test_eof69;
       
  1467 case 69:
       
  1468 	switch( (*p) ) {
       
  1469 		case 32: goto tr15;
       
  1470 		case 45: goto st32;
       
  1471 		case 46: goto st34;
       
  1472 		case 47: goto tr66;
       
  1473 		case 58: goto tr9;
       
  1474 		case 95: goto st32;
       
  1475 	}
       
  1476 	if ( (*p) < 48 ) {
       
  1477 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1478 			goto tr15;
       
  1479 	} else if ( (*p) > 57 ) {
       
  1480 		if ( (*p) > 90 ) {
       
  1481 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1482 				goto st33;
       
  1483 		} else if ( (*p) >= 65 )
       
  1484 			goto st33;
       
  1485 	} else
       
  1486 		goto st70;
       
  1487 	goto tr3;
       
  1488 st70:
       
  1489 	if ( ++p == pe )
       
  1490 		goto _test_eof70;
       
  1491 case 70:
       
  1492 	switch( (*p) ) {
       
  1493 		case 32: goto tr15;
       
  1494 		case 45: goto st32;
       
  1495 		case 46: goto st34;
       
  1496 		case 47: goto tr66;
       
  1497 		case 58: goto tr9;
       
  1498 		case 95: goto st32;
       
  1499 	}
       
  1500 	if ( (*p) < 48 ) {
       
  1501 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1502 			goto tr15;
       
  1503 	} else if ( (*p) > 57 ) {
       
  1504 		if ( (*p) > 90 ) {
       
  1505 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1506 				goto st33;
       
  1507 		} else if ( (*p) >= 65 )
       
  1508 			goto st33;
       
  1509 	} else
       
  1510 		goto st33;
       
  1511 	goto tr3;
       
  1512 st71:
       
  1513 	if ( ++p == pe )
       
  1514 		goto _test_eof71;
       
  1515 case 71:
       
  1516 	switch( (*p) ) {
       
  1517 		case 32: goto tr15;
       
  1518 		case 45: goto st32;
       
  1519 		case 46: goto st46;
       
  1520 		case 47: goto tr7;
       
  1521 		case 58: goto tr9;
       
  1522 		case 95: goto st32;
       
  1523 	}
       
  1524 	if ( (*p) < 48 ) {
       
  1525 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1526 			goto tr15;
       
  1527 	} else if ( (*p) > 57 ) {
       
  1528 		if ( (*p) > 90 ) {
       
  1529 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1530 				goto st33;
       
  1531 		} else if ( (*p) >= 65 )
       
  1532 			goto st33;
       
  1533 	} else
       
  1534 		goto st72;
       
  1535 	goto tr14;
       
  1536 st72:
       
  1537 	if ( ++p == pe )
       
  1538 		goto _test_eof72;
       
  1539 case 72:
       
  1540 	switch( (*p) ) {
       
  1541 		case 32: goto tr15;
       
  1542 		case 45: goto st32;
       
  1543 		case 46: goto st46;
       
  1544 		case 47: goto tr7;
       
  1545 		case 58: goto tr9;
       
  1546 		case 95: goto st32;
       
  1547 	}
       
  1548 	if ( (*p) < 48 ) {
       
  1549 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1550 			goto tr15;
       
  1551 	} else if ( (*p) > 57 ) {
       
  1552 		if ( (*p) > 90 ) {
       
  1553 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1554 				goto st33;
       
  1555 		} else if ( (*p) >= 65 )
       
  1556 			goto st33;
       
  1557 	} else
       
  1558 		goto st33;
       
  1559 	goto tr14;
       
  1560 st73:
       
  1561 	if ( ++p == pe )
       
  1562 		goto _test_eof73;
       
  1563 case 73:
       
  1564 	switch( (*p) ) {
       
  1565 		case 32: goto tr15;
       
  1566 		case 45: goto st32;
       
  1567 		case 46: goto st44;
       
  1568 		case 47: goto tr7;
       
  1569 		case 58: goto tr9;
       
  1570 		case 95: goto st32;
       
  1571 	}
       
  1572 	if ( (*p) < 48 ) {
       
  1573 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1574 			goto tr15;
       
  1575 	} else if ( (*p) > 57 ) {
       
  1576 		if ( (*p) > 90 ) {
       
  1577 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1578 				goto st33;
       
  1579 		} else if ( (*p) >= 65 )
       
  1580 			goto st33;
       
  1581 	} else
       
  1582 		goto st74;
       
  1583 	goto tr14;
       
  1584 st74:
       
  1585 	if ( ++p == pe )
       
  1586 		goto _test_eof74;
       
  1587 case 74:
       
  1588 	switch( (*p) ) {
       
  1589 		case 32: goto tr15;
       
  1590 		case 45: goto st32;
       
  1591 		case 46: goto st44;
       
  1592 		case 47: goto tr7;
       
  1593 		case 58: goto tr9;
       
  1594 		case 95: goto st32;
       
  1595 	}
       
  1596 	if ( (*p) < 48 ) {
       
  1597 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1598 			goto tr15;
       
  1599 	} else if ( (*p) > 57 ) {
       
  1600 		if ( (*p) > 90 ) {
       
  1601 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1602 				goto st33;
       
  1603 		} else if ( (*p) >= 65 )
       
  1604 			goto st33;
       
  1605 	} else
       
  1606 		goto st33;
       
  1607 	goto tr14;
       
  1608 st75:
       
  1609 	if ( ++p == pe )
       
  1610 		goto _test_eof75;
       
  1611 case 75:
       
  1612 	switch( (*p) ) {
       
  1613 		case 32: goto tr15;
       
  1614 		case 45: goto st32;
       
  1615 		case 46: goto st42;
       
  1616 		case 47: goto tr7;
       
  1617 		case 58: goto tr9;
       
  1618 		case 95: goto st32;
       
  1619 	}
       
  1620 	if ( (*p) < 48 ) {
       
  1621 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1622 			goto tr15;
       
  1623 	} else if ( (*p) > 57 ) {
       
  1624 		if ( (*p) > 90 ) {
       
  1625 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1626 				goto st33;
       
  1627 		} else if ( (*p) >= 65 )
       
  1628 			goto st33;
       
  1629 	} else
       
  1630 		goto st76;
       
  1631 	goto tr14;
       
  1632 st76:
       
  1633 	if ( ++p == pe )
       
  1634 		goto _test_eof76;
       
  1635 case 76:
       
  1636 	switch( (*p) ) {
       
  1637 		case 32: goto tr15;
       
  1638 		case 45: goto st32;
       
  1639 		case 46: goto st42;
       
  1640 		case 47: goto tr7;
       
  1641 		case 58: goto tr9;
       
  1642 		case 95: goto st32;
       
  1643 	}
       
  1644 	if ( (*p) < 48 ) {
       
  1645 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1646 			goto tr15;
       
  1647 	} else if ( (*p) > 57 ) {
       
  1648 		if ( (*p) > 90 ) {
       
  1649 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1650 				goto st33;
       
  1651 		} else if ( (*p) >= 65 )
       
  1652 			goto st33;
       
  1653 	} else
       
  1654 		goto st33;
       
  1655 	goto tr14;
       
  1656 tr2:
       
  1657 #line 44 "parser.rl"
       
  1658 	{ p_request->tokens.scheme_start  = p; }
       
  1659 #line 48 "parser.rl"
       
  1660 	{ p_request->tokens.host_start  = p; }
       
  1661 	goto st77;
       
  1662 tr13:
       
  1663 #line 39 "parser.rl"
       
  1664 	{
       
  1665 		debug( 1, LOC, "Channel ID found in redirector input.  Set 'url_rewrite_concurrency' to '0' in squid.\n" );
       
  1666 		{p++; cs = 77; goto _out;}
       
  1667 	}
       
  1668 #line 44 "parser.rl"
       
  1669 	{ p_request->tokens.scheme_start  = p; }
       
  1670 #line 48 "parser.rl"
       
  1671 	{ p_request->tokens.host_start  = p; }
       
  1672 	goto st77;
       
  1673 st77:
       
  1674 	if ( ++p == pe )
       
  1675 		goto _test_eof77;
       
  1676 case 77:
       
  1677 #line 1678 "parser.c"
       
  1678 	switch( (*p) ) {
       
  1679 		case 32: goto tr15;
       
  1680 		case 45: goto st32;
       
  1681 		case 46: goto st34;
       
  1682 		case 47: goto tr7;
       
  1683 		case 58: goto tr9;
       
  1684 		case 95: goto st32;
       
  1685 	}
       
  1686 	if ( (*p) < 48 ) {
       
  1687 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1688 			goto tr15;
       
  1689 	} else if ( (*p) > 57 ) {
       
  1690 		if ( (*p) > 90 ) {
       
  1691 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1692 				goto st78;
       
  1693 		} else if ( (*p) >= 65 )
       
  1694 			goto st78;
       
  1695 	} else
       
  1696 		goto st33;
       
  1697 	goto tr92;
       
  1698 st78:
       
  1699 	if ( ++p == pe )
       
  1700 		goto _test_eof78;
       
  1701 case 78:
       
  1702 	switch( (*p) ) {
       
  1703 		case 32: goto tr15;
       
  1704 		case 45: goto st32;
       
  1705 		case 46: goto st34;
       
  1706 		case 47: goto tr7;
       
  1707 		case 58: goto tr9;
       
  1708 		case 95: goto st32;
       
  1709 	}
       
  1710 	if ( (*p) < 48 ) {
       
  1711 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1712 			goto tr15;
       
  1713 	} else if ( (*p) > 57 ) {
       
  1714 		if ( (*p) > 90 ) {
       
  1715 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1716 				goto st79;
       
  1717 		} else if ( (*p) >= 65 )
       
  1718 			goto st79;
       
  1719 	} else
       
  1720 		goto st33;
       
  1721 	goto tr92;
       
  1722 st79:
       
  1723 	if ( ++p == pe )
       
  1724 		goto _test_eof79;
       
  1725 case 79:
       
  1726 	switch( (*p) ) {
       
  1727 		case 32: goto tr15;
       
  1728 		case 45: goto st32;
       
  1729 		case 46: goto st34;
       
  1730 		case 47: goto tr7;
       
  1731 		case 58: goto tr95;
       
  1732 		case 95: goto st32;
       
  1733 	}
       
  1734 	if ( (*p) < 48 ) {
       
  1735 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1736 			goto tr15;
       
  1737 	} else if ( (*p) > 57 ) {
       
  1738 		if ( (*p) > 90 ) {
       
  1739 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1740 				goto st83;
       
  1741 		} else if ( (*p) >= 65 )
       
  1742 			goto st83;
       
  1743 	} else
       
  1744 		goto st33;
       
  1745 	goto tr92;
       
  1746 tr95:
       
  1747 #line 49 "parser.rl"
       
  1748 	{ p_request->tokens.host_length = p - ( *pe + p_request->tokens.host_start ); }
       
  1749 #line 52 "parser.rl"
       
  1750 	{ p_request->tokens.port_start  = p; }
       
  1751 	goto st80;
       
  1752 st80:
       
  1753 	if ( ++p == pe )
       
  1754 		goto _test_eof80;
       
  1755 case 80:
       
  1756 #line 1757 "parser.c"
       
  1757 	if ( (*p) == 47 )
       
  1758 		goto st81;
       
  1759 	if ( 48 <= (*p) && (*p) <= 57 )
       
  1760 		goto st37;
       
  1761 	goto tr92;
       
  1762 st81:
       
  1763 	if ( ++p == pe )
       
  1764 		goto _test_eof81;
       
  1765 case 81:
       
  1766 	if ( (*p) == 47 )
       
  1767 		goto st82;
       
  1768 	goto tr92;
       
  1769 st82:
       
  1770 	if ( ++p == pe )
       
  1771 		goto _test_eof82;
       
  1772 case 82:
       
  1773 	if ( (*p) < 65 ) {
       
  1774 		if ( 48 <= (*p) && (*p) <= 57 )
       
  1775 			goto tr99;
       
  1776 	} else if ( (*p) > 90 ) {
       
  1777 		if ( 97 <= (*p) && (*p) <= 122 )
       
  1778 			goto tr99;
       
  1779 	} else
       
  1780 		goto tr99;
       
  1781 	goto tr49;
       
  1782 st83:
       
  1783 	if ( ++p == pe )
       
  1784 		goto _test_eof83;
       
  1785 case 83:
       
  1786 	switch( (*p) ) {
       
  1787 		case 32: goto tr15;
       
  1788 		case 45: goto st32;
       
  1789 		case 46: goto st34;
       
  1790 		case 47: goto tr7;
       
  1791 		case 58: goto tr95;
       
  1792 		case 95: goto st32;
       
  1793 	}
       
  1794 	if ( (*p) < 48 ) {
       
  1795 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1796 			goto tr15;
       
  1797 	} else if ( (*p) > 57 ) {
       
  1798 		if ( (*p) > 90 ) {
       
  1799 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1800 				goto st84;
       
  1801 		} else if ( (*p) >= 65 )
       
  1802 			goto st84;
       
  1803 	} else
       
  1804 		goto st33;
       
  1805 	goto tr92;
       
  1806 st84:
       
  1807 	if ( ++p == pe )
       
  1808 		goto _test_eof84;
       
  1809 case 84:
       
  1810 	switch( (*p) ) {
       
  1811 		case 32: goto tr15;
       
  1812 		case 45: goto st32;
       
  1813 		case 46: goto st34;
       
  1814 		case 47: goto tr7;
       
  1815 		case 58: goto tr95;
       
  1816 		case 95: goto st32;
       
  1817 	}
       
  1818 	if ( (*p) < 48 ) {
       
  1819 		if ( 9 <= (*p) && (*p) <= 13 )
       
  1820 			goto tr15;
       
  1821 	} else if ( (*p) > 57 ) {
       
  1822 		if ( (*p) > 90 ) {
       
  1823 			if ( 97 <= (*p) && (*p) <= 122 )
       
  1824 				goto st33;
       
  1825 		} else if ( (*p) >= 65 )
       
  1826 			goto st33;
       
  1827 	} else
       
  1828 		goto st33;
       
  1829 	goto tr92;
       
  1830 	}
       
  1831 	_test_eof2: cs = 2; goto _test_eof; 
       
  1832 	_test_eof3: cs = 3; goto _test_eof; 
       
  1833 	_test_eof4: cs = 4; goto _test_eof; 
       
  1834 	_test_eof5: cs = 5; goto _test_eof; 
       
  1835 	_test_eof6: cs = 6; goto _test_eof; 
       
  1836 	_test_eof7: cs = 7; goto _test_eof; 
       
  1837 	_test_eof8: cs = 8; goto _test_eof; 
       
  1838 	_test_eof9: cs = 9; goto _test_eof; 
       
  1839 	_test_eof10: cs = 10; goto _test_eof; 
       
  1840 	_test_eof11: cs = 11; goto _test_eof; 
       
  1841 	_test_eof12: cs = 12; goto _test_eof; 
       
  1842 	_test_eof13: cs = 13; goto _test_eof; 
       
  1843 	_test_eof14: cs = 14; goto _test_eof; 
       
  1844 	_test_eof15: cs = 15; goto _test_eof; 
       
  1845 	_test_eof16: cs = 16; goto _test_eof; 
       
  1846 	_test_eof17: cs = 17; goto _test_eof; 
       
  1847 	_test_eof18: cs = 18; goto _test_eof; 
       
  1848 	_test_eof19: cs = 19; goto _test_eof; 
       
  1849 	_test_eof20: cs = 20; goto _test_eof; 
       
  1850 	_test_eof85: cs = 85; goto _test_eof; 
       
  1851 	_test_eof86: cs = 86; goto _test_eof; 
       
  1852 	_test_eof21: cs = 21; goto _test_eof; 
       
  1853 	_test_eof22: cs = 22; goto _test_eof; 
       
  1854 	_test_eof23: cs = 23; goto _test_eof; 
       
  1855 	_test_eof24: cs = 24; goto _test_eof; 
       
  1856 	_test_eof25: cs = 25; goto _test_eof; 
       
  1857 	_test_eof26: cs = 26; goto _test_eof; 
       
  1858 	_test_eof27: cs = 27; goto _test_eof; 
       
  1859 	_test_eof28: cs = 28; goto _test_eof; 
       
  1860 	_test_eof29: cs = 29; goto _test_eof; 
       
  1861 	_test_eof30: cs = 30; goto _test_eof; 
       
  1862 	_test_eof31: cs = 31; goto _test_eof; 
       
  1863 	_test_eof32: cs = 32; goto _test_eof; 
       
  1864 	_test_eof33: cs = 33; goto _test_eof; 
       
  1865 	_test_eof34: cs = 34; goto _test_eof; 
       
  1866 	_test_eof35: cs = 35; goto _test_eof; 
       
  1867 	_test_eof36: cs = 36; goto _test_eof; 
       
  1868 	_test_eof37: cs = 37; goto _test_eof; 
       
  1869 	_test_eof38: cs = 38; goto _test_eof; 
       
  1870 	_test_eof39: cs = 39; goto _test_eof; 
       
  1871 	_test_eof40: cs = 40; goto _test_eof; 
       
  1872 	_test_eof41: cs = 41; goto _test_eof; 
       
  1873 	_test_eof42: cs = 42; goto _test_eof; 
       
  1874 	_test_eof43: cs = 43; goto _test_eof; 
       
  1875 	_test_eof44: cs = 44; goto _test_eof; 
       
  1876 	_test_eof45: cs = 45; goto _test_eof; 
       
  1877 	_test_eof46: cs = 46; goto _test_eof; 
       
  1878 	_test_eof47: cs = 47; goto _test_eof; 
       
  1879 	_test_eof48: cs = 48; goto _test_eof; 
       
  1880 	_test_eof49: cs = 49; goto _test_eof; 
       
  1881 	_test_eof50: cs = 50; goto _test_eof; 
       
  1882 	_test_eof51: cs = 51; goto _test_eof; 
       
  1883 	_test_eof52: cs = 52; goto _test_eof; 
       
  1884 	_test_eof53: cs = 53; goto _test_eof; 
       
  1885 	_test_eof54: cs = 54; goto _test_eof; 
       
  1886 	_test_eof55: cs = 55; goto _test_eof; 
       
  1887 	_test_eof56: cs = 56; goto _test_eof; 
       
  1888 	_test_eof57: cs = 57; goto _test_eof; 
       
  1889 	_test_eof58: cs = 58; goto _test_eof; 
       
  1890 	_test_eof59: cs = 59; goto _test_eof; 
       
  1891 	_test_eof60: cs = 60; goto _test_eof; 
       
  1892 	_test_eof61: cs = 61; goto _test_eof; 
       
  1893 	_test_eof62: cs = 62; goto _test_eof; 
       
  1894 	_test_eof63: cs = 63; goto _test_eof; 
       
  1895 	_test_eof64: cs = 64; goto _test_eof; 
       
  1896 	_test_eof65: cs = 65; goto _test_eof; 
       
  1897 	_test_eof66: cs = 66; goto _test_eof; 
       
  1898 	_test_eof67: cs = 67; goto _test_eof; 
       
  1899 	_test_eof68: cs = 68; goto _test_eof; 
       
  1900 	_test_eof69: cs = 69; goto _test_eof; 
       
  1901 	_test_eof70: cs = 70; goto _test_eof; 
       
  1902 	_test_eof71: cs = 71; goto _test_eof; 
       
  1903 	_test_eof72: cs = 72; goto _test_eof; 
       
  1904 	_test_eof73: cs = 73; goto _test_eof; 
       
  1905 	_test_eof74: cs = 74; goto _test_eof; 
       
  1906 	_test_eof75: cs = 75; goto _test_eof; 
       
  1907 	_test_eof76: cs = 76; goto _test_eof; 
       
  1908 	_test_eof77: cs = 77; goto _test_eof; 
       
  1909 	_test_eof78: cs = 78; goto _test_eof; 
       
  1910 	_test_eof79: cs = 79; goto _test_eof; 
       
  1911 	_test_eof80: cs = 80; goto _test_eof; 
       
  1912 	_test_eof81: cs = 81; goto _test_eof; 
       
  1913 	_test_eof82: cs = 82; goto _test_eof; 
       
  1914 	_test_eof83: cs = 83; goto _test_eof; 
       
  1915 	_test_eof84: cs = 84; goto _test_eof; 
       
  1916 
       
  1917 	_test_eof: {}
       
  1918 	if ( p == eof )
       
  1919 	{
       
  1920 	switch ( cs ) {
       
  1921 	case 2: 
       
  1922 	case 12: 
       
  1923 	case 13: 
       
  1924 	case 14: 
       
  1925 	case 15: 
       
  1926 	case 16: 
       
  1927 	case 19: 
       
  1928 	case 21: 
       
  1929 	case 22: 
       
  1930 	case 23: 
       
  1931 	case 24: 
       
  1932 	case 25: 
       
  1933 	case 33: 
       
  1934 	case 34: 
       
  1935 	case 35: 
       
  1936 	case 36: 
       
  1937 	case 37: 
       
  1938 	case 38: 
       
  1939 	case 39: 
       
  1940 	case 40: 
       
  1941 	case 41: 
       
  1942 	case 47: 
       
  1943 	case 48: 
       
  1944 	case 49: 
       
  1945 	case 57: 
       
  1946 	case 58: 
       
  1947 	case 59: 
       
  1948 	case 66: 
       
  1949 	case 67: 
       
  1950 	case 68: 
       
  1951 	case 69: 
       
  1952 	case 70: 
       
  1953 #line 37 "parser.rl"
       
  1954 	{ valid = 0; }
       
  1955 	break;
       
  1956 	case 77: 
       
  1957 	case 78: 
       
  1958 	case 79: 
       
  1959 	case 80: 
       
  1960 	case 81: 
       
  1961 	case 83: 
       
  1962 	case 84: 
       
  1963 #line 46 "parser.rl"
       
  1964 	{ debug( 3, LOC, "Unable to parse scheme.\n" ); }
       
  1965 #line 37 "parser.rl"
       
  1966 	{ valid = 0; }
       
  1967 	break;
       
  1968 	case 32: 
       
  1969 	case 82: 
       
  1970 #line 50 "parser.rl"
       
  1971 	{ debug( 3, LOC, "Unable to parse hostname.\n" ); }
       
  1972 #line 37 "parser.rl"
       
  1973 	{ valid = 0; }
       
  1974 	break;
       
  1975 	case 17: 
       
  1976 #line 60 "parser.rl"
       
  1977 	{ debug( 3, LOC, "Unable to parse method.\n" ); }
       
  1978 #line 37 "parser.rl"
       
  1979 	{ valid = 0; }
       
  1980 	break;
       
  1981 	case 4: 
       
  1982 	case 5: 
       
  1983 	case 6: 
       
  1984 	case 7: 
       
  1985 	case 8: 
       
  1986 	case 9: 
       
  1987 	case 10: 
       
  1988 	case 11: 
       
  1989 	case 26: 
       
  1990 	case 27: 
       
  1991 	case 28: 
       
  1992 	case 29: 
       
  1993 	case 30: 
       
  1994 	case 31: 
       
  1995 	case 42: 
       
  1996 	case 43: 
       
  1997 	case 44: 
       
  1998 	case 45: 
       
  1999 	case 46: 
       
  2000 	case 50: 
       
  2001 	case 51: 
       
  2002 	case 52: 
       
  2003 	case 53: 
       
  2004 	case 54: 
       
  2005 	case 55: 
       
  2006 	case 56: 
       
  2007 	case 60: 
       
  2008 	case 61: 
       
  2009 	case 62: 
       
  2010 	case 63: 
       
  2011 	case 64: 
       
  2012 	case 65: 
       
  2013 	case 71: 
       
  2014 	case 72: 
       
  2015 	case 73: 
       
  2016 	case 74: 
       
  2017 	case 75: 
       
  2018 	case 76: 
       
  2019 #line 64 "parser.rl"
       
  2020 	{ debug( 3, LOC, "Unable to parse the client IP address.\n" ); }
       
  2021 #line 37 "parser.rl"
       
  2022 	{ valid = 0; }
       
  2023 	break;
       
  2024 	case 1: 
       
  2025 #line 46 "parser.rl"
       
  2026 	{ debug( 3, LOC, "Unable to parse scheme.\n" ); }
       
  2027 #line 50 "parser.rl"
       
  2028 	{ debug( 3, LOC, "Unable to parse hostname.\n" ); }
       
  2029 #line 37 "parser.rl"
       
  2030 	{ valid = 0; }
       
  2031 	break;
       
  2032 	case 3: 
       
  2033 #line 46 "parser.rl"
       
  2034 	{ debug( 3, LOC, "Unable to parse scheme.\n" ); }
       
  2035 #line 50 "parser.rl"
       
  2036 	{ debug( 3, LOC, "Unable to parse hostname.\n" ); }
       
  2037 #line 64 "parser.rl"
       
  2038 	{ debug( 3, LOC, "Unable to parse the client IP address.\n" ); }
       
  2039 #line 37 "parser.rl"
       
  2040 	{ valid = 0; }
       
  2041 	break;
       
  2042 #line 2043 "parser.c"
       
  2043 	}
       
  2044 	}
       
  2045 
       
  2046 	_out: {}
       
  2047 	}
       
  2048 
       
  2049 #line 190 "parser.rl"
       
  2050 
       
  2051 	/* If we were given an invalid line, bail early */
       
  2052 	if ( valid == 0 ) {
       
  2053 		free( p_request ), p_request = NULL;
       
  2054 		debug( 3, LOC, "Invalid line (%d), skipped\n", v.timer.lines + 1 );
       
  2055 		debug( 4, LOC, "%s", line );
       
  2056 		return( NULL );
       
  2057 	}
       
  2058 
       
  2059 	(void)populate_request( p_request );
       
  2060 	return( p_request );
       
  2061 }
       
  2062 
       
  2063 
       
  2064 /*
       
  2065  * Initialize and return a pointer to a new request object.
       
  2066  *
       
  2067  */
       
  2068 request *
       
  2069 init_request( void )
       
  2070 {
       
  2071 	request *p_request = NULL;
       
  2072 	if ( (p_request = malloc( sizeof(request) )) == NULL ) {
       
  2073 		debug( 1, LOC, "Unable to allocate memory for request struct: %s\n", strerror(errno) );
       
  2074 		return( NULL );
       
  2075 	}
       
  2076 	p_request->scheme    = NULL;
       
  2077 	p_request->host      = NULL;
       
  2078 	p_request->port      = NULL;
       
  2079 	p_request->path      = NULL;
       
  2080 	p_request->user      = NULL;
       
  2081 	p_request->method    = NULL;
       
  2082 	p_request->client_ip = NULL;
       
  2083 
       
  2084 	p_request->tokens.scheme_start = NULL;
       
  2085 	p_request->tokens.host_start   = NULL;
       
  2086 	p_request->tokens.port_start   = NULL;
       
  2087 	p_request->tokens.path_start   = NULL;
       
  2088 	p_request->tokens.meth_start   = NULL;
       
  2089 	p_request->tokens.c_ip_start   = NULL;
       
  2090 
       
  2091 	p_request->tokens.scheme_length = 0;
       
  2092 	p_request->tokens.host_length   = 0;
       
  2093 	p_request->tokens.port_length   = 0;
       
  2094 	p_request->tokens.path_length   = 0;
       
  2095 	p_request->tokens.meth_length   = 0;
       
  2096 	p_request->tokens.c_ip_length   = 0;
       
  2097 
       
  2098 	return p_request;
       
  2099 }
       
  2100 
       
  2101 
       
  2102 /*
       
  2103  * Take the previously parsed token locations and copy them into the request struct.
       
  2104  *
       
  2105  */
       
  2106 void
       
  2107 populate_request( struct request *p_request )
       
  2108 {
       
  2109 	p_request->scheme =
       
  2110 		copy_string_token( p_request->tokens.scheme_start, p_request->tokens.scheme_length );
       
  2111 	p_request->host =
       
  2112 		copy_string_token( p_request->tokens.host_start, p_request->tokens.host_length );
       
  2113 	p_request->port =
       
  2114 		copy_string_token( p_request->tokens.port_start, p_request->tokens.port_length );
       
  2115 	p_request->path =
       
  2116 		copy_string_token( p_request->tokens.path_start, p_request->tokens.path_length );
       
  2117 	p_request->method =
       
  2118 		copy_string_token( p_request->tokens.meth_start, p_request->tokens.meth_length );
       
  2119 	p_request->client_ip =
       
  2120 		copy_ipv4_token( p_request->tokens.c_ip_start, p_request->tokens.c_ip_length );
       
  2121 
       
  2122 	return;
       
  2123 }
       
  2124 
       
  2125 
       
  2126 /*
       
  2127  * Release memory used by request struct.
       
  2128  *
       
  2129  */
       
  2130 void
       
  2131 cleanup_request( struct request *p_request )
       
  2132 {
       
  2133 	if ( p_request == NULL ) return;
       
  2134 
       
  2135 	free( p_request->scheme );
       
  2136 	free( p_request->host );
       
  2137 	free( p_request->port );
       
  2138 	free( p_request->path );
       
  2139 	free( p_request->method );
       
  2140 	free( p_request->client_ip );
       
  2141 
       
  2142 	free( p_request ), p_request = NULL;
       
  2143 
       
  2144 	return;
       
  2145 }
       
  2146