| 817 | } |
| 818 | |
| 819 | void |
| 820 | testPartial() |
| 821 | { |
| 822 | // Make sure the slow-loris defense works and that |
| 823 | // we don't get duplicate or missing fields on a split. |
| 824 | parsegrind<test_parser<true>>( |
| 825 | "GET / HTTP/1.1\r\n" |
| 826 | "a: 0\r\n" |
| 827 | "b: 1\r\n" |
| 828 | "c: 2\r\n" |
| 829 | "d: 3\r\n" |
| 830 | "e: 4\r\n" |
| 831 | "f: 5\r\n" |
| 832 | "g: 6\r\n" |
| 833 | "h: 7\r\n" |
| 834 | "i: 8\r\n" |
| 835 | "j: 9\r\n" |
| 836 | "\r\n", |
| 837 | [&](test_parser<true> const& p) |
| 838 | { |
| 839 | BEAST_EXPECT(p.fields.size() == 10); |
| 840 | BEAST_EXPECT(p.fields.at("a") == "0"); |
| 841 | BEAST_EXPECT(p.fields.at("b") == "1"); |
| 842 | BEAST_EXPECT(p.fields.at("c") == "2"); |
| 843 | BEAST_EXPECT(p.fields.at("d") == "3"); |
| 844 | BEAST_EXPECT(p.fields.at("e") == "4"); |
| 845 | BEAST_EXPECT(p.fields.at("f") == "5"); |
| 846 | BEAST_EXPECT(p.fields.at("g") == "6"); |
| 847 | BEAST_EXPECT(p.fields.at("h") == "7"); |
| 848 | BEAST_EXPECT(p.fields.at("i") == "8"); |
| 849 | BEAST_EXPECT(p.fields.at("j") == "9"); |
| 850 | }); |
| 851 | } |
| 852 | |
| 853 | void |
| 854 | testLimits() |