| 582 | } |
| 583 | |
| 584 | static int on_frame_send_cb(nghttp2_session *ngh2, |
| 585 | const nghttp2_frame *frame, |
| 586 | void *user_data) |
| 587 | { |
| 588 | h2_session *session = user_data; |
| 589 | h2_stream *stream; |
| 590 | int stream_id = frame->hd.stream_id; |
| 591 | |
| 592 | ++session->frames_sent; |
| 593 | switch (frame->hd.type) { |
| 594 | case NGHTTP2_PUSH_PROMISE: |
| 595 | /* PUSH_PROMISE we report on the promised stream */ |
| 596 | stream_id = frame->push_promise.promised_stream_id; |
| 597 | break; |
| 598 | case NGHTTP2_RST_STREAM: |
| 599 | if(frame->rst_stream.error_code == NGHTTP2_FLOW_CONTROL_ERROR) |
| 600 | ++session->stream_errors; |
| 601 | break; |
| 602 | default: |
| 603 | break; |
| 604 | } |
| 605 | |
| 606 | stream = get_stream(session, stream_id); |
| 607 | if (APLOGcdebug(session->c1)) { |
| 608 | char buffer[256]; |
| 609 | |
| 610 | h2_util_frame_print(frame, buffer, sizeof(buffer)/sizeof(buffer[0])); |
| 611 | if (stream) { |
| 612 | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c1, |
| 613 | H2_STRM_LOG(APLOGNO(10303), stream, |
| 614 | "sent FRAME[%s], frames=%ld/%ld (r/s)"), |
| 615 | buffer, (long)session->frames_received, |
| 616 | (long)session->frames_sent); |
| 617 | } |
| 618 | else { |
| 619 | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c1, |
| 620 | H2_SSSN_LOG(APLOGNO(03068), session, |
| 621 | "sent FRAME[%s], frames=%ld/%ld (r/s)"), |
| 622 | buffer, (long)session->frames_received, |
| 623 | (long)session->frames_sent); |
| 624 | } |
| 625 | } |
| 626 | |
| 627 | if (stream) { |
| 628 | h2_stream_send_frame(stream, frame->hd.type, frame->hd.flags, |
| 629 | frame->hd.length + H2_FRAME_HDR_LEN); |
| 630 | } |
| 631 | return 0; |
| 632 | } |
| 633 | |
| 634 | static int on_frame_not_send_cb(nghttp2_session *ngh2, |
| 635 | const nghttp2_frame *frame, |
nothing calls this directly
no test coverage detected