修訂 | b020dca34e10774c1c11d0d669c8d4f3d501abc6 (tree) |
---|---|
時間 | 2010-10-13 14:52:03 |
作者 | 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@10362 1ed66053-1c2d-0410-8867-f7571e6e31d3
@@ -327,14 +327,44 @@ protocol_module_base::check_message_result protocol_module_ip::check_parameter(c | ||
327 | 327 | bool forward_checked = false; |
328 | 328 | bool sorryuri_checked = false; |
329 | 329 | bool stats_checked = false; |
330 | + | |
331 | + // cf RFC 2396 (A. Collected BNF for URI) | |
330 | 332 | sregex sorry_uri_regex |
331 | 333 | = +('/' >> |
332 | - *(alpha | | |
333 | - digit | | |
334 | - (set = ';', ':', '@', '&', '=') | | |
335 | - (set = '$', '-', '_', '.', '+') | | |
336 | - (set = '!', '*', '\'', '\(', ')', ',') | | |
337 | - '%' >> repeat<2>(xdigit))); | |
334 | + *( | |
335 | + alpha | digit | | |
336 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | | |
337 | + '%' >> repeat<2>(xdigit) | | |
338 | + (set = ':', '@', '&', '=', '+', '$', ',') | |
339 | + ) | |
340 | + >> | |
341 | + *(';' >> | |
342 | + *( | |
343 | + alpha | digit | | |
344 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
345 | + '%' >> repeat<2>(xdigit) | // escaped | |
346 | + (set = ':', '@', '&', '=', '+', '$', ',') | |
347 | + ) // pchar | |
348 | + ) // param | |
349 | + ) // segment | |
350 | + >> | |
351 | + !('?' >> | |
352 | + *( | |
353 | + (set = ';', '/', '?', ':', '@', '&', '=', '+', '$', ',') | //reserved | |
354 | + alpha | digit | | |
355 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
356 | + '%' >> repeat<2>(xdigit) // escaped | |
357 | + ) // uric | |
358 | + ) // query | |
359 | + >> | |
360 | + !('#' >> | |
361 | + *( | |
362 | + (set = ';', '/', '?', ':', '@', '&', '=', '+', '$', ',') | //reserved | |
363 | + alpha | digit | | |
364 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
365 | + '%' >> repeat<2>(xdigit) // escaped | |
366 | + ) // uric | |
367 | + ); // fragment | |
338 | 368 | |
339 | 369 | typedef std::vector<std::string>::const_iterator vec_str_it; |
340 | 370 |
@@ -617,14 +647,44 @@ protocol_module_base::check_message_result protocol_module_ip::set_parameter(con | ||
617 | 647 | bool sorryuri_checked = false; |
618 | 648 | bool stats_checked = false; |
619 | 649 | boost::format formatter; |
620 | - sregex sorry_uri_regex | |
621 | - = +('/' >> | |
622 | - *(alpha | | |
623 | - digit | | |
624 | - (set = ';', ':', '@', '&', '=') | | |
625 | - (set = '$', '-', '_', '.', '+') | | |
626 | - (set = '!', '*', '\'', '\(', ')', ',') | | |
627 | - '%' >> repeat<2>(xdigit))); | |
650 | + | |
651 | + // cf RFC 2396 (A. Collected BNF for URI) | |
652 | + sregex sorry_uri_regex | |
653 | + = +('/' >> | |
654 | + *( | |
655 | + alpha | digit | | |
656 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | | |
657 | + '%' >> repeat<2>(xdigit) | | |
658 | + (set = ':', '@', '&', '=', '+', '$', ',') | |
659 | + ) | |
660 | + >> | |
661 | + *(';' >> | |
662 | + *( | |
663 | + alpha | digit | | |
664 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
665 | + '%' >> repeat<2>(xdigit) | // escaped | |
666 | + (set = ':', '@', '&', '=', '+', '$', ',') | |
667 | + ) // pchar | |
668 | + ) // param | |
669 | + ) // segment | |
670 | + >> | |
671 | + !('?' >> | |
672 | + *( | |
673 | + (set = ';', '/', '?', ':', '@', '&', '=', '+', '$', ',') | //reserved | |
674 | + alpha | digit | | |
675 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
676 | + '%' >> repeat<2>(xdigit) // escaped | |
677 | + ) // uric | |
678 | + ) // query | |
679 | + >> | |
680 | + !('#' >> | |
681 | + *( | |
682 | + (set = ';', '/', '?', ':', '@', '&', '=', '+', '$', ',') | //reserved | |
683 | + alpha | digit | | |
684 | + (set = '-', '_', '.', '!', '~', '*', '\'', '(', ')') | // mark | |
685 | + '%' >> repeat<2>(xdigit) // escaped | |
686 | + ) // uric | |
687 | + ); // fragment | |
628 | 688 | |
629 | 689 | typedef std::vector<std::string>::const_iterator vec_str_it; |
630 | 690 |