| 1782 | ******************************************************************************/ |
| 1783 | |
| 1784 | int h2_util_frame_print(const nghttp2_frame *frame, char *buffer, size_t maxlen) |
| 1785 | { |
| 1786 | char scratch[128]; |
| 1787 | size_t s_len = sizeof(scratch)/sizeof(scratch[0]); |
| 1788 | |
| 1789 | switch (frame->hd.type) { |
| 1790 | case NGHTTP2_DATA: { |
| 1791 | return apr_snprintf(buffer, maxlen, |
| 1792 | "DATA[length=%d, flags=%d, stream=%d, padlen=%d]", |
| 1793 | (int)frame->hd.length, frame->hd.flags, |
| 1794 | frame->hd.stream_id, (int)frame->data.padlen); |
| 1795 | } |
| 1796 | case NGHTTP2_HEADERS: { |
| 1797 | return apr_snprintf(buffer, maxlen, |
| 1798 | "HEADERS[length=%d, hend=%d, stream=%d, eos=%d]", |
| 1799 | (int)frame->hd.length, |
| 1800 | !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS), |
| 1801 | frame->hd.stream_id, |
| 1802 | !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM)); |
| 1803 | } |
| 1804 | case NGHTTP2_PRIORITY: { |
| 1805 | return apr_snprintf(buffer, maxlen, |
| 1806 | "PRIORITY[length=%d, flags=%d, stream=%d]", |
| 1807 | (int)frame->hd.length, |
| 1808 | frame->hd.flags, frame->hd.stream_id); |
| 1809 | } |
| 1810 | case NGHTTP2_RST_STREAM: { |
| 1811 | return apr_snprintf(buffer, maxlen, |
| 1812 | "RST_STREAM[length=%d, flags=%d, stream=%d" |
| 1813 | ",error=%d]", |
| 1814 | (int)frame->hd.length, |
| 1815 | frame->hd.flags, frame->hd.stream_id, |
| 1816 | frame->rst_stream.error_code); |
| 1817 | } |
| 1818 | case NGHTTP2_SETTINGS: { |
| 1819 | if (frame->hd.flags & NGHTTP2_FLAG_ACK) { |
| 1820 | return apr_snprintf(buffer, maxlen, |
| 1821 | "SETTINGS[ack=1, stream=%d]", |
| 1822 | frame->hd.stream_id); |
| 1823 | } |
| 1824 | return apr_snprintf(buffer, maxlen, |
| 1825 | "SETTINGS[length=%d, stream=%d]", |
| 1826 | (int)frame->hd.length, frame->hd.stream_id); |
| 1827 | } |
| 1828 | case NGHTTP2_PUSH_PROMISE: { |
| 1829 | return apr_snprintf(buffer, maxlen, |
| 1830 | "PUSH_PROMISE[length=%d, hend=%d, stream=%d]", |
| 1831 | (int)frame->hd.length, |
| 1832 | !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS), |
| 1833 | frame->hd.stream_id); |
| 1834 | } |
| 1835 | case NGHTTP2_PING: { |
| 1836 | return apr_snprintf(buffer, maxlen, |
| 1837 | "PING[length=%d, ack=%d, stream=%d]", |
| 1838 | (int)frame->hd.length, |
| 1839 | frame->hd.flags&NGHTTP2_FLAG_ACK, |
| 1840 | frame->hd.stream_id); |
| 1841 | } |
no outgoing calls
no test coverage detected