修訂 | d5322a20f2fb98c835b835403e758819e0db2414 (tree) |
---|---|
時間 | 2010-10-13 15:01:32 |
作者 | 0809216 <0809216@1ed6...> |
Commiter | 0809216 |
#535 Fix: change sorry uri regex.
git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10363 1ed66053-1c2d-0410-8867-f7571e6e31d3
@@ -300,14 +300,45 @@ protocol_module_base::check_message_result protocol_module_sessionless::check_pa | ||
300 | 300 | bool forward_checked = false; |
301 | 301 | bool sorryuri_checked = false; |
302 | 302 | bool stats_checked = false; |
303 | + | |
304 | + // cf RFC 2396 (A. Collected BNF for URI) | |
303 | 305 | sregex sorry_uri_regex |
304 | 306 | = +('/' >> |
305 | - *(alpha | | |
306 | - digit | | |
307 | - (set = ';', ':', '@', '&', '=') | | |
308 | - (set = '$', '-', '_', '.', '+') | | |
309 | - (set = '!', '*', '\'', '\(', ')', ',') | | |
310 | - '%' >> repeat<2>(xdigit))); | |
307 | + *( | |
308 | + alpha | digit | | |
309 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | | |
310 | + '%' >> repeat<2>(xdigit) | | |
311 | + (set = ':', '@', '&', '=', '+', '$', ',') | |
312 | + ) | |
313 | + >> | |
314 | + *(';' >> | |
315 | + *( | |
316 | + alpha | digit | | |
317 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
318 | + '%' >> repeat<2>(xdigit) | // escaped | |
319 | + (set = ':', '@', '&', '=', '+', '$', ',') | |
320 | + ) // pchar | |
321 | + ) // param | |
322 | + ) // segment | |
323 | + >> | |
324 | + !('?' >> | |
325 | + *( | |
326 | + (set = ';', '/', '?', ':', '@', '&', '=', '+', '$', ',') | //reserved | |
327 | + alpha | digit | | |
328 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
329 | + '%' >> repeat<2>(xdigit) // escaped | |
330 | + ) // uric | |
331 | + ) // query | |
332 | + >> | |
333 | + !('#' >> | |
334 | + *( | |
335 | + (set = ';', '/', '?', ':', '@', '&', '=', '+', '$', ',') | //reserved | |
336 | + alpha | digit | | |
337 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
338 | + '%' >> repeat<2>(xdigit) // escaped | |
339 | + ) // uric | |
340 | + ); // fragment | |
341 | + | |
311 | 342 | typedef std::vector<std::string>::const_iterator vec_str_it; |
312 | 343 | |
313 | 344 | try { |
@@ -512,14 +543,44 @@ protocol_module_base::check_message_result protocol_module_sessionless::set_para | ||
512 | 543 | bool forward_checked = false; |
513 | 544 | bool sorryuri_checked = false; |
514 | 545 | bool stats_checked = false; |
546 | + | |
547 | + // cf RFC 2396 (A. Collected BNF for URI) | |
515 | 548 | sregex sorry_uri_regex |
516 | 549 | = +('/' >> |
517 | - *(alpha | | |
518 | - digit | | |
519 | - (set = ';', ':', '@', '&', '=') | | |
520 | - (set = '$', '-', '_', '.', '+') | | |
521 | - (set = '!', '*', '\'', '\(', ')', ',') | | |
522 | - '%' >> repeat<2>(xdigit))); | |
550 | + *( | |
551 | + alpha | digit | | |
552 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | | |
553 | + '%' >> repeat<2>(xdigit) | | |
554 | + (set = ':', '@', '&', '=', '+', '$', ',') | |
555 | + ) | |
556 | + >> | |
557 | + *(';' >> | |
558 | + *( | |
559 | + alpha | digit | | |
560 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
561 | + '%' >> repeat<2>(xdigit) | // escaped | |
562 | + (set = ':', '@', '&', '=', '+', '$', ',') | |
563 | + ) // pchar | |
564 | + ) // param | |
565 | + ) // segment | |
566 | + >> | |
567 | + !('?' >> | |
568 | + *( | |
569 | + (set = ';', '/', '?', ':', '@', '&', '=', '+', '$', ',') | //reserved | |
570 | + alpha | digit | | |
571 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
572 | + '%' >> repeat<2>(xdigit) // escaped | |
573 | + ) // uric | |
574 | + ) // query | |
575 | + >> | |
576 | + !('#' >> | |
577 | + *( | |
578 | + (set = ';', '/', '?', ':', '@', '&', '=', '+', '$', ',') | //reserved | |
579 | + alpha | digit | | |
580 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
581 | + '%' >> repeat<2>(xdigit) // escaped | |
582 | + ) // uric | |
583 | + ); // fragment | |
523 | 584 | |
524 | 585 | typedef std::vector<std::string>::const_iterator vec_str_it; |
525 | 586 |