| 628 | |
| 629 | |
| 630 | static int on_frame_recv_callback(nghttp2_session *session, |
| 631 | const nghttp2_frame *frame, void *user_data) { |
| 632 | http2_session_data *session_data = (http2_session_data *)user_data; |
| 633 | http2_stream_data *stream_data; |
| 634 | |
| 635 | switch (frame->hd.type) { |
| 636 | case NGHTTP2_DATA: |
| 637 | case NGHTTP2_HEADERS: |
| 638 | LM_DBG("h2 header [%d], %p %zu\n", frame->hd.type, frame->headers.nva, frame->headers.nvlen); |
| 639 | /* Check that the client request has finished */ |
| 640 | if (frame->hd.flags & NGHTTP2_FLAG_END_STREAM) { |
| 641 | stream_data = |
| 642 | nghttp2_session_get_stream_user_data(session, frame->hd.stream_id); |
| 643 | LM_DBG("END STREAM, data: %p\n", stream_data); |
| 644 | /* For DATA and HEADERS frame, this callback may be called after |
| 645 | on_stream_close_callback. Check that stream still alive. */ |
| 646 | if (!stream_data) { |
| 647 | return 0; |
| 648 | } |
| 649 | return on_request_recv(session, session_data, stream_data); |
| 650 | } |
| 651 | break; |
| 652 | |
| 653 | default: |
| 654 | break; |
| 655 | } |
| 656 | |
| 657 | return 0; |
| 658 | } |
| 659 | |
| 660 | |
| 661 | int on_data_chunk_recv_callback(nghttp2_session *session, uint8_t flags, |
nothing calls this directly
no test coverage detected