| 519 | } |
| 520 | |
| 521 | static void DescribeHttpParserFlags(std::ostream& os, unsigned int flags) { |
| 522 | if (flags & F_CHUNKED) { |
| 523 | os << "F_CHUNKED|"; |
| 524 | } |
| 525 | if (flags & F_CONNECTION_KEEP_ALIVE) { |
| 526 | os << "F_CONNECTION_KEEP_ALIVE|"; |
| 527 | } |
| 528 | if (flags & F_CONNECTION_CLOSE) { |
| 529 | os << "F_CONNECTION_CLOSE|"; |
| 530 | } |
| 531 | if (flags & F_TRAILING) { |
| 532 | os << "F_TRAILING|"; |
| 533 | } |
| 534 | if (flags & F_UPGRADE) { |
| 535 | os << "F_UPGRADE|"; |
| 536 | } |
| 537 | if (flags & F_SKIPBODY) { |
| 538 | os << "F_SKIPBODY|"; |
| 539 | } |
| 540 | if (flags & F_CONTENTLENGTH) { |
| 541 | os << "F_CONTENTLENGTH|"; |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | std::ostream& operator<<(std::ostream& os, const http_parser& parser) { |
| 546 | os << "{type=" << http_parser_type_name((http_parser_type)parser.type) |