Changeset 995
- Timestamp:
- 03/23/08 22:48:10 (7 months ago)
- Files:
-
- branches/stable_1-2/Rakefile (modified) (2 diffs)
- branches/stable_1-2/bin/mongrel_rails (modified) (1 diff)
- branches/stable_1-2/ext/http11/ext_help.h (modified) (1 diff)
- branches/stable_1-2/ext/http11/http11.c (modified) (9 diffs)
- branches/stable_1-2/ext/http11/http11_parser.c (modified) (75 diffs)
- branches/stable_1-2/ext/http11/http11_parser.java.rl (modified) (1 diff)
- branches/stable_1-2/ext/http11/http11_parser.rl (modified) (6 diffs)
- branches/stable_1-2/ext/http11/http11_parser_common.rl (modified) (1 diff)
- branches/stable_1-2/ext/http11_java/org/jruby/mongrel/Http11Parser.java (modified) (3 diffs)
- branches/stable_1-2/lib/mongrel.rb (modified) (2 diffs)
- branches/stable_1-2/lib/mongrel/cgi.rb (modified) (2 diffs)
- branches/stable_1-2/lib/mongrel/http_request.rb (modified) (1 diff)
- branches/stable_1-2/lib/mongrel/http_response.rb (modified) (1 diff)
- branches/stable_1-2/projects/gem_plugin/CHANGELOG (modified) (1 diff)
- branches/stable_1-2/projects/gem_plugin/lib/gem_plugin.rb (modified) (2 diffs)
- branches/stable_1-2/projects/mongrel_cluster/lib/mongrel_cluster/init.rb (modified) (4 diffs)
- branches/stable_1-2/projects/mongrel_cluster/lib/mongrel_cluster/recipes_2.rb (modified) (2 diffs)
- branches/stable_1-2/test/unit/test_handlers.rb (modified) (1 diff)
- branches/stable_1-2/test/unit/test_http_parser.rb (moved) (moved from branches/stable_1-2/test/unit/test_http11.rb) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/stable_1-2/Rakefile
r985 r995 54 54 target = "http11_parser.c" 55 55 File.unlink target if File.exist? target 56 sh "ragel http11_parser.rl | rlgen-cd-G2 -o #{target}"56 sh "ragel http11_parser.rl -C -G2 -o #{target}" 57 57 raise "Failed to build C source" unless File.exist? target 58 58 end … … 60 60 target = "../../ext/http11_java/org/jruby/mongrel/Http11Parser.java" 61 61 File.unlink target if File.exist? target 62 sh "ragel -J http11_parser.java.rl | rlgen-java-o #{target}"62 sh "ragel http11_parser.rl -J -o #{target}" 63 63 raise "Failed to build Java source" unless File.exist? target 64 64 end branches/stable_1-2/bin/mongrel_rails
r877 r995 195 195 196 196 def Mongrel::send_signal(signal, pid_file) 197 pid = open(pid_file).read.to_i197 pid = File.read(pid_file).to_i 198 198 print "Sending #{signal} to Mongrel at PID #{pid}..." 199 199 begin branches/stable_1-2/ext/http11/ext_help.h
r4 r995 5 5 #define DATA_GET(from,type,name) Data_Get_Struct(from,type,name); RAISE_NOT_NULL(name); 6 6 #define REQUIRE_TYPE(V, T) if(TYPE(V) != T) rb_raise(rb_eTypeError, "Wrong argument type for " # V " required " # T); 7 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) 7 8 8 9 #ifdef DEBUG branches/stable_1-2/ext/http11/http11.c
r980 r995 8 8 #include <string.h> 9 9 #include "http11_parser.h" 10 #include <ctype.h> 10 11 #ifndef RSTRING_PTR 12 #define RSTRING_PTR(s) (RSTRING(s)->ptr) 13 #endif 14 #ifndef RSTRING_LEN 15 #define RSTRING_LEN(s) (RSTRING(s)->len) 16 #endif 11 17 12 18 static VALUE mMongrel; … … 16 22 #define id_handler_map rb_intern("@handler_map") 17 23 #define id_http_body rb_intern("@http_body") 18 19 static VALUE global_http_prefix; 24 #define HTTP_PREFIX "HTTP_" 25 #define HTTP_PREFIX_LEN (sizeof(HTTP_PREFIX) - 1) 26 20 27 static VALUE global_request_method; 21 28 static VALUE global_request_uri; … … 60 67 DEF_MAX_LENGTH(HEADER, (1024 * (80 + 32))); 61 68 69 struct common_field { 70 const signed long len; 71 const char *name; 72 VALUE value; 73 }; 74 75 /* 76 * A list of common HTTP headers we expect to receive. 77 * This allows us to avoid repeatedly creating identical string 78 * objects to be used with rb_hash_aset(). 79 */ 80 static struct common_field common_http_fields[] = { 81 # define f(N) { (sizeof(N) - 1), N, Qnil } 82 f("ACCEPT"), 83 f("ACCEPT_CHARSET"), 84 f("ACCEPT_ENCODING"), 85 f("ACCEPT_LANGUAGE"), 86 f("ALLOW"), 87 f("AUTHORIZATION"), 88 f("CACHE_CONTROL"), 89 f("CONNECTION"), 90 f("CONTENT_ENCODING"), 91 f("CONTENT_LENGTH"), 92 f("CONTENT_TYPE"), 93 f("COOKIE"), 94 f("DATE"), 95 f("EXPECT"), 96 f("FROM"), 97 f("HOST"), 98 f("IF_MATCH"), 99 f("IF_MODIFIED_SINCE"), 100 f("IF_NONE_MATCH"), 101 f("IF_RANGE"), 102 f("IF_UNMODIFIED_SINCE"), 103 f("KEEP_ALIVE"), /* Firefox sends this */ 104 f("MAX_FORWARDS"), 105 f("PRAGMA"), 106 f("PROXY_AUTHORIZATION"), 107 f("RANGE"), 108 f("REFERER"), 109 f("TE"), 110 f("TRAILER"), 111 f("TRANSFER_ENCODING"), 112 f("UPGRADE"), 113 f("USER_AGENT"), 114 f("VIA"), 115 f("X_FORWARDED_FOR"), /* common for proxies */ 116 f("X_REAL_IP"), /* common for proxies */ 117 f("WARNING") 118 # undef f 119 }; 120 121 /* 122 * qsort(3) and bsearch(3) improve average performance slightly, but may 123 * not be worth it for lack of portability to certain platforms... 124 */ 125 #if defined(HAVE_QSORT_BSEARCH) 126 /* sort by length, then by name if there's a tie */ 127 static int common_field_cmp(const void *a, const void *b) 128 { 129 struct common_field *cfa = (struct common_field *)a; 130 struct common_field *cfb = (struct common_field *)b; 131 signed long diff = cfa->len - cfb->len; 132 return diff ? diff : memcmp(cfa->name, cfb->name, cfa->len); 133 } 134 #endif /* HAVE_QSORT_BSEARCH */ 135 136 static void init_common_fields(void) 137 { 138 int i; 139 struct common_field *cf = common_http_fields; 140 char tmp[256]; /* MAX_FIELD_NAME_LENGTH */ 141 memcpy(tmp, HTTP_PREFIX, HTTP_PREFIX_LEN); 142 143 for(i = 0; i < ARRAY_SIZE(common_http_fields); cf++, i++) { 144 memcpy(tmp + HTTP_PREFIX_LEN, cf->name, cf->len + 1); 145 cf->value = rb_obj_freeze(rb_str_new(tmp, HTTP_PREFIX_LEN + cf->len)); 146 rb_global_variable(&cf->value); 147 } 148 149 #if defined(HAVE_QSORT_BSEARCH) 150 qsort(common_http_fields, 151 ARRAY_SIZE(common_http_fields), 152 sizeof(struct common_field), 153 common_field_cmp); 154 #endif /* HAVE_QSORT_BSEARCH */ 155 } 156 157 static VALUE find_common_field_value(const char *field, size_t flen) 158 { 159 #if defined(HAVE_QSORT_BSEARCH) 160 struct common_field key; 161 struct common_field *found; 162 key.name = field; 163 key.len = (signed long)flen; 164 found = (struct common_field *)bsearch(&key, common_http_fields, 165 ARRAY_SIZE(common_http_fields), 166 sizeof(struct common_field), 167 common_field_cmp); 168 return found ? found->value : Qnil; 169 #else /* !HAVE_QSORT_BSEARCH */ 170 int i; 171 struct common_field *cf = common_http_fields; 172 for(i = 0; i < ARRAY_SIZE(common_http_fields); i++, cf++) { 173 if (cf->len == flen && !memcmp(cf->name, field, flen)) 174 return cf->value; 175 } 176 return Qnil; 177 #endif /* !HAVE_QSORT_BSEARCH */ 178 } 62 179 63 180 void http_field(void *data, const char *field, size_t flen, const char *value, size_t vlen) 64 181 { 65 char *ch, *end;66 182 VALUE req = (VALUE)data; 67 183 VALUE v = Qnil; … … 72 188 73 189 v = rb_str_new(value, vlen); 74 f = rb_str_dup(global_http_prefix); 75 f = rb_str_buf_cat(f, field, flen); 76 77 for(ch = RSTRING(f)->ptr, end = ch + RSTRING(f)->len; ch < end; ch++) { 78 if(*ch == '-') { 79 *ch = '_'; 80 } else { 81 *ch = toupper(*ch); 82 } 190 191 f = find_common_field_value(field, flen); 192 193 if (f == Qnil) { 194 /* 195 * We got a strange header that we don't have a memoized value for. 196 * Fallback to creating a new string to use as a hash key. 197 * 198 * using rb_str_new(NULL, len) here is faster than rb_str_buf_new(len) 199 * in my testing, because: there's no minimum allocation length (and 200 * no check for it, either), RSTRING_LEN(f) does not need to be 201 * written twice, and and RSTRING_PTR(f) will already be 202 * null-terminated for us. 203 */ 204 f = rb_str_new(NULL, HTTP_PREFIX_LEN + flen); 205 memcpy(RSTRING_PTR(f), HTTP_PREFIX, HTTP_PREFIX_LEN); 206 memcpy(RSTRING_PTR(f) + HTTP_PREFIX_LEN, field, flen); 207 assert(*(RSTRING_PTR(f) + RSTRING_LEN(f)) == '\0'); /* paranoia */ 208 /* fprintf(stderr, "UNKNOWN HEADER <%s>\n", RSTRING_PTR(f)); */ 83 209 } 84 210 … … 169 295 rb_hash_aset(req, global_gateway_interface, global_gateway_interface_value); 170 296 if((temp = rb_hash_aref(req, global_http_host)) != Qnil) { 171 /* ruby better close strings off with a '\0' dammit */ 172 colon = strchr(RSTRING(temp)->ptr, ':'); 297 colon = memchr(RSTRING_PTR(temp), ':', RSTRING_LEN(temp)); 173 298 if(colon != NULL) { 174 rb_hash_aset(req, global_server_name, rb_str_substr(temp, 0, colon - RSTRING (temp)->ptr));299 rb_hash_aset(req, global_server_name, rb_str_substr(temp, 0, colon - RSTRING_PTR(temp))); 175 300 rb_hash_aset(req, global_server_port, 176 rb_str_substr(temp, colon - RSTRING (temp)->ptr+1,177 RSTRING (temp)->len));301 rb_str_substr(temp, colon - RSTRING_PTR(temp)+1, 302 RSTRING_LEN(temp))); 178 303 } else { 179 304 rb_hash_aset(req, global_server_name, temp); … … 296 421 297 422 from = FIX2INT(start); 298 dptr = RSTRING (data)->ptr;299 dlen = RSTRING (data)->len;423 dptr = RSTRING_PTR(data); 424 dlen = RSTRING_LEN(data); 300 425 301 426 if(from >= dlen) { … … 367 492 mMongrel = rb_define_module("Mongrel"); 368 493 369 DEF_GLOBAL(http_prefix, "HTTP_");370 494 DEF_GLOBAL(request_method, "REQUEST_METHOD"); 371 495 DEF_GLOBAL(request_uri, "REQUEST_URI"); … … 385 509 DEF_GLOBAL(server_protocol_value, "HTTP/1.1"); 386 510 DEF_GLOBAL(http_host, "HTTP_HOST"); 387 DEF_GLOBAL(mongrel_version, "Mongrel 1.2 .0"); /* XXX Why is this defined here? */511 DEF_GLOBAL(mongrel_version, "Mongrel 1.2"); /* XXX Why is this defined here? */ 388 512 DEF_GLOBAL(server_software, "SERVER_SOFTWARE"); 389 513 DEF_GLOBAL(port_80, "80"); … … 400 524 rb_define_method(cHttpParser, "finished?", HttpParser_is_finished,0); 401 525 rb_define_method(cHttpParser, "nread", HttpParser_nread,0); 402 } 526 init_common_fields(); 527 } branches/stable_1-2/ext/http11/http11_parser.c
r675 r995 11 11 #include <string.h> 12 12 13 /* 14 * capitalizes all lower-case ASCII characters, 15 * converts dashes to underscores. 16 */ 17 static void snake_upcase_char(char *c) 18 { 19 if (*c >= 'a' && *c <= 'z') 20 *c &= ~0x20; 21 else if (*c == '-') 22 *c = '_'; 23 } 24 13 25 #define LEN(AT, FPC) (FPC - buffer - parser->AT) 14 26 #define MARK(M,FPC) (parser->M = (FPC) - buffer) … … 17 29 /** Machine **/ 18 30 19 #line 74"http11_parser.rl"31 #line 87 "http11_parser.rl" 20 32 21 33 22 34 /** Data **/ 23 35 24 #line 25"http11_parser.c"36 #line 37 "http11_parser.c" 25 37 static const int http_parser_start = 1; 26 38 static const int http_parser_first_final = 57; … … 29 41 static const int http_parser_en_main = 1; 30 42 31 #line 78"http11_parser.rl"43 #line 91 "http11_parser.rl" 32 44 33 45 int http_parser_init(http_parser *parser) { 34 46 int cs = 0; 35 47 36 #line 37"http11_parser.c"48 #line 49 "http11_parser.c" 37 49 { 38 50 cs = http_parser_start; 39 51 } 40 #line 82"http11_parser.rl"52 #line 95 "http11_parser.rl" 41 53 parser->cs = cs; 42 54 parser->body_start = 0; … … 61 73 pe = buffer+len; 62 74 63 assert(*pe == '\0' && "pointer does not end on NUL");75 /* assert(*pe == '\0' && "pointer does not end on NUL"); */ 64 76 assert(pe - p == len - off && "pointers aren't same distance"); 65 77 66 78 67 79 68 #line 69"http11_parser.c"80 #line 81 "http11_parser.c" 69 81 { 70 82 if ( p == pe ) 71 goto _ out;83 goto _test_eof; 72 84 switch ( cs ) 73 85 { … … 87 99 goto st0; 88 100 st0: 89 goto _out0; 101 cs = 0; 102 goto _out; 90 103 tr0: 91 #line 22"http11_parser.rl"104 #line 34 "http11_parser.rl" 92 105 {MARK(mark, p); } 93 106 goto st2; 94 107 st2: 95 108 if ( ++p == pe ) 96 goto _ out2;109 goto _test_eof2; 97 110 case 2: 98 #line 99"http11_parser.c"111 #line 112 "http11_parser.c" 99 112 switch( (*p) ) { 100 113 case 32: goto tr2; … … 112 125 goto st0; 113 126 tr2: 114 #line 36"http11_parser.rl"127 #line 49 "http11_parser.rl" 115 128 { 116 129 if(parser->request_method != NULL) … … 120 133 st3: 121 134 if ( ++p == pe ) 122 goto _ out3;135 goto _test_eof3; 123 136 case 3: 124 #line 1 25"http11_parser.c"137 #line 138 "http11_parser.c" 125 138 switch( (*p) ) { 126 139 case 42: goto tr4; … … 139 152 goto st0; 140 153 tr4: 141 #line 22"http11_parser.rl"154 #line 34 "http11_parser.rl" 142 155 {MARK(mark, p); } 143 156 goto st4; 144 157 st4: 145 158 if ( ++p == pe ) 146 goto _ out4;159 goto _test_eof4; 147 160 case 4: 148 #line 1 49"http11_parser.c"161 #line 162 "http11_parser.c" 149 162 switch( (*p) ) { 150 163 case 32: goto tr8; … … 153 166 goto st0; 154 167 tr8: 155 #line 40"http11_parser.rl"168 #line 53 "http11_parser.rl" 156 169 { 157 170 if(parser->request_uri != NULL) … … 159 172 } 160 173 goto st5; 161 tr30: 162 #line 44 "http11_parser.rl" 174 tr31: 175 #line 34 "http11_parser.rl" 176 {MARK(mark, p); } 177 #line 57 "http11_parser.rl" 163 178 { 164 179 if(parser->fragment != NULL) … … 166 181 } 167 182 goto st5; 168 tr40: 169 #line 60 "http11_parser.rl" 183 tr34: 184 #line 57 "http11_parser.rl" 185 { 186 if(parser->fragment != NULL) 187 parser->fragment(parser->data, PTR_TO(mark), LEN(mark, p)); 188 } 189 goto st5; 190 tr42: 191 #line 73 "http11_parser.rl" 170 192 { 171 193 if(parser->request_path != NULL) 172 194 parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p)); 173 195 } 174 #line 40"http11_parser.rl"196 #line 53 "http11_parser.rl" 175 197 { 176 198 if(parser->request_uri != NULL) … … 178 200 } 179 201 goto st5; 180 tr5 1:181 #line 49"http11_parser.rl"202 tr53: 203 #line 62 "http11_parser.rl" 182 204 {MARK(query_start, p); } 183 #line 50"http11_parser.rl"205 #line 63 "http11_parser.rl" 184 206 { 185 207 if(parser->query_string != NULL) 186 208 parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p)); 187 209 } 188 #line 40"http11_parser.rl"210 #line 53 "http11_parser.rl" 189 211 { 190 212 if(parser->request_uri != NULL) … … 192 214 } 193 215 goto st5; 194 tr5 5:195 #line 50"http11_parser.rl"216 tr57: 217 #line 63 "http11_parser.rl" 196 218 { 197 219 if(parser->query_string != NULL) 198 220 parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p)); 199 221 } 200 #line 40"http11_parser.rl"222 #line 53 "http11_parser.rl" 201 223 { 202 224 if(parser->request_uri != NULL) … … 206 228 st5: 207 229 if ( ++p == pe ) 208 goto _ out5;230 goto _test_eof5; 209 231 case 5: 210 #line 2 11"http11_parser.c"232 #line 233 "http11_parser.c" 211 233 if ( (*p) == 72 ) 212 234 goto tr10; 213 235 goto st0; 214 236 tr10: 215 #line 22"http11_parser.rl"237 #line 34 "http11_parser.rl" 216 238 {MARK(mark, p); } 217 239 goto st6; 218 240 st6: 219 241 if ( ++p == pe ) 220 goto _ out6;242 goto _test_eof6; 221 243 case 6: 222 #line 2 23"http11_parser.c"244 #line 245 "http11_parser.c" 223 245 if ( (*p) == 84 ) 224 246 goto st7; … … 226 248 st7: 227 249 if ( ++p == pe ) 228 goto _ out7;250 goto _test_eof7; 229 251 case 7: 230 252 if ( (*p) == 84 ) … … 233 255 st8: 234 256 if ( ++p == pe ) 235 goto _ out8;257 goto _test_eof8; 236 258 case 8: 237 259 if ( (*p) == 80 ) … … 240 262 st9: 241 263 if ( ++p == pe ) 242 goto _ out9;264 goto _test_eof9; 243 265 case 9: 244 266 if ( (*p) == 47 ) … … 247 269 st10: 248 270 if ( ++p == pe ) 249 goto _ out10;271 goto _test_eof10; 250 272 case 10: 251 273 if ( 48 <= (*p) && (*p) <= 57 ) … … 254 276 st11: 255 277 if ( ++p == pe ) 256 goto _ out11;278 goto _test_eof11; 257 279 case 11: 258 280 if ( (*p) == 46 ) … … 263 285 st12: 264 286 if ( ++p == pe ) 265 goto _ out12;287 goto _test_eof12; 266 288 case 12: 267 289 if ( 48 <= (*p) && (*p) <= 57 ) … … 270 292 st13: 271 293 if ( ++p == pe ) 272 goto _ out13;294 goto _test_eof13; 273 295 case 13: 274 296 if ( (*p) == 13 ) … … 278 300 goto st0; 279 301 tr18: 280 #line 55"http11_parser.rl"302 #line 68 "http11_parser.rl" 281 303 { 282 304 if(parser->http_version != NULL) … … 285 307 goto st14; 286 308 tr26: 287 #line 31 "http11_parser.rl" 309 #line 43 "http11_parser.rl" 310 { MARK(mark, p); } 311 #line 44 "http11_parser.rl" 288 312 { 289 313 if(parser->http_field != NULL) { … … 292 316 } 293 317 goto st14; 318 tr29: 319 #line 44 "http11_parser.rl" 320 { 321 if(parser->http_field != NULL) { 322 parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p)); 323 } 324 } 325 goto st14; 294 326 st14: 295 327 if ( ++p == pe ) 296 goto _ out14;328 goto _test_eof14; 297 329 case 14: 298 #line 299"http11_parser.c"330 #line 331 "http11_parser.c" 299 331 if ( (*p) == 10 ) 300 332 goto st15; … … 302 334 st15: 303 335 if ( ++p == pe ) 304 goto _ out15;336 goto _test_eof15; 305 337 case 15: 306 338 switch( (*p) ) { … … 330 362 st16: 331 363 if ( ++p == pe ) 332 goto _ out16;364 goto _test_eof16; 333 365 case 16: 334 366 if ( (*p) == 10 ) … … 336 368 goto st0; 337 369 tr22: 338 #line 65"http11_parser.rl"370 #line 78 "http11_parser.rl" 339 371 { 340 372 parser->body_start = p - buffer + 1; 341 373 if(parser->header_done != NULL) 342 374 parser->header_done(parser->data, p + 1, pe - p - 1); 343 goto _out57;375 {p++; cs = 57; goto _out;} 344 376 } 345 377 goto st57; 346 378 st57: 347 379 if ( ++p == pe ) 348 goto _ out57;380 goto _test_eof57; 349 381 case 57: 350 #line 3 51"http11_parser.c"382 #line 383 "http11_parser.c" 351 383 goto st0; 352 384 tr21: 353 #line 25"http11_parser.rl"385 #line 37 "http11_parser.rl" 354 386 { MARK(field_start, p); } 387 #line 38 "http11_parser.rl" 388 { snake_upcase_char((char *)p); } 389 goto st17; 390 tr23: 391 #line 38 "http11_parser.rl" 392 { snake_upcase_char((char *)p); } 355 393 goto st17; 356 394 st17: 357 395 if ( ++p == pe ) 358 goto _ out17;396 goto _test_eof17; 359 397 case 17: 360 #line 3 61"http11_parser.c"361 switch( (*p) ) { 362 case 33: goto st17;398 #line 399 "http11_parser.c" 399 switch( (*p) ) { 400 case 33: goto tr23; 363 401 case 58: goto tr24; 364 case 124: goto st17;365 case 126: goto st17;402 case 124: goto tr23; 403 case 126: goto tr23; 366 404 } 367 405 if ( (*p) < 45 ) { 368 406 if ( (*p) > 39 ) { 369 407 if ( 42 <= (*p) && (*p) <= 43 ) 370 goto st17;408 goto tr23; 371 409 } else if ( (*p) >= 35 ) 372 goto st17;410 goto tr23; 373 411 } else if ( (*p) > 46 ) { 374 412 if ( (*p) < 65 ) { 375 413 if ( 48 <= (*p) && (*p) <= 57 ) 376 goto st17;414 goto tr23; 377 415 } else if ( (*p) > 90 ) { 378 416 if ( 94 <= (*p) && (*p) <= 122 ) 379 goto st17;417 goto tr23; 380 418 } else 381 goto st17;382 } else 383 goto st17;419 goto tr23; 420 } else 421 goto tr23; 384 422 goto st0; 385 423 tr24: 386 #line 26"http11_parser.rl"424 #line 39 "http11_parser.rl" 387 425 { 388 426 parser->field_len = LEN(field_start, p); … … 390 428 goto st18; 391 429 tr27: 392 #line 30"http11_parser.rl"430 #line 43 "http11_parser.rl" 393 431 { MARK(mark, p); } 394 432 goto st18; 395 433 st18: 396 434 if ( ++p == pe ) 397 goto _ out18;435 goto _test_eof18; 398 436 case 18: 399 #line 4 00"http11_parser.c"437 #line 438 "http11_parser.c" 400 438 switch( (*p) ) { 401 439 case 13: goto tr26; … … 404 442 goto tr25; 405 443 tr25: 406 #line 30"http11_parser.rl"444 #line 43 "http11_parser.rl" 407 445 { MARK(mark, p); } 408 446 goto st19; 409 447 st19: 410 448 if ( ++p == pe ) 411 goto _ out19;449 goto _test_eof19; 412 450 case 19: 413 #line 4 14"http11_parser.c"451 #line 452 "http11_parser.c" 414 452 if ( (*p) == 13 ) 415 goto tr2 6;453 goto tr29; 416 454 goto st19; 417 455 tr9: 418 #line 40"http11_parser.rl"456 #line 53 "http11_parser.rl" 419 457 { 420 458 if(parser->request_uri != NULL) … … 422 460 } 423 461 goto st20; 424 tr4 1:425 #line 60"http11_parser.rl"462 tr43: 463 #line 73 "http11_parser.rl" 426 464 { 427 465 if(parser->request_path != NULL) 428 466 parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p)); 429 467 } 430 #line 40"http11_parser.rl"468 #line 53 "http11_parser.rl" 431 469 { 432 470 if(parser->request_uri != NULL) … … 434 472 } 435 473 goto st20; 436 tr5 2:437 #line 49"http11_parser.rl"474 tr54: 475 #line 62 "http11_parser.rl" 438 476 {MARK(query_start, p); } 439 #line 50"http11_parser.rl"477 #line 63 "http11_parser.rl" 440 478 { 441 479 if(parser->query_string != NULL) 442 480 parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p)); 443 481 } 444 #line 40"http11_parser.rl"482 #line 53 "http11_parser.rl" 445 483 { 446 484 if(parser->request_uri != NULL) … … 448 486 } 449 487 goto st20; 450 tr5 6:451 #line 50"http11_parser.rl"488 tr58: 489 #line 63 "http11_parser.rl" 452 490 { 453 491 if(parser->query_string != NULL) 454 492 parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p)); 455 493 } 456 #line 40"http11_parser.rl"494 #line 53 "http11_parser.rl" 457 495 { 458 496 if(parser->request_uri != NULL) … … 462 500 st20: 463 501 if ( ++p == pe ) 464 goto _ out20;502 goto _test_eof20; 465 503 case 20: 466 #line 467"http11_parser.c"467 switch( (*p) ) { 468 case 32: goto tr3 0;469 case 37: goto tr3 1;504 #line 505 "http11_parser.c" 505 switch( (*p) ) { 506 case 32: goto tr31; 507 case 37: goto tr32; 470 508 case 60: goto st0; 471 509 case 62: goto st0; … … 477 515 } else if ( (*p) >= 0 ) 478 516 goto st0; 479 goto tr 29;480 tr 29:481 #line 22"http11_parser.rl"517 goto tr30; 518 tr30: 519 #line 34 "http11_parser.rl" 482 520 {MARK(mark, p); } 483 521 goto st21; 484 522 st21: 485 523 if ( ++p == pe ) 486 goto _ out21;524 goto _test_eof21; 487 525 case 21: 488 #line 489"http11_parser.c"489 switch( (*p) ) { 490 case 32: goto tr3 0;526 #line 527 "http11_parser.c" 527 switch( (*p) ) { 528 case 32: goto tr34; 491 529 case 37: goto st22; 492 530 case 60: goto st0; … … 500 538 goto st0; 501 539 goto st21; 502 tr3 1:503 #line 22"http11_parser.rl"540 tr32: 541 #line 34 "http11_parser.rl" 504 542 {MARK(mark, p); } 505 543 goto st22; 506 544 st22: 507 545 if ( ++p == pe ) 508 goto _ out22;546 goto _test_eof22; 509 547 case 22: 510 #line 5 11"http11_parser.c"548 #line 549 "http11_parser.c" 511 549 if ( (*p) < 65 ) { 512 550 if ( 48 <= (*p) && (*p) <= 57 ) … … 520 558 st23: 521 559 if ( ++p == pe ) 522 goto _ out23;560 goto _test_eof23; 523 561 case 23: 524 562 if ( (*p) < 65 ) { … … 532 570 goto st0; 533 571 tr5: 534 #line 22"http11_parser.rl"572 #line 34 "http11_parser.rl" 535 573 {MARK(mark, p); } 536 574 goto st24; 537 575 st24: 538 576 if ( ++p == pe ) 539 goto _ out24;577 goto _test_eof24; 540 578 case 24: 541 #line 5 42"http11_parser.c"579 #line 580 "http11_parser.c" 542 580 switch( (*p) ) { 543 581 case 43: goto st24; … … 557 595 goto st0; 558 596 tr7: 559 #line 22"http11_parser.rl"597 #line 34 "http11_parser.rl" 560 598 {MARK(mark, p); } 561 599 goto st25; 562 600 st25: 563 601 if ( ++p == pe ) 564 goto _ out25;602 goto _test_eof25; 565 603 case 25: 566 #line 567"http11_parser.c"604 #line 605 "http11_parser.c" 567 605 switch( (*p) ) { 568 606 case 32: goto tr8; … … 579 617 st26: 580 618 if ( ++p == pe ) 581 goto _ out26;619 goto _test_eof26; 582 620 case 26: 583 621 if ( (*p) < 65 ) { … … 592 630 st27: 593 631 if ( ++p == pe ) 594 goto _ out27;632 goto _test_eof27; 595 633 case 27: 596 634 if ( (*p) < 65 ) { … … 604 642 goto st0; 605 643 tr6: 606 #line 22"http11_parser.rl"644 #line 34 "http11_parser.rl" 607 645 {MARK(mark, p); } 608 646 goto st28; 609 647 st28: 610 648 if ( ++p == pe ) 611 goto _ out28;649 goto _test_eof28; 612 650 case 28: 613 #line 6 14"http11_parser.c"614 switch( (*p) ) { 615 case 32: goto tr4 0;651 #line 652 "http11_parser.c" 652 switch( (*p) ) { 653 case 32: goto tr42; 616 654 case 34: goto st0; 617 case 35: goto tr4 1;655 case 35: goto tr43; 618 656 case 37: goto st29; 619 case 59: goto tr4 3;657 case 59: goto tr45; 620 658 case 60: goto st0; 621 659 case 62: goto st0; 622 case 63: goto tr4 4;660 case 63: goto tr46; 623 661 case 127: goto st0; 624 662 } … … 628 666 st29: 629 667 if ( ++p == pe ) 630 goto _ out29;668 goto _test_eof29; 631 669 case 29: 632 670 if ( (*p) < 65 ) { … … 641 679 st30: 642 680 if ( ++p == pe ) 643 goto _ out30;681 goto _test_eof30; 644 682 case 30: 645 683 if ( (*p) < 65 ) { … … 652 690 goto st28; 653 691 goto st0; 654 tr4 3:655 #line 60"http11_parser.rl"692 tr45: 693 #line 73 "http11_parser.rl" 656 694 { 657 695 if(parser->request_path != NULL) … … 661 699 st31: 662 700 if ( ++p == pe ) 663 goto _ out31;701 goto _test_eof31; 664 702 case 31: 665 #line 666"http11_parser.c"703 #line 704 "http11_parser.c" 666 704 switch( (*p) ) { 667 705 case 32: goto tr8; … … 679 717 st32: 680 718 if ( ++p == pe ) 681 goto _ out32;719 goto _test_eof32; 682 720 case 32: 683 721 if ( (*p) < 65 ) { … … 692 730 st33: 693 731 if ( ++p == pe ) 694 goto _ out33;732 goto _test_eof33; 695 733 case 33: 696 734 if ( (*p) < 65 ) { … … 703 741 goto st31; 704 742 goto st0; 705 tr4 4:706 #line 60"http11_parser.rl"743 tr46: 744 #line 73 "http11_parser.rl" 707 745 { 708 746 if(parser->request_path != NULL) … … 712 750 st34: 713 751 if ( ++p == pe ) 714 goto _ out34;752 goto _test_eof34; 715 753 case 34: 716 #line 7 17"http11_parser.c"717 switch( (*p) ) { 718 case 32: goto tr5 1;754 #line 755 "http11_parser.c" 755 switch( (*p) ) { 756 case 32: goto tr53; 719 757 case 34: goto st0; 720 case 35: goto tr5 2;721 case 37: goto tr5 3;758 case 35: goto tr54; 759 case 37: goto tr55; 722 760 case 60: goto st0; 723 761 case 62: goto st0; … … 726 764 if ( 0 <= (*p) && (*p) <= 31 ) 727 765 goto st0; 72
